Merge branch 'master' into fix-870

This commit is contained in:
Jim LAURIE 2018-05-14 15:06:42 +02:00 committed by GitHub
commit 371d2fbebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 58 additions and 79 deletions

View File

@ -86,6 +86,12 @@ module.exports = (scope, cb) => {
};
});
// Set collectionName
scope.collectionName = _.has(scope.args, 'collectionName') ? scope.args.collectionName : undefined;
// Set description
scope.description = _.has(scope.args, 'description') ? scope.args.description : undefined;
// Handle invalid action arguments.
// Send back invalidActions.
if (invalidAttributes.length) {

View File

@ -1,12 +1,16 @@
{
"connection": "<%= connection %>",
"collectionName": "<%= idPluralized %>",
"collectionName": "<%= collectionName || idPluralized %>",
"info": {
"name": "<%= id %>",
"description": "<%= description %>"
},
"options": {
"increments": true,
"timestamps": true,
"comment": ""
},
"attributes": {
<%= attributes %>
<%= attributes %>
}
}

View File

@ -5,64 +5,43 @@
*/
module.exports = {
// Before saving a value.
// Fired before an `insert` or `update` query.
// beforeSave: (model, attrs, options) => {
// return new Promise();
// },
// beforeSave: async (model, attrs, options) => {},
// After saving a value.
// Fired after an `insert` or `update` query.
// afterSave: (model, response, options) => {
// return new Promise();
// },
// afterSave: async (model, response, options) => {},
// Before fetching a value.
// Fired before a `fetch` operation.
// beforeFetch: (model, columns, options) => {
// return new Promise();
// },
// beforeFetch: async (model, columns, options) => {},
// After fetching a value.
// Fired after a `fetch` operation.
// afterFetch: (model, response, options) => {
// return new Promise();
// },
// afterFetch: async (model, response, options) => {},
// Before creating a value.
// Fired before `insert` query.
// beforeCreate: (model, attrs, options) => {
// return new Promise();
// },
// Fired before an `insert` query.
// beforeCreate: async (model, attrs, options) => {},
// After creating a value.
// Fired after `insert` query.
// afterCreate: (model, attrs, options) => {
// return new Promise();
// },
// Fired after an `insert` query.
// afterCreate: async (model, attrs, options) => {},
// Before updating a value.
// Fired before an `update` query.
// beforeUpdate: (model, attrs, options) => {
// return new Promise();
// },
// beforeUpdate: async (model, attrs, options) => {},
// After updating a value.
// Fired after an `update` query.
// afterUpdate: (model, attrs, options) => {
// return new Promise();
// },
// afterUpdate: async (model, attrs, options) => {},
// Before destroying a value.
// Fired before a `delete` query.
// beforeDestroy: (model, attrs, options) => {
// return new Promise();
// },
// beforeDestroy: async (model, attrs, options) => {},
// After destroying a value.
// Fired after a `delete` query.
// afterDestroy: (model, attrs, options) => {
// return new Promise();
// }
// afterDestroy: async (model, attrs, options) => {}
};

View File

@ -1,7 +1,14 @@
{
"connection": "<%= connection %>",
"collectionName": "<%= idPluralized %>",
"collectionName": "<%= collectionName || '' %>",
"info": {
"name": "<%= id %>",
"description": "<%= description %>"
},
"options": {
"timestamps": true
},
"attributes": {
<%= attributes %>
<%= attributes %>
}
}

View File

@ -5,64 +5,50 @@
*/
module.exports = {
// Before saving a value.
// Fired before an `insert` or `update` query.
// beforeSave: (model, attrs, options) => {
// return new Promise();
// },
// beforeSave: async (model) => {},
// After saving a value.
// Fired after an `insert` or `update` query.
// afterSave: (model, response, options) => {
// return new Promise();
// },
// afterSave: async (model, result) => {},
// Before fetching all values.
// Fired before a `fetchAll` operation.
// beforeFetchAll: async (model) => {},
// After fetching all values.
// Fired after a `fetchAll` operation.
// afterFetchAll: async (model, results) => {},
// Before fetching a value.
// Fired before a `fetch` operation.
// beforeFetch: (model, columns, options) => {
// return new Promise();
// },
// beforeFetch: async (model) => {},
// After fetching a value.
// Fired after a `fetch` operation.
// afterFetch: (model, response, options) => {
// return new Promise();
// },
// afterFetch: async (model, result) => {},
// Before creating a value.
// Fired before `insert` query.
// beforeCreate: (model, attrs, options) => {
// return new Promise();
// },
// Fired before an `insert` query.
// beforeCreate: async (model) => {},
// After creating a value.
// Fired after `insert` query.
// afterCreate: (model, attrs, options) => {
// return new Promise();
// },
// Fired after an `insert` query.
// afterCreate: async (model, result) => {},
// Before updating a value.
// Fired before an `update` query.
// beforeUpdate: (model, attrs, options) => {
// return new Promise();
// },
// beforeUpdate: async (model) => {},
// After updating a value.
// Fired after an `update` query.
// afterUpdate: (model, attrs, options) => {
// return new Promise();
// },
// afterUpdate: async (model, result) => {},
// Before destroying a value.
// Fired before a `delete` query.
// beforeDestroy: (model, attrs, options) => {
// return new Promise();
// },
// beforeDestroy: async (model) => {},
// After destroying a value.
// Fired after a `delete` query.
// afterDestroy: (model, attrs, options) => {
// return new Promise();
// }
// afterDestroy: async (model, result) => {}
};

View File

@ -214,11 +214,6 @@ export class EditPage extends React.Component {
this.props.setFormErrors(formErrors);
}
componentDidCatch(error, info) {
console.log('err', error);
console.log('info', info);
}
isCreating = () => this.props.match.params.id === 'create';
isRelationComponentNull = () => (

View File

@ -203,7 +203,7 @@ module.exports = {
// Aggregate first level actions.
const appActions = Object.keys(strapi.api || {}).reduce((acc, api) => {
Object.keys(strapi.api[api].controllers)
Object.keys(_.get(strapi.api[api], 'controllers', {}))
.map(controller => {
const actions = Object.keys(strapi.api[api].controllers[controller])
.filter(action => _.isFunction(strapi.api[api].controllers[controller][action]))

View File

@ -58,6 +58,8 @@
"strapi-generate": "3.0.0-alpha.12.1.3",
"strapi-generate-admin": "3.0.0-alpha.12.1.3",
"strapi-generate-api": "3.0.0-alpha.12.1.3",
"strapi-generate-controller": "3.0.0-alpha.12.1.3",
"strapi-generate-model": "3.0.0-alpha.12.1.3",
"strapi-generate-new": "3.0.0-alpha.12.1.3",
"strapi-generate-plugin": "3.0.0-alpha.12.1.3",
"strapi-generate-policy": "3.0.0-alpha.12.1.3",

View File

@ -32,5 +32,5 @@ cd ../strapi-plugin-upload
npm run test
# Test `strapi-helper-plugin`
cd ../strapi-helper-plugin/lib
npm run test
# cd ../strapi-helper-plugin/lib
# npm run test