mirror of
https://github.com/strapi/strapi.git
synced 2025-09-18 21:08:54 +00:00
Merge branch 'master' into fix-870
This commit is contained in:
commit
371d2fbebb
@ -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) {
|
||||
|
@ -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 %>
|
||||
}
|
||||
}
|
||||
|
@ -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) => {}
|
||||
};
|
||||
|
@ -1,7 +1,14 @@
|
||||
{
|
||||
"connection": "<%= connection %>",
|
||||
"collectionName": "<%= idPluralized %>",
|
||||
"collectionName": "<%= collectionName || '' %>",
|
||||
"info": {
|
||||
"name": "<%= id %>",
|
||||
"description": "<%= description %>"
|
||||
},
|
||||
"options": {
|
||||
"timestamps": true
|
||||
},
|
||||
"attributes": {
|
||||
<%= attributes %>
|
||||
<%= attributes %>
|
||||
}
|
||||
}
|
||||
|
@ -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) => {}
|
||||
};
|
||||
|
@ -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 = () => (
|
||||
|
@ -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]))
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user