mirror of
https://github.com/strapi/strapi.git
synced 2025-09-19 05:23:05 +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.
|
// Handle invalid action arguments.
|
||||||
// Send back invalidActions.
|
// Send back invalidActions.
|
||||||
if (invalidAttributes.length) {
|
if (invalidAttributes.length) {
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
{
|
{
|
||||||
"connection": "<%= connection %>",
|
"connection": "<%= connection %>",
|
||||||
"collectionName": "<%= idPluralized %>",
|
"collectionName": "<%= collectionName || idPluralized %>",
|
||||||
|
"info": {
|
||||||
|
"name": "<%= id %>",
|
||||||
|
"description": "<%= description %>"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"increments": true,
|
"increments": true,
|
||||||
"timestamps": true,
|
"timestamps": true,
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
<%= attributes %>
|
<%= attributes %>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,64 +5,43 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
// Before saving a value.
|
// Before saving a value.
|
||||||
// Fired before an `insert` or `update` query.
|
// Fired before an `insert` or `update` query.
|
||||||
// beforeSave: (model, attrs, options) => {
|
// beforeSave: async (model, attrs, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After saving a value.
|
// After saving a value.
|
||||||
// Fired after an `insert` or `update` query.
|
// Fired after an `insert` or `update` query.
|
||||||
// afterSave: (model, response, options) => {
|
// afterSave: async (model, response, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Before fetching a value.
|
// Before fetching a value.
|
||||||
// Fired before a `fetch` operation.
|
// Fired before a `fetch` operation.
|
||||||
// beforeFetch: (model, columns, options) => {
|
// beforeFetch: async (model, columns, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After fetching a value.
|
// After fetching a value.
|
||||||
// Fired after a `fetch` operation.
|
// Fired after a `fetch` operation.
|
||||||
// afterFetch: (model, response, options) => {
|
// afterFetch: async (model, response, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Before creating a value.
|
// Before creating a value.
|
||||||
// Fired before `insert` query.
|
// Fired before an `insert` query.
|
||||||
// beforeCreate: (model, attrs, options) => {
|
// beforeCreate: async (model, attrs, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After creating a value.
|
// After creating a value.
|
||||||
// Fired after `insert` query.
|
// Fired after an `insert` query.
|
||||||
// afterCreate: (model, attrs, options) => {
|
// afterCreate: async (model, attrs, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Before updating a value.
|
// Before updating a value.
|
||||||
// Fired before an `update` query.
|
// Fired before an `update` query.
|
||||||
// beforeUpdate: (model, attrs, options) => {
|
// beforeUpdate: async (model, attrs, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After updating a value.
|
// After updating a value.
|
||||||
// Fired after an `update` query.
|
// Fired after an `update` query.
|
||||||
// afterUpdate: (model, attrs, options) => {
|
// afterUpdate: async (model, attrs, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Before destroying a value.
|
// Before destroying a value.
|
||||||
// Fired before a `delete` query.
|
// Fired before a `delete` query.
|
||||||
// beforeDestroy: (model, attrs, options) => {
|
// beforeDestroy: async (model, attrs, options) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After destroying a value.
|
// After destroying a value.
|
||||||
// Fired after a `delete` query.
|
// Fired after a `delete` query.
|
||||||
// afterDestroy: (model, attrs, options) => {
|
// afterDestroy: async (model, attrs, options) => {}
|
||||||
// return new Promise();
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
{
|
{
|
||||||
"connection": "<%= connection %>",
|
"connection": "<%= connection %>",
|
||||||
"collectionName": "<%= idPluralized %>",
|
"collectionName": "<%= collectionName || '' %>",
|
||||||
|
"info": {
|
||||||
|
"name": "<%= id %>",
|
||||||
|
"description": "<%= description %>"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"timestamps": true
|
||||||
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
<%= attributes %>
|
<%= attributes %>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,64 +5,50 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
// Before saving a value.
|
// Before saving a value.
|
||||||
// Fired before an `insert` or `update` query.
|
// Fired before an `insert` or `update` query.
|
||||||
// beforeSave: (model, attrs, options) => {
|
// beforeSave: async (model) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After saving a value.
|
// After saving a value.
|
||||||
// Fired after an `insert` or `update` query.
|
// Fired after an `insert` or `update` query.
|
||||||
// afterSave: (model, response, options) => {
|
// afterSave: async (model, result) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
// 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.
|
// Fired before a `fetch` operation.
|
||||||
// beforeFetch: (model, columns, options) => {
|
// beforeFetch: async (model) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After fetching a value.
|
// After fetching a value.
|
||||||
// Fired after a `fetch` operation.
|
// Fired after a `fetch` operation.
|
||||||
// afterFetch: (model, response, options) => {
|
// afterFetch: async (model, result) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Before creating a value.
|
// Before creating a value.
|
||||||
// Fired before `insert` query.
|
// Fired before an `insert` query.
|
||||||
// beforeCreate: (model, attrs, options) => {
|
// beforeCreate: async (model) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After creating a value.
|
// After creating a value.
|
||||||
// Fired after `insert` query.
|
// Fired after an `insert` query.
|
||||||
// afterCreate: (model, attrs, options) => {
|
// afterCreate: async (model, result) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Before updating a value.
|
// Before updating a value.
|
||||||
// Fired before an `update` query.
|
// Fired before an `update` query.
|
||||||
// beforeUpdate: (model, attrs, options) => {
|
// beforeUpdate: async (model) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After updating a value.
|
// After updating a value.
|
||||||
// Fired after an `update` query.
|
// Fired after an `update` query.
|
||||||
// afterUpdate: (model, attrs, options) => {
|
// afterUpdate: async (model, result) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Before destroying a value.
|
// Before destroying a value.
|
||||||
// Fired before a `delete` query.
|
// Fired before a `delete` query.
|
||||||
// beforeDestroy: (model, attrs, options) => {
|
// beforeDestroy: async (model) => {},
|
||||||
// return new Promise();
|
|
||||||
// },
|
|
||||||
|
|
||||||
// After destroying a value.
|
// After destroying a value.
|
||||||
// Fired after a `delete` query.
|
// Fired after a `delete` query.
|
||||||
// afterDestroy: (model, attrs, options) => {
|
// afterDestroy: async (model, result) => {}
|
||||||
// return new Promise();
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
@ -214,11 +214,6 @@ export class EditPage extends React.Component {
|
|||||||
this.props.setFormErrors(formErrors);
|
this.props.setFormErrors(formErrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidCatch(error, info) {
|
|
||||||
console.log('err', error);
|
|
||||||
console.log('info', info);
|
|
||||||
}
|
|
||||||
|
|
||||||
isCreating = () => this.props.match.params.id === 'create';
|
isCreating = () => this.props.match.params.id === 'create';
|
||||||
|
|
||||||
isRelationComponentNull = () => (
|
isRelationComponentNull = () => (
|
||||||
|
@ -203,7 +203,7 @@ module.exports = {
|
|||||||
|
|
||||||
// Aggregate first level actions.
|
// Aggregate first level actions.
|
||||||
const appActions = Object.keys(strapi.api || {}).reduce((acc, api) => {
|
const appActions = Object.keys(strapi.api || {}).reduce((acc, api) => {
|
||||||
Object.keys(strapi.api[api].controllers)
|
Object.keys(_.get(strapi.api[api], 'controllers', {}))
|
||||||
.map(controller => {
|
.map(controller => {
|
||||||
const actions = Object.keys(strapi.api[api].controllers[controller])
|
const actions = Object.keys(strapi.api[api].controllers[controller])
|
||||||
.filter(action => _.isFunction(strapi.api[api].controllers[controller][action]))
|
.filter(action => _.isFunction(strapi.api[api].controllers[controller][action]))
|
||||||
|
@ -58,6 +58,8 @@
|
|||||||
"strapi-generate": "3.0.0-alpha.12.1.3",
|
"strapi-generate": "3.0.0-alpha.12.1.3",
|
||||||
"strapi-generate-admin": "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-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-new": "3.0.0-alpha.12.1.3",
|
||||||
"strapi-generate-plugin": "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",
|
"strapi-generate-policy": "3.0.0-alpha.12.1.3",
|
||||||
|
@ -32,5 +32,5 @@ cd ../strapi-plugin-upload
|
|||||||
npm run test
|
npm run test
|
||||||
|
|
||||||
# Test `strapi-helper-plugin`
|
# Test `strapi-helper-plugin`
|
||||||
cd ../strapi-helper-plugin/lib
|
# cd ../strapi-helper-plugin/lib
|
||||||
npm run test
|
# npm run test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user