Merge branch 'master' into patch-1

This commit is contained in:
Jim LAURIE 2019-01-09 14:34:28 +01:00 committed by GitHub
commit e66e7e3052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 194 additions and 165 deletions

View File

@ -82,7 +82,7 @@ Requests system can be implemented in custom code sections.
### Extracting requests filters
To extract the filters from an JavaScript object or a request, you need to call the [`strapi.utils.models.convertParams` helper](../api-reference/reference.md#strapiutils).
To extract the filters from a JavaScript object or a request, you need to call the [`strapi.utils.models.convertParams` helper](../api-reference/reference.md#strapiutils).
::: note
The returned objects are formatted according to the ORM used by the model.

View File

@ -27,6 +27,7 @@ The info key on the model-json states information about the model. This informat
The options key on the model-json states.
- `idAttribute`: This tells the model which attribute to expect as the unique identifier for each database row (typically an auto-incrementing primary key named 'id'). _Only valid for strapi-hook-bookshelf_
- `idAttributeType`: Data type of `idAttribute`, accepted list of value bellow. _Only valid for strapi-hook-bookshelf_
- `timestamps`: This tells the model which attributes to use for timestamps. Accepts either `boolean` or `Array` of strings where frist element is create data and second elemtent is update date. Default value when set to `true` for Bookshelf is `["created_at", "updated_at"]` and for MongoDB is `["createdAt", "updatedAt"]`.
## Define the attributes

View File

@ -24,3 +24,4 @@
- [Migration guide from alpha.15 to alpha.16](migration-guide-alpha.15-to-alpha.16.md)
- [Migration guide from alpha.15 to alpha.16](migration-guide-alpha.15-to-alpha.16.md)
- [Migration guide from alpha.16 to alpha.17](migration-guide-alpha.16-to-alpha.17.md)
- [Migration guide from alpha.17 to alpha.18](migration-guide-alpha.17-to-alpha.18.md)

View File

@ -49,7 +49,7 @@ Delete your old admin folder and replace it by the new one.
Copy this file `/plugins/users-permissions/config/jwt.json` **from your old project** and paste it in the corresponding one in your new project.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it by the new one.

View File

@ -45,7 +45,7 @@ Delete your old admin folder and replace it by the new one.
## Update the Plugins
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it by the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it by the new one.
If you did custom update on one of the plugin, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it by the new one.

View File

@ -52,7 +52,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -51,7 +51,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -52,7 +52,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -51,7 +51,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -51,7 +51,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -44,7 +44,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -48,7 +48,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -50,7 +50,7 @@ Delete your old admin folder and replace it with the new one.
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.

View File

@ -0,0 +1,59 @@
# Migration guide from alpha.17 to alpha.18
**Here are the major changes:**
- Improve debug on strapi new
- Apollo server tracing in GraphQL
- Fix cors
**Useful links:**
- Changelog: [https://github.com/strapi/strapi/releases/tag/v3.0.0-alpha.18](https://github.com/strapi/strapi/releases/tag/v3.0.0-alpha.18)
- GitHub diff: [https://github.com/strapi/strapi/compare/v3.0.0-alpha.17...v3.0.0-alpha.18](https://github.com/strapi/strapi/compare/v3.0.0-alpha.17...v3.0.0-alpha.18)
<br>
::: note
Feel free to [join us on Slack](http://slack.strapi.io) and ask questions about the migration process.
:::
<br>
## Getting started
Install Strapi `alpha.18` globally on your computer. To do so run `npm install strapi@3.0.0-alpha.18 -g`.
When it's done, generate a new empty project `strapi new myNewProject` (don't pay attention to the database configuration).
<br>
## Update node modules
Update the Strapi's dependencies version (move Strapi's dependencies to `3.0.0-alpha.18` version) of your project.
Run `npm install strapi@3.0.0-alpha.18 --save` to update your strapi version.
<br>
## Update the Admin
::: note
If you performed updates in the Admin, you will have to manually migrate your changes.
:::
Delete your old admin folder and replace it with the new one.
<br>
## Update the Plugins
::: note
If you did a custom update on one of the plugins, you will have to manually migrate your update.
:::
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it with the new one.
<br>
That's all, you have now upgraded to Strapi `alpha.18`.

View File

@ -60,7 +60,7 @@ Delete your old admin folder and replace it by the new one.
Copy this file `/plugins/users-permissions/config/jwt.json` **from your old project** and paste it in the corresponding one in your new project.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it by the new one.

View File

@ -49,7 +49,7 @@ Delete your old admin folder and replace it by the new one.
Copy this file `/plugins/users-permissions/config/jwt.json` **from your old project** and paste it in the corresponding one in your new project.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one.
Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` and `/plugins/users-permissions/config/jwt.json` file in the new one.
Then, delete your old `plugins` folder and replace it by the new one.

View File

@ -1,6 +1,6 @@
{
"private": true,
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"dependencies": {},
"devDependencies": {
"assert": "~1.3.0",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-admin",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Strapi Admin",
"repository": {
"type": "git",
@ -31,8 +31,8 @@
},
"devDependencies": {
"sanitize.css": "^4.1.0",
"strapi-helper-plugin": "3.0.0-alpha.17",
"strapi-utils": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18",
"strapi-utils": "3.0.0-alpha.18"
},
"author": {
"name": "Strapi",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-admin",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate the default admin panel for a Strapi application.",
"homepage": "http://strapi.io",
"keywords": [
@ -15,8 +15,8 @@
"dependencies": {
"fs-extra": "^4.0.1",
"lodash": "^4.17.5",
"strapi-admin": "3.0.0-alpha.17",
"strapi-utils": "3.0.0-alpha.17"
"strapi-admin": "3.0.0-alpha.18",
"strapi-utils": "3.0.0-alpha.18"
},
"author": {
"email": "hi@strapi.io",

View File

@ -64,31 +64,6 @@ module.exports = scope => {
}]
};
if (scope.args.tpl && scope.args.tpl !== 'mongoose') {
routes.routes.push({
method: 'POST',
path: '/' + scope.idPluralized + '/:' + tokenID + '/relationships/:relation',
handler: scope.globalID + '.createRelation',
config: {
policies: []
}
}, {
method: 'PUT',
path: '/' + scope.idPluralized + '/:' + tokenID + '/relationships/:relation',
handler: scope.globalID + '.updateRelation',
config: {
policies: []
}
}, {
method: 'DELETE',
path: '/' + scope.idPluralized + '/:' + tokenID + '/relationships/:relation',
handler: scope.globalID + '.destroyRelation',
config: {
policies: []
}
});
}
return routes;
}

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-api",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate an API for a Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -70,35 +70,5 @@ module.exports = {
destroy: async (ctx, next) => {
return strapi.services.<%= id %>.remove(ctx.params);
},
/**
* Add relation to a/an <%= id %> record.
*
* @return {Object}
*/
createRelation: async (ctx, next) => {
return strapi.services.<%= id %>.addRelation(ctx.params, ctx.request.body);
},
/**
* Update relation to a/an <%= id %> record.
*
* @return {Object}
*/
updateRelation: async (ctx, next) => {
return strapi.services.<%= id %>.editRelation(ctx.params, ctx.request.body);
},
/**
* Destroy relation to a/an <%= id %> record.
*
* @return {Object}
*/
destroyRelation: async (ctx, next) => {
return strapi.services.<%= id %>.removeRelation(ctx.params, ctx.request.body);
}
};

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-controller",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate a controller for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-model",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate a model for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-new",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate a new Strapi application.",
"homepage": "http://strapi.io",
"keywords": [
@ -19,7 +19,7 @@
"listr": "^0.14.1",
"lodash": "^4.17.5",
"ora": "^2.1.0",
"strapi-utils": "3.0.0-alpha.17",
"strapi-utils": "3.0.0-alpha.18",
"uuid": "^3.1.0"
},
"scripts": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-plugin",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate an plugin for a Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-policy",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate a policy for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-service",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Generate a service for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Master of ceremonies for the Strapi generators.",
"homepage": "http://strapi.io",
"keywords": [
@ -17,7 +17,7 @@
"fs-extra": "^4.0.0",
"lodash": "^4.17.5",
"reportback": "^2.0.1",
"strapi-utils": "3.0.0-alpha.17"
"strapi-utils": "3.0.0-alpha.18"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-helper-plugin",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Helper for Strapi plugins development",
"engines": {
"node": ">= 10.0.0",

View File

@ -89,7 +89,7 @@ module.exports = function(strapi) {
// Register the final model for Bookshelf.
const loadedModel = _.assign({
tableName: definition.collectionName,
hasTimestamps: _.get(definition, 'options.timestamps') === true,
hasTimestamps: _.get(definition, 'options.timestamps', false),
idAttribute: _.get(definition, 'options.idAttribute', 'id'),
associations: [],
defaults: Object.keys(definition.attributes).reduce((acc, current) => {
@ -100,7 +100,14 @@ module.exports = function(strapi) {
return acc;
}, {})
}, definition.options);
// Use default timestamp column names if value is `true`
if (_.get(loadedModel, 'hasTimestamps') === true) {
_.set(loadedModel, 'hasTimestamps', ['created_at', 'updated_at']);
}
// Use false for values other than `Boolean` or `Array`
if (!_.isArray(_.get(loadedModel, 'hasTimestamps')) && !_.isBoolean(_.get(loadedModel, 'hasTimestamps'))) {
_.set(loadedModel, 'hasTimestamps', false);
}
if (_.isString(_.get(connection, 'options.pivot_prefix'))) {
loadedModel.toJSON = function(options = {}) {
const { shallow = false, omitPivot = false } = options;
@ -619,10 +626,10 @@ module.exports = function(strapi) {
// Add created_at and updated_at field if timestamp option is true
if (loadedModel.hasTimestamps) {
definition.attributes['created_at'] = {
definition.attributes[_.isString(loadedModel.hasTimestamps[0]) ? loadedModel.hasTimestamps[0] : 'created_at'] = {
type: 'timestamp'
};
definition.attributes['updated_at'] = {
definition.attributes[_.isString(loadedModel.hasTimestamps[1]) ? loadedModel.hasTimestamps[1] : 'updated_at'] = {
type: 'timestampUpdate'
};
}
@ -701,8 +708,8 @@ module.exports = function(strapi) {
// Remove from attributes (auto handled by bookshlef and not displayed on ctb)
if (loadedModel.hasTimestamps) {
delete definition.attributes['created_at'];
delete definition.attributes['updated_at'];
delete definition.attributes[_.isString(loadedModel.hasTimestamps[0]) ? loadedModel.hasTimestamps[0] : 'created_at'];
delete definition.attributes[_.isString(loadedModel.hasTimestamps[1]) ? loadedModel.hasTimestamps[1] : 'updated_at'];
}
resolve();

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-bookshelf",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Bookshelf hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -21,8 +21,8 @@
"lodash": "^4.17.5",
"pluralize": "^6.0.0",
"rimraf": "^2.6.2",
"strapi-hook-knex": "3.0.0-alpha.17",
"strapi-utils": "3.0.0-alpha.17"
"strapi-hook-knex": "3.0.0-alpha.18",
"strapi-utils": "3.0.0-alpha.18"
},
"strapi": {
"dependencies": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-ejs",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "EJS hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-knex",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Knex hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -207,7 +207,16 @@ module.exports = function (strapi) {
});
});
collection.schema.set('timestamps', _.get(definition, 'options.timestamps') === true);
// Use provided timestamps if the elemnets in the array are string else use default.
if (_.isArray(_.get(definition, 'options.timestamps'))) {
const timestamps = {
createdAt: _.isString(_.get(definition, 'options.timestamps[0]')) ? _.get(definition, 'options.timestamps[0]') : 'createdAt',
updatedAt: _.isString(_.get(definition, 'options.timestamps[1]')) ? _.get(definition, 'options.timestamps[1]') : 'updatedAt'
};
collection.schema.set('timestamps', timestamps);
} else {
collection.schema.set('timestamps', _.get(definition, 'options.timestamps') === true);
}
collection.schema.set('minimize', _.get(definition, 'options.minimize', false) === true);
collection.schema.options.toObject = collection.schema.options.toJSON = {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-mongoose",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Mongoose hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -20,7 +20,7 @@
"mongoose-float": "^1.0.3",
"pluralize": "^6.0.0",
"rimraf": "^2.6.2",
"strapi-utils": "3.0.0-alpha.17"
"strapi-utils": "3.0.0-alpha.18"
},
"author": {
"email": "hi@strapi.io",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-redis",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Redis hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -19,7 +19,7 @@
"lodash": "^4.17.5",
"rimraf": "^2.6.2",
"stack-trace": "0.0.10",
"strapi-utils": "3.0.0-alpha.17"
"strapi-utils": "3.0.0-alpha.18"
},
"author": {
"email": "hi@strapi.io",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-lint",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Strapi eslint and prettier configurations",
"directories": {
"lib": "lib"

View File

@ -1,6 +1,6 @@
{
"name": "strapi-middleware-views",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Views middleware to enable server-side rendering for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -77,15 +77,10 @@ export function* submit() {
let shouldAddTranslationSuffix = false;
// Remove the updated_at & created_at fields so it is updated correctly when using Postgres or MySQL db
if (record.updated_at) {
delete record.created_at;
delete record.updated_at;
}
// Remove the updatedAt & createdAt fields so it is updated correctly when using MongoDB
if (record.updatedAt) {
delete record.createdAt;
delete record.updatedAt;
const timestamps = get(schema, ['models', currentModelName, 'options', 'timestamps'], null);
if (timestamps) {
delete record[timestamps[0]];
delete record[timestamps[1]];
}
try {

View File

@ -17,6 +17,7 @@ const pickData = (model) => _.pick(model, [
'globalId',
'globalName',
'orm',
'options.timestamps',
'loadedModel',
'primaryKey',
'associations'
@ -84,6 +85,7 @@ module.exports = async cb => {
pageEntries: 10,
defaultSort: model.primaryKey,
sort: 'ASC',
options: model.options,
editDisplay: {
availableFields: {},
fields: [],
@ -330,8 +332,9 @@ module.exports = async cb => {
// Here we just need to add the data from the current schema Object
apisToAdd.map(apiPath => {
const api = _.get(schema.models, apiPath);
const { search, filters, bulkActions, pageEntries } = _.get(prevSchema, 'generalSettings');
const { search, filters, bulkActions, pageEntries, options } = _.get(prevSchema, 'generalSettings');
_.set(api, 'options', options);
_.set(api, 'filters', filters);
_.set(api, 'search', search);
_.set(api, 'bulkActions', bulkActions);

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-content-manager",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "A powerful UI to easily manage your data.",
"strapi": {
"name": "Content Manager",
@ -26,7 +26,7 @@
"draft-js": "^0.10.5",
"react-select": "^1.2.1",
"showdown": "^1.8.6",
"strapi-helper-plugin": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18"
},
"dependencies": {
"pluralize": "^7.0.0"

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-content-type-builder",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Strapi plugin to create content type (API).",
"strapi": {
"name": "Content Type Builder",
@ -24,11 +24,11 @@
"dependencies": {
"immutable": "^3.8.2",
"pluralize": "^7.0.0",
"strapi-generate": "3.0.0-alpha.17",
"strapi-generate-api": "3.0.0-alpha.17"
"strapi-generate": "3.0.0-alpha.18",
"strapi-generate-api": "3.0.0-alpha.18"
},
"devDependencies": {
"strapi-helper-plugin": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18"
},
"author": {
"name": "Strapi team",

View File

@ -0,0 +1 @@
<svg width="24" height="22" xmlns="http://www.w3.org/2000/svg"><text transform="translate(-23 -7)" fill="#4B515A" fill-rule="evenodd" font-family="AppleColorEmoji, Apple Color Emoji" font-size="24"><tspan x="23" y="28">🗂</tspan></text></svg>

After

Width:  |  Height:  |  Size: 244 B

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-documentation",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Documentation",
@ -29,7 +29,7 @@
"swagger-ui-dist": "^3.18.3-republish2"
},
"devDependencies": {
"strapi-helper-plugin": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18"
},
"author": {
"name": "soupette",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-email",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Email",
@ -22,11 +22,11 @@
"prepublishOnly": "IS_MONOREPO=true npm run build"
},
"dependencies": {
"strapi-provider-email-sendmail": "3.0.0-alpha.17"
"strapi-provider-email-sendmail": "3.0.0-alpha.18"
},
"devDependencies": {
"react-copy-to-clipboard": "5.0.1",
"strapi-helper-plugin": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-graphql",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "This is the description of the plugin.",
"strapi": {
"name": "graphql",
@ -30,7 +30,7 @@
"graphql-type-json": "^0.2.1",
"graphql-type-datetime": "^0.2.2",
"pluralize": "^7.0.0",
"strapi-utils": "3.0.0-alpha.17"
"strapi-utils": "3.0.0-alpha.18"
},
"author": {
"name": "A Strapi developer",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-settings-manager",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Strapi plugin to manage settings.",
"strapi": {
"name": "Settings Manager",
@ -25,7 +25,7 @@
"devDependencies": {
"flag-icon-css": "^2.8.0",
"react-select": "^1.0.0-rc.5",
"strapi-helper-plugin": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-upload",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Files Upload",
@ -22,12 +22,12 @@
"prepublishOnly": "IS_MONOREPO=true npm run build"
},
"dependencies": {
"strapi-provider-upload-local": "3.0.0-alpha.17",
"strapi-provider-upload-local": "3.0.0-alpha.18",
"stream-to-array": "^2.3.0",
"uuid": "^3.2.1"
},
"devDependencies": {
"strapi-helper-plugin": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18"
},
"author": {
"name": "A Strapi developer",

View File

@ -37,7 +37,7 @@ export function* submitForm(action) {
const response = yield call(request, requestURL, { method: 'POST', body: omit(body, 'news') });
if(get(response, 'user.role.name', '') === 'Administrator' || isRegister){
yield call(auth.setToken, response.jwt, body.rememberMe);
yield call(auth.setUserInfo, response.user, body.rememberMe);
}

View File

@ -111,6 +111,14 @@
"policies": []
}
},
{
"method": "GET",
"path": "/permissions",
"handler": "UsersPermissions.getPermissions",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/providers",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-users-permissions",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Protect your API with a full-authentication process based on JWT",
"strapi": {
"name": "Roles & Permissions",
@ -29,11 +29,11 @@
"koa2-ratelimit": "^0.6.1",
"purest": "^2.0.1",
"request": "^2.83.0",
"strapi-utils": "3.0.0-alpha.17",
"strapi-utils": "3.0.0-alpha.18",
"uuid": "^3.1.0"
},
"devDependencies": {
"strapi-helper-plugin": "3.0.0-alpha.17"
"strapi-helper-plugin": "3.0.0-alpha.18"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-amazon-ses",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Amazon SES provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-mailgun",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Mailgun provider for strapi email plugin",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-sendgrid",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Sendgrid provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-sendmail",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Sendmail provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-aws-s3",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "AWS S3 provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-cloudinary",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Cloudinary provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-local",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Local provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-rackspace",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Rackspace provider for strapi upload",
"main": "./lib",
"scripts": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-utils",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "Shared utilities for the Strapi packages",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi",
"version": "3.0.0-alpha.17",
"version": "3.0.0-alpha.18",
"description": "An open source solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier.",
"homepage": "http://strapi.io",
"keywords": [
@ -60,16 +60,16 @@
"rimraf": "^2.6.2",
"semver": "^5.4.1",
"stack-trace": "0.0.10",
"strapi-generate": "3.0.0-alpha.17",
"strapi-generate-admin": "3.0.0-alpha.17",
"strapi-generate-api": "3.0.0-alpha.17",
"strapi-generate-controller": "3.0.0-alpha.17",
"strapi-generate-model": "3.0.0-alpha.17",
"strapi-generate-new": "3.0.0-alpha.17",
"strapi-generate-plugin": "3.0.0-alpha.17",
"strapi-generate-policy": "3.0.0-alpha.17",
"strapi-generate-service": "3.0.0-alpha.17",
"strapi-utils": "3.0.0-alpha.17"
"strapi-generate": "3.0.0-alpha.18",
"strapi-generate-admin": "3.0.0-alpha.18",
"strapi-generate-api": "3.0.0-alpha.18",
"strapi-generate-controller": "3.0.0-alpha.18",
"strapi-generate-model": "3.0.0-alpha.18",
"strapi-generate-new": "3.0.0-alpha.18",
"strapi-generate-plugin": "3.0.0-alpha.18",
"strapi-generate-policy": "3.0.0-alpha.18",
"strapi-generate-service": "3.0.0-alpha.18",
"strapi-utils": "3.0.0-alpha.18"
},
"author": {
"email": "hi@strapi.io",