diff --git a/docs/3.x.x/en/guides/email.md b/docs/3.x.x/en/guides/email.md index b9edddd7f8..f852e57929 100644 --- a/docs/3.x.x/en/guides/email.md +++ b/docs/3.x.x/en/guides/email.md @@ -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-) \ No newline at end of file +Check all community providers available on npmjs.org - [Providers list](https://www.npmjs.com/search?q=strapi-email-) diff --git a/docs/3.x.x/en/guides/upload.md b/docs/3.x.x/en/guides/upload.md index eae41c75f4..67a82b7054 100644 --- a/docs/3.x.x/en/guides/upload.md +++ b/docs/3.x.x/en/guides/upload.md @@ -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. diff --git a/packages/strapi-admin/admin/src/containers/AdminPage/saga.js b/packages/strapi-admin/admin/src/containers/AdminPage/saga.js index 6f2437af0e..6bb488aeb9 100644 --- a/packages/strapi-admin/admin/src/containers/AdminPage/saga.js +++ b/packages/strapi-admin/admin/src/containers/AdminPage/saga.js @@ -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'); } diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 17dd3cfbc8..bd3731a2a2 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -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" }, diff --git a/packages/strapi-plugin-graphql/services/GraphQL.js b/packages/strapi-plugin-graphql/services/GraphQL.js index 29f646ca2a..254b776464 100644 --- a/packages/strapi-plugin-graphql/services/GraphQL.js +++ b/packages/strapi-plugin-graphql/services/GraphQL.js @@ -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'; }, /** diff --git a/packages/strapi-plugin-users-permissions/services/UsersPermissions.js b/packages/strapi-plugin-users-permissions/services/UsersPermissions.js index 4e5fc46f2f..8064aa2aff 100644 --- a/packages/strapi-plugin-users-permissions/services/UsersPermissions.js +++ b/packages/strapi-plugin-users-permissions/services/UsersPermissions.js @@ -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) {