mirror of
https://github.com/strapi/strapi.git
synced 2025-09-06 23:28:02 +00:00
Merge branch 'master' into rename-hook-middleware
This commit is contained in:
commit
8a10225680
@ -27,8 +27,8 @@ To install a new provider run:
|
||||
$ 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.
|
||||
|
||||
Check all community providers available on npmjs.org - [Providers list](https://www.npmjs.com/search?q=strapi-email-)
|
||||
Check all community providers available on npmjs.org - [Providers list](https://www.npmjs.com/search?q=strapi-email-)
|
||||
|
@ -133,7 +133,7 @@ To install a new provider run:
|
||||
$ 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.
|
||||
|
||||
|
@ -11,15 +11,15 @@ import { GET_GA_STATUS, GET_LAYOUT } from './constants';
|
||||
|
||||
function* getGaStatus() {
|
||||
try {
|
||||
const [allowGa, strapiVersion, currentEnvironment] = yield [
|
||||
const [{ allowGa }, { strapiVersion }, { currentEnvironment }] = yield [
|
||||
call(request, '/admin/gaConfig', { method: 'GET' }),
|
||||
call(request, '/admin/strapiVersion', { method: 'GET' }),
|
||||
call(request, '/admin/currentEnvironment', { method: 'GET' }),
|
||||
];
|
||||
|
||||
yield put(getCurrEnvSucceeded(currentEnvironment.currentEnvironment));
|
||||
yield put(getCurrEnvSucceeded(currentEnvironment));
|
||||
yield put(getGaStatusSucceeded(allowGa));
|
||||
yield put(getStrapiVersionSucceeded(strapiVersion.strapiVersion));
|
||||
yield put(getStrapiVersionSucceeded(strapiVersion));
|
||||
} catch(err) {
|
||||
strapi.notification.error('notification.error');
|
||||
}
|
||||
|
@ -27,7 +27,8 @@
|
||||
"graphql-depth-limit": "^1.1.0",
|
||||
"graphql-playground-middleware-koa": "^1.6.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",
|
||||
"strapi-utils": "3.0.0-alpha.12.7.1"
|
||||
},
|
||||
|
@ -14,6 +14,7 @@ const pluralize = require('pluralize');
|
||||
const graphql = require('graphql');
|
||||
const { makeExecutableSchema } = require('graphql-tools');
|
||||
const GraphQLJSON = require('graphql-type-json');
|
||||
const GraphQLDateTime = require('graphql-type-datetime');
|
||||
const policyUtils = require('strapi-utils').policy;
|
||||
|
||||
module.exports = {
|
||||
@ -167,6 +168,12 @@ module.exports = {
|
||||
case 'float':
|
||||
type = 'Float';
|
||||
break;
|
||||
case 'time':
|
||||
case 'date':
|
||||
case 'datetime':
|
||||
case 'timestamp':
|
||||
type = 'DateTime';
|
||||
break;
|
||||
case 'enumeration':
|
||||
type = this.convertEnumType(definition, modelName, attributeName);
|
||||
break;
|
||||
@ -450,8 +457,8 @@ module.exports = {
|
||||
// Add timestamps attributes.
|
||||
if (_.get(model, 'options.timestamps') === true) {
|
||||
Object.assign(initialState, {
|
||||
createdAt: 'String!',
|
||||
updatedAt: 'String!'
|
||||
createdAt: 'DateTime!',
|
||||
updatedAt: 'DateTime!'
|
||||
});
|
||||
|
||||
Object.assign(acc.resolver[globalId], {
|
||||
@ -777,10 +784,11 @@ module.exports = {
|
||||
|
||||
addCustomScalar: (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) {
|
||||
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.
|
||||
const appActions = Object.keys(strapi.api || {}).reduce((acc, api) => {
|
||||
@ -232,7 +236,7 @@ module.exports = {
|
||||
// Merge array into one.
|
||||
const currentActions = appActions.concat(pluginsActions);
|
||||
// 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.
|
||||
if (!_.isEqual(actions, currentActions) || permissions < 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user