mirror of
https://github.com/strapi/strapi.git
synced 2025-09-07 15:49:24 +00:00
Merge branch 'master' into rename-hook-middleware
This commit is contained in:
commit
8a10225680
@ -27,7 +27,7 @@ To install a new provider run:
|
|||||||
$ npm install strapi-email-sendgrid@alpha --save
|
$ npm install strapi-email-sendgrid@alpha --save
|
||||||
```
|
```
|
||||||
|
|
||||||
We have two providers available `strapi-email-sendgrid` and `strapi-upload-mailgun`, use the alpha tag to install one of them. Then, visit `/admin/plugins/email/configurations/development` and configure the provider.
|
We have two providers available `strapi-email-sendgrid` and `strapi-upload-mailgun`, use the alpha tag to install one of them. Then, visit `/admin/plugins/email/configurations/development` on your web browser and configure the provider.
|
||||||
|
|
||||||
If you want to create your own, make sure the name starts with `strapi-email-` (duplicating an existing one will be easier to create), modify the `auth` config object and customize the `send` functions.
|
If you want to create your own, make sure the name starts with `strapi-email-` (duplicating an existing one will be easier to create), modify the `auth` config object and customize the `send` functions.
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ To install a new provider run:
|
|||||||
$ npm install strapi-upload-aws-s3@alpha --save
|
$ npm install strapi-upload-aws-s3@alpha --save
|
||||||
```
|
```
|
||||||
|
|
||||||
We have two providers available `strapi-upload-aws-s3` and `strapi-upload-cloudinary`, use the alpha tag to install one of them. Then, visit `/admin/plugins/upload/configurations/development` and configure the provider.
|
We have two providers available `strapi-upload-aws-s3` and `strapi-upload-cloudinary`, use the alpha tag to install one of them. Then, visit `/admin/plugins/upload/configurations/development` on your web browser and configure the provider.
|
||||||
|
|
||||||
If you want to create your own, make sure the name starts with `strapi-upload-` (duplicating an existing one will be easier to create), modify the `auth` config object and customize the `upload` and `delete` functions.
|
If you want to create your own, make sure the name starts with `strapi-upload-` (duplicating an existing one will be easier to create), modify the `auth` config object and customize the `upload` and `delete` functions.
|
||||||
|
|
||||||
|
@ -11,15 +11,15 @@ import { GET_GA_STATUS, GET_LAYOUT } from './constants';
|
|||||||
|
|
||||||
function* getGaStatus() {
|
function* getGaStatus() {
|
||||||
try {
|
try {
|
||||||
const [allowGa, strapiVersion, currentEnvironment] = yield [
|
const [{ allowGa }, { strapiVersion }, { currentEnvironment }] = yield [
|
||||||
call(request, '/admin/gaConfig', { method: 'GET' }),
|
call(request, '/admin/gaConfig', { method: 'GET' }),
|
||||||
call(request, '/admin/strapiVersion', { method: 'GET' }),
|
call(request, '/admin/strapiVersion', { method: 'GET' }),
|
||||||
call(request, '/admin/currentEnvironment', { method: 'GET' }),
|
call(request, '/admin/currentEnvironment', { method: 'GET' }),
|
||||||
];
|
];
|
||||||
|
|
||||||
yield put(getCurrEnvSucceeded(currentEnvironment.currentEnvironment));
|
yield put(getCurrEnvSucceeded(currentEnvironment));
|
||||||
yield put(getGaStatusSucceeded(allowGa));
|
yield put(getGaStatusSucceeded(allowGa));
|
||||||
yield put(getStrapiVersionSucceeded(strapiVersion.strapiVersion));
|
yield put(getStrapiVersionSucceeded(strapiVersion));
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
strapi.notification.error('notification.error');
|
strapi.notification.error('notification.error');
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
"graphql-depth-limit": "^1.1.0",
|
"graphql-depth-limit": "^1.1.0",
|
||||||
"graphql-playground-middleware-koa": "^1.6.1",
|
"graphql-playground-middleware-koa": "^1.6.1",
|
||||||
"graphql-tools": "^2.23.1",
|
"graphql-tools": "^2.23.1",
|
||||||
"graphql-type-json": "^0.2.0",
|
"graphql-type-json": "^0.2.1",
|
||||||
|
"graphql-type-datetime": "^0.2.2",
|
||||||
"pluralize": "^7.0.0",
|
"pluralize": "^7.0.0",
|
||||||
"strapi-utils": "3.0.0-alpha.12.7.1"
|
"strapi-utils": "3.0.0-alpha.12.7.1"
|
||||||
},
|
},
|
||||||
|
@ -14,6 +14,7 @@ const pluralize = require('pluralize');
|
|||||||
const graphql = require('graphql');
|
const graphql = require('graphql');
|
||||||
const { makeExecutableSchema } = require('graphql-tools');
|
const { makeExecutableSchema } = require('graphql-tools');
|
||||||
const GraphQLJSON = require('graphql-type-json');
|
const GraphQLJSON = require('graphql-type-json');
|
||||||
|
const GraphQLDateTime = require('graphql-type-datetime');
|
||||||
const policyUtils = require('strapi-utils').policy;
|
const policyUtils = require('strapi-utils').policy;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@ -167,6 +168,12 @@ module.exports = {
|
|||||||
case 'float':
|
case 'float':
|
||||||
type = 'Float';
|
type = 'Float';
|
||||||
break;
|
break;
|
||||||
|
case 'time':
|
||||||
|
case 'date':
|
||||||
|
case 'datetime':
|
||||||
|
case 'timestamp':
|
||||||
|
type = 'DateTime';
|
||||||
|
break;
|
||||||
case 'enumeration':
|
case 'enumeration':
|
||||||
type = this.convertEnumType(definition, modelName, attributeName);
|
type = this.convertEnumType(definition, modelName, attributeName);
|
||||||
break;
|
break;
|
||||||
@ -450,8 +457,8 @@ module.exports = {
|
|||||||
// Add timestamps attributes.
|
// Add timestamps attributes.
|
||||||
if (_.get(model, 'options.timestamps') === true) {
|
if (_.get(model, 'options.timestamps') === true) {
|
||||||
Object.assign(initialState, {
|
Object.assign(initialState, {
|
||||||
createdAt: 'String!',
|
createdAt: 'DateTime!',
|
||||||
updatedAt: 'String!'
|
updatedAt: 'DateTime!'
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.assign(acc.resolver[globalId], {
|
Object.assign(acc.resolver[globalId], {
|
||||||
@ -777,10 +784,11 @@ module.exports = {
|
|||||||
|
|
||||||
addCustomScalar: (resolvers) => {
|
addCustomScalar: (resolvers) => {
|
||||||
Object.assign(resolvers, {
|
Object.assign(resolvers, {
|
||||||
JSON: GraphQLJSON
|
JSON: GraphQLJSON,
|
||||||
|
DateTime: GraphQLDateTime,
|
||||||
});
|
});
|
||||||
|
|
||||||
return 'scalar JSON';
|
return 'scalar JSON \n scalar DateTime';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,7 +199,11 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updatePermissions: async function (cb) {
|
updatePermissions: async function (cb) {
|
||||||
const actions = strapi.plugins['users-permissions'].config.actions || [];
|
// fetch all the current permissions from the database, and format them into an array of actions.
|
||||||
|
const databasePermissions = await strapi.query('permission', 'users-permissions').find();
|
||||||
|
const actions = databasePermissions
|
||||||
|
.map(permission => `${permission.type}.${permission.controller}.${permission.action}`);
|
||||||
|
|
||||||
|
|
||||||
// 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) => {
|
||||||
@ -232,7 +236,7 @@ module.exports = {
|
|||||||
// Merge array into one.
|
// Merge array into one.
|
||||||
const currentActions = appActions.concat(pluginsActions);
|
const currentActions = appActions.concat(pluginsActions);
|
||||||
// Count permissions available.
|
// Count permissions available.
|
||||||
const permissions = await strapi.query('permission', 'users-permissions').count();
|
const permissions = databasePermissions.length;
|
||||||
|
|
||||||
// Compare to know if actions have been added or removed from controllers.
|
// Compare to know if actions have been added or removed from controllers.
|
||||||
if (!_.isEqual(actions, currentActions) || permissions < 1) {
|
if (!_.isEqual(actions, currentActions) || permissions < 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user