From 4a3c25fbfe23b714e282419eeb632a0cdd9d8b03 Mon Sep 17 00:00:00 2001 From: KuongKnight Date: Mon, 21 May 2018 17:22:25 +0700 Subject: [PATCH 01/44] Add config id type --- packages/strapi-bookshelf/lib/index.js | 392 +++++++++++++++++++++++-- 1 file changed, 362 insertions(+), 30 deletions(-) diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index be0cdfaa0c..2c131643c5 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -12,12 +12,11 @@ const _ = require('lodash'); const bookshelf = require('bookshelf'); const pluralize = require('pluralize'); -// Strapi helpers for models. -const utilsModels = require('strapi-utils').models; - // Local helpers. const utils = require('./utils/'); -const relations = require('./relations'); + +// Strapi helpers for models. +const utilsModels = require('strapi-utils').models; const PIVOT_PREFIX = '_pivot_'; const GLOBALS = {}; @@ -26,11 +25,8 @@ const GLOBALS = {}; * Bookshelf hook */ -/* eslint-disable no-unused-vars */ -/* eslint-disable prefer-template */ -/* eslint-disable no-case-declarations */ module.exports = function(strapi) { - const hook = _.merge({ + const hook = { /** * Default options */ @@ -79,17 +75,16 @@ module.exports = function(strapi) { _.forEach(models, (definition, model) => { definition.globalName = _.upperFirst(_.camelCase(definition.globalId)); - _.defaults(definition, { - primaryKey: 'id' - }); - // Define local GLOBALS to expose every models in this file. GLOBALS[definition.globalId] = {}; // Add some informations about ORM & client connection & tableName definition.orm = 'bookshelf'; definition.client = _.get(connection.settings, 'client'); - + _.defaults(definition, { + primaryKey: 'id', + primaryKeyType: _.get(definition, 'options.idAttributeType', definition.client === 'pg' ? 'SERIAL' : 'INT AUTO_INCREMENT') + }); // Register the final model for Bookshelf. const loadedModel = _.assign({ tableName: definition.collectionName, @@ -317,7 +312,6 @@ module.exports = function(strapi) { // Push attributes to be aware of model schema. target[model]._attributes = definition.attributes; - target[model].updateRelations = relations.update; databaseUpdate.push(new Promise(async (resolve) => { // Equilize database tables @@ -336,19 +330,23 @@ module.exports = function(strapi) { switch (relation.nature) { case 'oneToOne': case 'manyToOne': - type = definition.client === 'pg' ? 'integer' : 'int'; + type = definition.primaryKeyType; break; default: return null; } } else { switch (attribute.type) { + case 'uuid': + type = definition.client === 'pg' ? 'uuid' : 'varchar(255)'; + break; case 'text': - case 'json': type = 'text'; break; + case 'json': + type = definition.client === 'pg' ? 'jsonb' : 'text'; + break; case 'string': - case 'enumeration': case 'password': case 'email': type = 'varchar(255)'; @@ -358,10 +356,8 @@ module.exports = function(strapi) { type = definition.client === 'pg' ? 'integer' : 'int'; break; case 'float': - type = definition.client === 'pg' ? 'double precision' : 'double'; - break; case 'decimal': - type = 'decimal'; + type = attribute.type; break; case 'date': case 'time': @@ -398,7 +394,11 @@ module.exports = function(strapi) { }; if (!tableExist) { - const columns = generateColumns(attributes, [`id ${definition.client === 'pg' ? 'SERIAL' : 'INT AUTO_INCREMENT'} NOT NULL PRIMARY KEY`]).join(',\n\r'); + let idAttributeBuilder = [`id ${definition.primaryKeyType} NOT NULL PRIMARY KEY`]; + if (definition.primaryKeyType === 'uuid' && definition.client === 'pg') { + idAttributeBuilder = ['id uuid NOT NULL DEFAULT uuid_generate_v4() NOT NULL PRIMARY KEY']; + } + const columns = generateColumns(attributes, idAttributeBuilder).join(',\n\r'); // Create table await ORM.knex.raw(` @@ -483,10 +483,10 @@ module.exports = function(strapi) { if (morphRelations) { const attributes = { [`${loadedModel.tableName}_id`]: { - type: 'integer' + type: definition.primaryKeyType }, [`${morphRelations.alias}_id`]: { - type: 'integer' + type: definition.primaryKeyType }, [`${morphRelations.alias}_type`]: { type: 'text' @@ -511,10 +511,10 @@ module.exports = function(strapi) { const attributes = { [`${pluralize.singular(manyRelations.collection)}_id`]: { - type: 'integer' + type: definition.primaryKeyType }, [`${pluralize.singular(definition.globalId.toLowerCase())}_id`]: { - type: 'integer' + type: definition.primaryKeyType } }; @@ -849,7 +849,7 @@ module.exports = function(strapi) { cb(); }, - getQueryParams: (value, type, key) => { + getQueryParams: (value, type, key) => { const result = {}; switch (type) { @@ -896,18 +896,18 @@ module.exports = function(strapi) { }; break; case '_sort': - result.key = `sort`; + result.key = 'sort'; result.value = { key, order: value.toUpperCase() }; break; case '_start': - result.key = `start`; + result.key = 'start'; result.value = parseFloat(value); break; case '_limit': - result.key = `limit`; + result.key = 'limit'; result.value = parseFloat(value); break; case '_contains': @@ -923,8 +923,340 @@ module.exports = function(strapi) { } return result; + }, + + manageRelations: async function (model, params) { + const models = _.assign(_.clone(strapi.models), Object.keys(strapi.plugins).reduce((acc, current) => { + _.assign(acc, strapi.plugins[current].models); + return acc; + }, {})); + + const Model = models[model]; + + const virtualFields = []; + const record = await Model + .forge({ + [Model.primaryKey]: params[Model.primaryKey] + }) + .fetch({ + withRelated: Model.associations.map(x => x.alias) + }); + + const response = record ? record.toJSON() : record; + + // Only update fields which are on this document. + const values = params.parseRelationships === false ? params.values : Object.keys(JSON.parse(JSON.stringify(params.values))).reduce((acc, current) => { + const association = Model.associations.filter(x => x.alias === current)[0]; + const details = Model._attributes[current]; + + if (_.get(Model._attributes, `${current}.isVirtual`) !== true && _.isUndefined(association)) { + acc[current] = params.values[current]; + } else { + switch (association.nature) { + case 'oneWay': + acc[current] = _.get(params.values[current], this.primaryKey, params.values[current]) || null; + + break; + case 'oneToOne': + if (response[current] !== params.values[current]) { + const value = _.isNull(params.values[current]) ? response[current] : params.values; + + const recordId = _.isNull(params.values[current]) ? value[Model.primaryKey] || value.id || value._id : typeof value[current] === 'object' ? value[current].id : value[current]; + + if (response[current] && _.isObject(response[current]) && response[current][Model.primaryKey] !== value[current]) { + virtualFields.push( + this.manageRelations(details.collection || details.model, { + id: response[current][Model.primaryKey], + values: { + [details.via]: null + }, + parseRelationships: false + }) + ); + } + + // Remove previous relationship asynchronously if it exists. + virtualFields.push( + models[details.model || details.collection] + .forge({ id : recordId }) + .fetch({ + withRelated: models[details.model || details.collection].associations.map(x => x.alias) + }) + .then(response => { + const record = response ? response.toJSON() : response; + + if (record && _.isObject(record[details.via]) && record[details.via][current] !== value[current]) { + return this.manageRelations(model, { + id: record[details.via][models[details.model || details.collection].primaryKey] || record[details.via].id, + values: { + [current]: null + }, + parseRelationships: false + }); + } + + return Promise.resolve(); + }) + ); + + // Update the record on the other side. + // When params.values[current] is null this means that we are removing the relation. + virtualFields.push(this.manageRelations(details.model || details.collection, { + id: recordId, + values: { + [details.via]: _.isNull(params.values[current]) ? null : value[Model.primaryKey] || params.id || params._id || value.id || value._id + }, + parseRelationships: false + })); + + acc[current] = _.isNull(params.values[current]) ? null : typeof value[current] === 'object' ? value[current][Model.primaryKey] : value[current]; + } + + break; + case 'oneToMany': + case 'manyToOne': + case 'manyToMany': + if (details.dominant === true) { + acc[current] = params.values[current]; + } else if (response[current] && _.isArray(response[current]) && current !== 'id') { + // Records to add in the relation. + const toAdd = _.differenceWith(params.values[current], response[current], (a, b) => + ((typeof a === 'number') ? a : a[Model.primaryKey].toString()) === b[Model.primaryKey].toString() + ); + // Records to remove in the relation. + const toRemove = _.differenceWith(response[current], params.values[current], (a, b) => + a[Model.primaryKey].toString() === ((typeof b === 'number') ? b : b[Model.primaryKey].toString()) + ) + .filter(x => toAdd.find(y => x.id === y.id) === undefined); + + // Push the work into the flow process. + toAdd.forEach(value => { + value = (typeof value === 'number') ? { id: value } : value; + + value[details.via] = parseFloat(params[Model.primaryKey]); + params.values[Model.primaryKey] = parseFloat(params[Model.primaryKey]); + + virtualFields.push(this.addRelation(details.model || details.collection, { + id: value[Model.primaryKey] || value.id || value._id, + values: association.nature === 'manyToMany' ? params.values : value, + foreignKey: current + }, details.plugin)); + }); + + toRemove.forEach(value => { + value[details.via] = null; + + virtualFields.push(this.removeRelation(details.model || details.collection, { + id: value[Model.primaryKey] || value.id || value._id, + values: association.nature === 'manyToMany' ? params.values : value, + foreignKey: current + }, details.plugin)); + }); + } else if (_.get(Model._attributes, `${current}.isVirtual`) !== true) { + acc[current] = params.values[current]; + } + + break; + case 'manyMorphToMany': + case 'manyMorphToOne': + // Update the relational array. + params.values[current].forEach(obj => { + const model = obj.source && obj.source !== 'content-manager' ? + strapi.plugins[obj.source].models[obj.ref]: + strapi.models[obj.ref]; + + virtualFields.push(this.addRelationMorph(details.model || details.collection, { + id: response[this.primaryKey], + alias: association.alias, + ref: model.collectionName, + refId: obj.refId, + field: obj.field + }, obj.source)); + }); + break; + case 'oneToManyMorph': + case 'manyToManyMorph': + const transformToArrayID = (array) => { + if(_.isArray(array)) { + return array.map(value => { + if (_.isPlainObject(value)) { + return value._id || value.id; + } + + return value; + }); + } + + if (association.type === 'model') { + return _.isEmpty(array) ? [] : transformToArrayID([array]); + } + + return []; + }; + + // Compare array of ID to find deleted files. + const currentValue = transformToArrayID(response[current]).map(id => id.toString()); + const storedValue = transformToArrayID(params.values[current]).map(id => id.toString()); + + const toAdd = _.difference(storedValue, currentValue); + const toRemove = _.difference(currentValue, storedValue); + + toAdd.forEach(id => { + virtualFields.push(this.addRelationMorph(details.model || details.collection, { + id, + alias: association.via, + ref: Model.collectionName, + refId: response.id, + field: association.alias + }, details.plugin)); + }); + + // Update the relational array. + toRemove.forEach(id => { + virtualFields.push(this.removeRelationMorph(details.model || details.collection, { + id, + alias: association.via, + ref: Model.collectionName, + refId: response.id, + field: association.alias + }, details.plugin)); + }); + break; + case 'oneMorphToOne': + case 'oneMorphToMany': + break; + default: + } + } + + return acc; + }, {}); + + if (!_.isEmpty(values)) { + virtualFields.push(Model + .forge({ + [Model.primaryKey]: params[Model.primaryKey] + }) + .save(values, { + patch: true + })); + } else { + virtualFields.push(Promise.resolve(_.assign(response, params.values))); + } + + // Update virtuals fields. + await Promise.all(virtualFields); + }, + + addRelation: async function (model, params, source) { + const models = _.assign(_.clone(strapi.models), Object.keys(strapi.plugins).reduce((acc, current) => { + _.assign(acc, strapi.plugins[current].models); + return acc; + }, {})); + + const Model = models[model]; + const association = Model.associations.filter(x => x.via === params.foreignKey)[0]; + + if (!association) { + // Resolve silently. + return Promise.resolve(); + } + + switch (association.nature) { + case 'oneToOne': + case 'oneToMany': + return this.manageRelations(model, params); + case 'manyToMany': + return Model.forge({ + [Model.primaryKey]: parseFloat(params[Model.primaryKey]) + })[association.alias]().attach(params.values[Model.primaryKey]); + default: + // Resolve silently. + return Promise.resolve(); + } + }, + + removeRelation: async function (model, params, source) { + const models = _.assign(_.clone(strapi.models), Object.keys(strapi.plugins).reduce((acc, current) => { + _.assign(acc, strapi.plugins[current].models); + return acc; + }, {})); + + const Model = models[model]; + + const association = Model.associations.filter(x => x.via === params.foreignKey)[0]; + + if (!association) { + // Resolve silently. + return Promise.resolve(); + } + + switch (association.nature) { + case 'oneToOne': + case 'oneToMany': + return this.manageRelations(model, params); + case 'manyToMany': + return Model.forge({ + [Model.primaryKey]: parseFloat(params[Model.primaryKey]) + })[association.alias]().detach(params.values[Model.primaryKey]); + default: + // Resolve silently. + return Promise.resolve(); + } + }, + + addRelationMorph: async function (model, params, source) { + const models = _.assign(_.clone(strapi.models), Object.keys(strapi.plugins).reduce((acc, current) => { + _.assign(acc, strapi.plugins[current].models); + return acc; + }, {})); + + const Model = models[model]; + + const record = await Model.morph.forge() + .where({ + [`${Model.collectionName}_id`]: params.id, + [`${params.alias}_id`]: params.refId, + [`${params.alias}_type`]: params.ref, + field: params.field + }) + .fetch({ + withRelated: Model.associations.map(x => x.alias) + }); + + const entry = record ? record.toJSON() : record; + + if (entry) { + return Promise.resolve(); + } + + return await Model.morph.forge({ + [`${Model.collectionName}_id`]: params.id, + [`${params.alias}_id`]: params.refId, + [`${params.alias}_type`]: params.ref, + field: params.field + }) + .save(); + }, + + removeRelationMorph: async function (model, params, source) { + const models = _.assign(_.clone(strapi.models), Object.keys(strapi.plugins).reduce((acc, current) => { + _.assign(acc, strapi.plugins[current].models); + return acc; + }, {})); + + const Model = models[model]; + + return await Model.morph.forge() + .where({ + [`${Model.collectionName}_id`]: params.id, + [`${params.alias}_id`]: params.refId, + [`${params.alias}_type`]: params.ref, + field: params.field + }) + .destroy(); } - }, relations); + }; return hook; }; From f6bea4fd0a6be017fa6f4c6519f1287be141d15b Mon Sep 17 00:00:00 2001 From: KuongKnight Date: Tue, 22 May 2018 10:35:25 +0700 Subject: [PATCH 02/44] Fix configable id type --- packages/strapi-bookshelf/lib/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index 2c131643c5..9031f5ff64 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -83,7 +83,7 @@ module.exports = function(strapi) { definition.client = _.get(connection.settings, 'client'); _.defaults(definition, { primaryKey: 'id', - primaryKeyType: _.get(definition, 'options.idAttributeType', definition.client === 'pg' ? 'SERIAL' : 'INT AUTO_INCREMENT') + primaryKeyType: _.get(definition, 'options.idAttributeType', 'integer') }); // Register the final model for Bookshelf. const loadedModel = _.assign({ @@ -341,10 +341,11 @@ module.exports = function(strapi) { type = definition.client === 'pg' ? 'uuid' : 'varchar(255)'; break; case 'text': + case 'json': type = 'text'; break; - case 'json': - type = definition.client === 'pg' ? 'jsonb' : 'text'; + case 'jsonb': + type = 'jsonb'; break; case 'string': case 'password': @@ -394,9 +395,11 @@ module.exports = function(strapi) { }; if (!tableExist) { - let idAttributeBuilder = [`id ${definition.primaryKeyType} NOT NULL PRIMARY KEY`]; + let idAttributeBuilder = [`id ${definition.client === 'pg' ? 'SERIAL' : 'INT AUTO_INCREMENT'} NOT NULL PRIMARY KEY`]; if (definition.primaryKeyType === 'uuid' && definition.client === 'pg') { idAttributeBuilder = ['id uuid NOT NULL DEFAULT uuid_generate_v4() NOT NULL PRIMARY KEY']; + } else if (definition.primaryKeyType !== 'integer') { + idAttributeBuilder = [`id ${definition.primaryKeyType} NOT NULL PRIMARY KEY`]; } const columns = generateColumns(attributes, idAttributeBuilder).join(',\n\r'); @@ -449,7 +452,8 @@ module.exports = function(strapi) { const changeRequired = definition.client === 'pg' ? `ALTER COLUMN ${quote}${attribute}${quote} ${attributes[attribute].required ? 'SET' : 'DROP'} NOT NULL` : `CHANGE ${quote}${attribute}${quote} ${quote}${attribute}${quote} ${type} ${attributes[attribute].required ? 'NOT' : ''} NULL`; - + //console.log(`ALTER TABLE ${quote}${table}${quote} ${changeType}`); + //console.log(`ALTER TABLE ${quote}${table}${quote} ${changeRequired}`); await ORM.knex.raw(`ALTER TABLE ${quote}${table}${quote} ${changeType}`); await ORM.knex.raw(`ALTER TABLE ${quote}${table}${quote} ${changeRequired}`); } From 2bd58636d4aa8a648636ff974f794d4c6c491767 Mon Sep 17 00:00:00 2001 From: KuongKnight Date: Mon, 28 May 2018 23:26:23 +0700 Subject: [PATCH 03/44] Add colum has ralated oneWay --- packages/strapi-bookshelf/lib/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index 9031f5ff64..4b54ee0230 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -328,6 +328,7 @@ module.exports = function(strapi) { }); switch (relation.nature) { + case 'oneWay: case 'oneToOne': case 'manyToOne': type = definition.primaryKeyType; From 394ea8beaa4095f56af708d25b0422f04e8c68dc Mon Sep 17 00:00:00 2001 From: KuongKnight Date: Tue, 29 May 2018 09:18:56 +0700 Subject: [PATCH 04/44] Fix typo --- packages/strapi-bookshelf/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index 4b54ee0230..89c8ddde23 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -328,7 +328,7 @@ module.exports = function(strapi) { }); switch (relation.nature) { - case 'oneWay: + case 'oneWay': case 'oneToOne': case 'manyToOne': type = definition.primaryKeyType; From 06b741f32240816d26dc9034f1d1b8b9c9d342d6 Mon Sep 17 00:00:00 2001 From: David Thomas Date: Sun, 22 Jul 2018 22:03:29 -0400 Subject: [PATCH 05/44] Add Microsoft auth provider Closes #1385 --- .../admin/src/components/PopUpForm/index.js | 2 ++ .../admin/src/translations/en.json | 1 + .../config/functions/bootstrap.js | 8 +++++ .../services/Providers.js | 34 +++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/packages/strapi-plugin-users-permissions/admin/src/components/PopUpForm/index.js b/packages/strapi-plugin-users-permissions/admin/src/components/PopUpForm/index.js index 7f9ccbb40c..cf61fe02cd 100644 --- a/packages/strapi-plugin-users-permissions/admin/src/components/PopUpForm/index.js +++ b/packages/strapi-plugin-users-permissions/admin/src/components/PopUpForm/index.js @@ -49,6 +49,8 @@ class PopUpForm extends React.Component { // eslint-disable-line react/prefer-st return `${strapi.backendURL}/connect/google/callback`; case 'github': return get(this.props.values, 'redirect_uri', ''); + case 'microsoft': + return `${strapi.backendURL}/connect/microsoft/callback`; default: { const value = get(this.props.values, 'callback', ''); diff --git a/packages/strapi-plugin-users-permissions/admin/src/translations/en.json b/packages/strapi-plugin-users-permissions/admin/src/translations/en.json index f97bf1e2fc..8d0c431edf 100755 --- a/packages/strapi-plugin-users-permissions/admin/src/translations/en.json +++ b/packages/strapi-plugin-users-permissions/admin/src/translations/en.json @@ -166,6 +166,7 @@ "PopUpForm.Providers.facebook.providerConfig.redirectURL": "The redirect URL to add in your Facebook application configurations", "PopUpForm.Providers.google.providerConfig.redirectURL": "The redirect URL to add in your Google application configurations", "PopUpForm.Providers.github.providerConfig.redirectURL": "The redirect URL to add in your GitHub application configurations", + "PopUpForm.Providers.microsoft.providerConfig.redirectURL": "The redirect URL to add in your Microsoft application configurations", "PopUpForm.Providers.linkedin2.providerConfig.redirectURL": "The redirect URL to add in your Linkedin application configurations", "PopUpForm.Providers.twitter.providerConfig.redirectURL": "The redirect URL to add in your Twitter application configurations", diff --git a/packages/strapi-plugin-users-permissions/config/functions/bootstrap.js b/packages/strapi-plugin-users-permissions/config/functions/bootstrap.js index bbca66962f..fa17b6825e 100644 --- a/packages/strapi-plugin-users-permissions/config/functions/bootstrap.js +++ b/packages/strapi-plugin-users-permissions/config/functions/bootstrap.js @@ -66,6 +66,14 @@ module.exports = async cb => { 'user:email' ] }, + microsoft: { + enabled: false, + icon: 'windows', + key: '', + secret: '', + callback: '/auth/microsoft/callback', + scope: ['user.read'] + }, twitter: { enabled: false, icon: 'twitter', diff --git a/packages/strapi-plugin-users-permissions/services/Providers.js b/packages/strapi-plugin-users-permissions/services/Providers.js index a7f32886a1..0c24451dc9 100644 --- a/packages/strapi-plugin-users-permissions/services/Providers.js +++ b/packages/strapi-plugin-users-permissions/services/Providers.js @@ -172,6 +172,40 @@ const getProfile = async (provider, query, callback) => { }); break; } + case 'microsoft': { + const microsoft = new Purest({ + provider: 'microsoft', + config:{ + 'microsoft': { + 'https://graph.microsoft.com': { + '__domain': { + 'auth': { + 'auth': {'bearer': '[0]'} + } + }, + '[version]/{endpoint}': { + '__path': { + 'alias': '__default', + 'version': 'v1.0' + } + } + } + } + } + }); + + microsoft.query().get('me').auth(access_token).request((err, res, body) => { + if (err) { + callback(err); + } else { + callback(null, { + username: body.userPrincipalName, + email: body.userPrincipalName + }); + } + }); + break; + } case 'twitter': { const twitter = new Purest({ provider: 'twitter', From 738cbf656acdfe2b3c9e615ea6e36f2eb1c63bb4 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 1 Aug 2018 14:56:31 +0200 Subject: [PATCH 06/44] Add rate limit on auth routes --- packages/strapi-admin/package.json | 2 +- packages/strapi-email-amazon-ses/package.json | 4 ++-- packages/strapi-email-mailgun/package.json | 2 +- packages/strapi-email-sendgrid/package.json | 2 +- packages/strapi-email-sendmail/package.json | 2 +- packages/strapi-generate-admin/package.json | 2 +- packages/strapi-generate/package.json | 2 +- packages/strapi-helper-plugin/package.json | 2 +- packages/strapi-hook-knex/package.json | 2 +- packages/strapi-hook-mongoose/package.json | 2 +- packages/strapi-hook-redis/package.json | 2 +- packages/strapi-lint/package.json | 2 +- packages/strapi-middleware-views/package.json | 2 +- packages/strapi-plugin-graphql/package.json | 2 +- .../admin/src/translations/en.json | 1 + .../config/policies/rateLimit.js | 12 ++++++++++++ .../config/routes.json | 10 +++++----- .../strapi-plugin-users-permissions/package.json | 1 + .../services/Providers.js | 2 +- packages/strapi-upload-aws-s3/package.json | 2 +- packages/strapi-upload-cloudinary/package.json | 2 +- packages/strapi-upload-local/package.json | 2 +- packages/strapi-upload-rackspace/package.json | 2 +- packages/strapi-utils/package.json | 2 +- packages/strapi/package.json | 2 +- 25 files changed, 41 insertions(+), 27 deletions(-) create mode 100644 packages/strapi-plugin-users-permissions/config/policies/rateLimit.js diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index b5778e1491..a918c9edf7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-email-amazon-ses/package.json b/packages/strapi-email-amazon-ses/package.json index 74c181aa1c..1c58d73fa1 100644 --- a/packages/strapi-email-amazon-ses/package.json +++ b/packages/strapi-email-amazon-ses/package.json @@ -1,6 +1,6 @@ { "name": "strapi-email-amazon-ses", - "version": "3.0.0-alpha.13", + "version": "3.0.0-alpha.13.0.1", "description": "Amazon SES provider for strapi email", "homepage": "http://strapi.io", "keywords": [ @@ -42,4 +42,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-email-mailgun/package.json b/packages/strapi-email-mailgun/package.json index 965da84429..c59e63d4ab 100644 --- a/packages/strapi-email-mailgun/package.json +++ b/packages/strapi-email-mailgun/package.json @@ -42,4 +42,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-email-sendgrid/package.json b/packages/strapi-email-sendgrid/package.json index b48fca45ca..c9f50abcee 100644 --- a/packages/strapi-email-sendgrid/package.json +++ b/packages/strapi-email-sendgrid/package.json @@ -42,4 +42,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-email-sendmail/package.json b/packages/strapi-email-sendmail/package.json index 10ae86a7bf..fa046d68f2 100644 --- a/packages/strapi-email-sendmail/package.json +++ b/packages/strapi-email-sendmail/package.json @@ -41,4 +41,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-generate-admin/package.json b/packages/strapi-generate-admin/package.json index 310ebd1133..eb031e75d9 100755 --- a/packages/strapi-generate-admin/package.json +++ b/packages/strapi-generate-admin/package.json @@ -42,4 +42,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index 6b7b2256d8..ecdd5c347e 100755 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index 3ecea9c62b..3a0519748f 100755 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -115,4 +115,4 @@ "webpack-hot-middleware": "^2.18.2", "whatwg-fetch": "^2.0.3" } -} +} \ No newline at end of file diff --git a/packages/strapi-hook-knex/package.json b/packages/strapi-hook-knex/package.json index fabc2d9d20..c327e2f0bd 100755 --- a/packages/strapi-hook-knex/package.json +++ b/packages/strapi-hook-knex/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-hook-mongoose/package.json b/packages/strapi-hook-mongoose/package.json index d823b8028d..e6855a3f8d 100755 --- a/packages/strapi-hook-mongoose/package.json +++ b/packages/strapi-hook-mongoose/package.json @@ -45,4 +45,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-hook-redis/package.json b/packages/strapi-hook-redis/package.json index dece5c74e3..dc332efa68 100755 --- a/packages/strapi-hook-redis/package.json +++ b/packages/strapi-hook-redis/package.json @@ -44,4 +44,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-lint/package.json b/packages/strapi-lint/package.json index 1500b98b5e..2eb9b99121 100644 --- a/packages/strapi-lint/package.json +++ b/packages/strapi-lint/package.json @@ -41,4 +41,4 @@ "babel-eslint": "^8.2.3", "prettier": "^1.12.1" } -} +} \ No newline at end of file diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index f1fdf961bf..7021e73eab 100755 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 361dd4a40d..482d315d9f 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -49,4 +49,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-users-permissions/admin/src/translations/en.json b/packages/strapi-plugin-users-permissions/admin/src/translations/en.json index f9878a46be..f823bb9b25 100755 --- a/packages/strapi-plugin-users-permissions/admin/src/translations/en.json +++ b/packages/strapi-plugin-users-permissions/admin/src/translations/en.json @@ -45,6 +45,7 @@ "Auth.form.error.params.provide": "Incorrect params provided.", "Auth.form.error.username.taken": "Username is already taken", "Auth.form.error.email.taken": "Email is already taken", + "Auth.form.error.ratelimit": "Too many attempts, please try again in a minute.", "Auth.link.forgot-password": "Forgot your password?", "Auth.link.ready": "Ready to sign in?", diff --git a/packages/strapi-plugin-users-permissions/config/policies/rateLimit.js b/packages/strapi-plugin-users-permissions/config/policies/rateLimit.js new file mode 100644 index 0000000000..2f44729f32 --- /dev/null +++ b/packages/strapi-plugin-users-permissions/config/policies/rateLimit.js @@ -0,0 +1,12 @@ +const RateLimit = require('koa2-ratelimit').RateLimit; + +module.exports = async (ctx, next) => { + const message = ctx.request.admin ? [{ messages: [{ id: 'Auth.form.error.ratelimit' }] }] : 'Too many attempts, please try again in a minute.'; + + return RateLimit.middleware({ + interval: 1*60*1000, + max: 5, + prefixKey: `${ctx.request.url}:${ctx.request.ip}`, + message + })(ctx, next); +}; diff --git a/packages/strapi-plugin-users-permissions/config/routes.json b/packages/strapi-plugin-users-permissions/config/routes.json index 5d43993b0d..3e9981be23 100644 --- a/packages/strapi-plugin-users-permissions/config/routes.json +++ b/packages/strapi-plugin-users-permissions/config/routes.json @@ -153,7 +153,7 @@ "path": "/connect/*", "handler": "Auth.connect", "config": { - "policies": [], + "policies": ["plugins.users-permissions.ratelimit"], "prefix": "" } }, @@ -162,7 +162,7 @@ "path": "/auth/local", "handler": "Auth.callback", "config": { - "policies": [], + "policies": ["plugins.users-permissions.ratelimit"], "prefix": "" } }, @@ -171,7 +171,7 @@ "path": "/auth/local/register", "handler": "Auth.register", "config": { - "policies": [], + "policies": ["plugins.users-permissions.ratelimit"], "prefix": "" } }, @@ -189,7 +189,7 @@ "path": "/auth/forgot-password", "handler": "Auth.forgotPassword", "config": { - "policies": [], + "policies": ["plugins.users-permissions.ratelimit"], "prefix": "" } }, @@ -198,7 +198,7 @@ "path": "/auth/reset-password", "handler": "Auth.changePassword", "config": { - "policies": [], + "policies": ["plugins.users-permissions.ratelimit"], "prefix": "" } }, diff --git a/packages/strapi-plugin-users-permissions/package.json b/packages/strapi-plugin-users-permissions/package.json index 49a6cc2b7e..d9545b6d8c 100644 --- a/packages/strapi-plugin-users-permissions/package.json +++ b/packages/strapi-plugin-users-permissions/package.json @@ -26,6 +26,7 @@ "grant-koa": "^3.8.1", "jsonwebtoken": "^8.1.0", "koa": "^2.1.0", + "koa2-ratelimit": "^0.6.1", "purest": "^2.0.1", "request": "^2.83.0", "uuid": "^3.1.0" diff --git a/packages/strapi-plugin-users-permissions/services/Providers.js b/packages/strapi-plugin-users-permissions/services/Providers.js index 57e3f3031c..da8f651186 100644 --- a/packages/strapi-plugin-users-permissions/services/Providers.js +++ b/packages/strapi-plugin-users-permissions/services/Providers.js @@ -134,7 +134,7 @@ const getProfile = async (provider, query, callback) => { callback(err); } else { // Combine username and discriminator because discord username is not unique - var username = body.username + '#' + body.discriminator; + var username = `${body.username}#${body.discriminator}`; callback(null, { username: username, email: body.email diff --git a/packages/strapi-upload-aws-s3/package.json b/packages/strapi-upload-aws-s3/package.json index 2296da7660..2888b061bf 100644 --- a/packages/strapi-upload-aws-s3/package.json +++ b/packages/strapi-upload-aws-s3/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-upload-cloudinary/package.json b/packages/strapi-upload-cloudinary/package.json index 7cf5eff3f2..5c92874574 100644 --- a/packages/strapi-upload-cloudinary/package.json +++ b/packages/strapi-upload-cloudinary/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-upload-local/package.json b/packages/strapi-upload-local/package.json index 153f0a7c03..979b53e868 100644 --- a/packages/strapi-upload-local/package.json +++ b/packages/strapi-upload-local/package.json @@ -39,4 +39,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-upload-rackspace/package.json b/packages/strapi-upload-rackspace/package.json index 173b67a7ea..a0e60d2516 100644 --- a/packages/strapi-upload-rackspace/package.json +++ b/packages/strapi-upload-rackspace/package.json @@ -13,4 +13,4 @@ "pkgcloud": "^1.5.0", "streamifier": "^0.1.1" } -} +} \ No newline at end of file diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index 50b33deb51..0c4a7ef156 100755 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -49,4 +49,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi/package.json b/packages/strapi/package.json index df76357a9b..2d7645d505 100755 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -91,4 +91,4 @@ }, "preferGlobal": true, "license": "MIT" -} +} \ No newline at end of file From 6c0abfc314b0b6cda7725acdfa3c2446543c44af Mon Sep 17 00:00:00 2001 From: KuongKnight Date: Thu, 2 Aug 2018 00:05:29 +0700 Subject: [PATCH 07/44] change length to 36 for type uuid mysql --- packages/strapi-hook-bookshelf/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-hook-bookshelf/lib/index.js b/packages/strapi-hook-bookshelf/lib/index.js index 0fca80a529..e7776e38fd 100755 --- a/packages/strapi-hook-bookshelf/lib/index.js +++ b/packages/strapi-hook-bookshelf/lib/index.js @@ -398,7 +398,7 @@ module.exports = function(strapi) { } else { switch (attribute.type) { case 'uuid': - type = definition.client === 'pg' ? 'uuid' : 'varchar(255)'; + type = definition.client === 'pg' ? 'uuid' : 'varchar(36)'; break; case 'text': type = definition.client === 'pg' ? type = 'text' : 'longtext'; From f508da6fce881fa143fa5a3e1fcb33028b09a795 Mon Sep 17 00:00:00 2001 From: KuongKnight Date: Thu, 2 Aug 2018 23:13:38 +0700 Subject: [PATCH 08/44] Fixed custom primaryType option --- packages/strapi-hook-bookshelf/lib/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/strapi-hook-bookshelf/lib/index.js b/packages/strapi-hook-bookshelf/lib/index.js index e7776e38fd..ff0d8fc8d0 100755 --- a/packages/strapi-hook-bookshelf/lib/index.js +++ b/packages/strapi-hook-bookshelf/lib/index.js @@ -524,7 +524,7 @@ module.exports = function(strapi) { if (definition.primaryKeyType === 'uuid' && definition.client === 'pg') { idAttributeBuilder = ['id uuid NOT NULL DEFAULT uuid_generate_v4() NOT NULL PRIMARY KEY']; } else if (definition.primaryKeyType !== 'integer') { - idAttributeBuilder = [`id ${definition.primaryKeyType} NOT NULL PRIMARY KEY`]; + idAttributeBuilder = [`id ${getType({type: definition.primaryKeyType})} NOT NULL PRIMARY KEY`]; } const columns = generateColumns(attributes, idAttributeBuilder).join(',\n\r'); @@ -598,8 +598,6 @@ module.exports = function(strapi) { const changeRequired = definition.client === 'pg' ? `ALTER COLUMN ${quote}${attribute}${quote} ${attributes[attribute].required ? 'SET' : 'DROP'} NOT NULL` : `CHANGE ${quote}${attribute}${quote} ${quote}${attribute}${quote} ${type} ${attributes[attribute].required ? 'NOT' : ''} NULL`; - //console.log(`ALTER TABLE ${quote}${table}${quote} ${changeType}`); - //console.log(`ALTER TABLE ${quote}${table}${quote} ${changeRequired}`); await ORM.knex.raw(`ALTER TABLE ${quote}${table}${quote} ${changeType}`); await ORM.knex.raw(`ALTER TABLE ${quote}${table}${quote} ${changeRequired}`); } From 06262e96571f4d8ba46538eae9f28c7d01ad41a5 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Fri, 3 Aug 2018 12:06:54 +0200 Subject: [PATCH 09/44] Fix load hook --- packages/strapi/lib/core/configurations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi/lib/core/configurations.js b/packages/strapi/lib/core/configurations.js index c011683707..14e1bc6c74 100755 --- a/packages/strapi/lib/core/configurations.js +++ b/packages/strapi/lib/core/configurations.js @@ -304,7 +304,7 @@ module.exports.app = async function() { this.config.hook.settings = Object.keys(this.hook).reduce((acc, current) => { // Try to find the settings in the current environment, then in the main configurations. - const currentSettings = merge(get(cloneDeep(this.hook[current]), ['defaults', current], {}), flattenHooksConfig[current] || this.config.currentEnvironment[current] || this.config[current]); + const currentSettings = merge(get(cloneDeep(this.hook[current]), ['defaults', current], {}), flattenHooksConfig[current] || get(this.config.currentEnvironment, ['hook', current]) || get(this.config, ['hook', current])); acc[current] = !isObject(currentSettings) ? {} : currentSettings; if (!acc[current].hasOwnProperty('enabled')) { From 9101ba2efdb85e313422b6f7bd8bac3e4b7dd9c4 Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 6 Aug 2018 15:00:49 +0200 Subject: [PATCH 10/44] Fixes #1660 --- packages/strapi-admin/admin/src/components/Header/styles.scss | 2 +- .../lib/src/components/BackHeader/styles.scss | 2 +- .../lib/src/components/ImgPreview/styles.scss | 4 ++-- .../lib/src/components/ImgPreviewRemoveIcon/styles.scss | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/strapi-admin/admin/src/components/Header/styles.scss b/packages/strapi-admin/admin/src/components/Header/styles.scss index 1756c3bafa..09b745d219 100755 --- a/packages/strapi-admin/admin/src/components/Header/styles.scss +++ b/packages/strapi-admin/admin/src/components/Header/styles.scss @@ -5,7 +5,7 @@ width: 100%; height: $header-height; position: fixed; - z-index: 100; + z-index: 1050; left: $left-menu-width; box-shadow: 0 1px 2px 0 rgba(40, 42, 49, 0.16); diff --git a/packages/strapi-helper-plugin/lib/src/components/BackHeader/styles.scss b/packages/strapi-helper-plugin/lib/src/components/BackHeader/styles.scss index c3d3e8de52..5f7d28c846 100644 --- a/packages/strapi-helper-plugin/lib/src/components/BackHeader/styles.scss +++ b/packages/strapi-helper-plugin/lib/src/components/BackHeader/styles.scss @@ -4,7 +4,7 @@ height: 6rem; width: 6.5rem; line-height: 6rem; - z-index: 999; + z-index: 1040; text-align: center; background-color: #FFFFFF; color: #81848A; diff --git a/packages/strapi-helper-plugin/lib/src/components/ImgPreview/styles.scss b/packages/strapi-helper-plugin/lib/src/components/ImgPreview/styles.scss index 4073f1c0c9..ff676fed82 100644 --- a/packages/strapi-helper-plugin/lib/src/components/ImgPreview/styles.scss +++ b/packages/strapi-helper-plugin/lib/src/components/ImgPreview/styles.scss @@ -20,7 +20,7 @@ background-repeat: no-repeat !important; white-space: nowrap; - z-index: 1; + z-index: 1 !important; > img { position: absolute; top: 0; @@ -49,7 +49,7 @@ display: block; position: absolute; top: 37px; - z-index: 9999; + z-index: 999; padding: 12px 40px 0 40px; line-height: 18px; color: #fff !important; diff --git a/packages/strapi-helper-plugin/lib/src/components/ImgPreviewRemoveIcon/styles.scss b/packages/strapi-helper-plugin/lib/src/components/ImgPreviewRemoveIcon/styles.scss index 0a52aadf99..f035392e83 100644 --- a/packages/strapi-helper-plugin/lib/src/components/ImgPreviewRemoveIcon/styles.scss +++ b/packages/strapi-helper-plugin/lib/src/components/ImgPreviewRemoveIcon/styles.scss @@ -6,6 +6,6 @@ height: 20px; color: #fff; font-size: 11px; - z-index: 9999; + z-index: 999; cursor: pointer; } From 1fc9513d80ba1bd208a0816ce341042f5fdcd516 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 6 Aug 2018 16:03:09 +0200 Subject: [PATCH 11/44] Change lodash version --- packages/strapi-admin/package.json | 2 +- packages/strapi-generate-admin/package.json | 2 +- packages/strapi-generate-api/package.json | 2 +- .../strapi-generate-controller/package.json | 2 +- packages/strapi-generate-model/package.json | 2 +- packages/strapi-generate-new/package.json | 2 +- packages/strapi-generate-plugin/package.json | 2 +- packages/strapi-generate-policy/package.json | 2 +- packages/strapi-generate-service/package.json | 2 +- packages/strapi-generate/package.json | 2 +- packages/strapi-helper-plugin/package.json | 2 +- packages/strapi-hook-bookshelf/package.json | 2 +- packages/strapi-hook-knex/package.json | 2 +- packages/strapi-hook-mongoose/package.json | 2 +- packages/strapi-hook-redis/package.json | 2 +- packages/strapi-middleware-views/package.json | 2 +- .../config/layout.json | 34 ++++++++++++++++++- .../models/User.settings.json | 2 +- packages/strapi-utils/package.json | 2 +- packages/strapi/package.json | 2 +- 20 files changed, 52 insertions(+), 20 deletions(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index b5778e1491..a918c9edf7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-generate-admin/package.json b/packages/strapi-generate-admin/package.json index eb031e75d9..9c05fd7b29 100755 --- a/packages/strapi-generate-admin/package.json +++ b/packages/strapi-generate-admin/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "fs-extra": "^4.0.1", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "strapi-admin": "3.0.0-alpha.13.0.1", "strapi-utils": "3.0.0-alpha.13.0.1" }, diff --git a/packages/strapi-generate-api/package.json b/packages/strapi-generate-api/package.json index bfb0c13df0..a93549e19e 100755 --- a/packages/strapi-generate-api/package.json +++ b/packages/strapi-generate-api/package.json @@ -13,7 +13,7 @@ "lib": "./lib" }, "dependencies": { - "lodash": "^4.17.4", + "lodash": "^4.17.5", "pluralize": "^6.0.0" }, "scripts": { diff --git a/packages/strapi-generate-controller/package.json b/packages/strapi-generate-controller/package.json index 5cd499799d..cb6a9cba21 100755 --- a/packages/strapi-generate-controller/package.json +++ b/packages/strapi-generate-controller/package.json @@ -14,7 +14,7 @@ "lib": "./lib" }, "dependencies": { - "lodash": "^4.17.4" + "lodash": "^4.17.5" }, "scripts": { "prepublish": "npm prune" diff --git a/packages/strapi-generate-model/package.json b/packages/strapi-generate-model/package.json index fbad572226..b74b61a8f1 100755 --- a/packages/strapi-generate-model/package.json +++ b/packages/strapi-generate-model/package.json @@ -14,7 +14,7 @@ "lib": "./lib" }, "dependencies": { - "lodash": "^4.17.4" + "lodash": "^4.17.5" }, "scripts": { "prepublish": "npm prune" diff --git a/packages/strapi-generate-new/package.json b/packages/strapi-generate-new/package.json index e59055ecd3..981620a63d 100755 --- a/packages/strapi-generate-new/package.json +++ b/packages/strapi-generate-new/package.json @@ -17,7 +17,7 @@ "fs-extra": "^4.0.0", "inquirer": "^4.0.2", "listr": "^0.14.1", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "ora": "^2.1.0", "strapi-utils": "3.0.0-alpha.13.0.1", "uuid": "^3.1.0" diff --git a/packages/strapi-generate-plugin/package.json b/packages/strapi-generate-plugin/package.json index 79188e5162..219a0c3faf 100755 --- a/packages/strapi-generate-plugin/package.json +++ b/packages/strapi-generate-plugin/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "fs-extra": "^4.0.0", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "pluralize": "^6.0.0" }, "scripts": { diff --git a/packages/strapi-generate-policy/package.json b/packages/strapi-generate-policy/package.json index e37c9fc5aa..c93a99cf8e 100755 --- a/packages/strapi-generate-policy/package.json +++ b/packages/strapi-generate-policy/package.json @@ -14,7 +14,7 @@ "lib": "./lib" }, "dependencies": { - "lodash": "^4.17.4" + "lodash": "^4.17.5" }, "scripts": { "prepublishOnly": "npm prune" diff --git a/packages/strapi-generate-service/package.json b/packages/strapi-generate-service/package.json index ec20e0f2e4..78e9c38b20 100755 --- a/packages/strapi-generate-service/package.json +++ b/packages/strapi-generate-service/package.json @@ -14,7 +14,7 @@ "lib": "./lib" }, "dependencies": { - "lodash": "^4.17.4" + "lodash": "^4.17.5" }, "scripts": { "prepublishOnly": "npm prune" diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index ecdd5c347e..36313632f4 100755 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -15,7 +15,7 @@ "dependencies": { "async": "^2.5.0", "fs-extra": "^4.0.0", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "reportback": "^2.0.1", "strapi-utils": "3.0.0-alpha.13.0.1" }, diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index 3a0519748f..984c20c2fe 100755 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -73,7 +73,7 @@ "intl": "^1.2.5", "invariant": "2.2.1", "json-loader": "^0.5.7", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "lodash-webpack-plugin": "^0.11.4", "mocha": "3.1.2", "moment": "^2.16.0", diff --git a/packages/strapi-hook-bookshelf/package.json b/packages/strapi-hook-bookshelf/package.json index f7a76f0dbd..d45f896b48 100755 --- a/packages/strapi-hook-bookshelf/package.json +++ b/packages/strapi-hook-bookshelf/package.json @@ -18,7 +18,7 @@ "dependencies": { "bookshelf": "^0.12.1", "inquirer": "^5.2.0", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "pluralize": "^6.0.0", "strapi-hook-knex": "3.0.0-alpha.13.0.1", "strapi-utils": "3.0.0-alpha.13.0.1" diff --git a/packages/strapi-hook-knex/package.json b/packages/strapi-hook-knex/package.json index c327e2f0bd..70eed9b792 100755 --- a/packages/strapi-hook-knex/package.json +++ b/packages/strapi-hook-knex/package.json @@ -17,7 +17,7 @@ "main": "./lib", "dependencies": { "knex": "^0.13.0", - "lodash": "^4.17.4" + "lodash": "^4.17.5" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-hook-mongoose/package.json b/packages/strapi-hook-mongoose/package.json index e6855a3f8d..8594b30991 100755 --- a/packages/strapi-hook-mongoose/package.json +++ b/packages/strapi-hook-mongoose/package.json @@ -15,7 +15,7 @@ }, "main": "./lib", "dependencies": { - "lodash": "^4.17.4", + "lodash": "^4.17.5", "mongoose": "^5.0.16", "mongoose-float": "^1.0.2", "pluralize": "^6.0.0", diff --git a/packages/strapi-hook-redis/package.json b/packages/strapi-hook-redis/package.json index dc332efa68..14f13d2731 100755 --- a/packages/strapi-hook-redis/package.json +++ b/packages/strapi-hook-redis/package.json @@ -16,7 +16,7 @@ "main": "./lib", "dependencies": { "ioredis": "^3.1.2", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "stack-trace": "0.0.10", "strapi-utils": "3.0.0-alpha.13.0.1" }, diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index 7021e73eab..c82606e56f 100755 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -17,7 +17,7 @@ "dependencies": { "consolidate": "^0.14.5", "koa-views": "^6.1.1", - "lodash": "^4.17.4" + "lodash": "^4.17.5" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index 0967ef424b..df730cec83 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -1 +1,33 @@ -{} +{ + "article": { + "attributes": { + "title": { + "appearance": "" + }, + "content": { + "appearance": "WYSIWYG" + } + } + }, + "tag": { + "attributes": { + "name": { + "appearance": "" + } + } + }, + "category": { + "attributes": { + "name": { + "appearance": "" + } + } + }, + "reference": { + "attributes": { + "name": { + "appearance": "" + } + } + } +} \ No newline at end of file diff --git a/packages/strapi-plugin-users-permissions/models/User.settings.json b/packages/strapi-plugin-users-permissions/models/User.settings.json index 99479b1cba..da72db76e3 100644 --- a/packages/strapi-plugin-users-permissions/models/User.settings.json +++ b/packages/strapi-plugin-users-permissions/models/User.settings.json @@ -40,4 +40,4 @@ "configurable": false } } -} +} \ No newline at end of file diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index 0c4a7ef156..e3a47e4fc0 100755 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -21,7 +21,7 @@ "commander": "^2.11.0", "joi-json": "^2.0.1", "knex": "^0.13.0", - "lodash": "^4.17.4", + "lodash": "^4.17.5", "pino": "^4.7.1", "shelljs": "^0.7.7" }, diff --git a/packages/strapi/package.json b/packages/strapi/package.json index 2d7645d505..77f9bb11e9 100755 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -49,7 +49,7 @@ "koa-router-joi": "^1.0.1", "koa-session": "^5.5.1", "koa-static": "^4.0.1", - "lodash": "^4.16.5", + "lodash": "^4.17.5", "node-fetch": "^1.7.3", "node-schedule": "^1.2.0", "rimraf": "^2.6.2", From eceafe707463a94fe67d19fa7151af6951ab8775 Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 6 Aug 2018 16:18:37 +0200 Subject: [PATCH 12/44] Fixes #1395 --- .../admin/src/containers/Form/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js index c0513dfa95..390b17bf66 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js @@ -514,12 +514,9 @@ export class Form extends React.Component { // eslint-disable-line react/prefer- } renderModalBodyChooseAttributes = () => { - const attributesDisplay = forms.attributesDisplay.items; - - // Don't display the media field if the upload plugin isn't installed - if (!has(this.context.plugins.toJS(), 'upload')) { - attributesDisplay.splice(8, 1); - } + const attributesDisplay = has(this.context.plugins.toJS(), 'upload') + ? forms.attributesDisplay.items + : forms.attributesDisplay.items.filter(obj => obj.type !== 'media'); // Don't display the media field if the upload plugin isn't installed return ( map(attributesDisplay, (attribute, key) => ( From 70e9523ba8d1e4c55b65663768692f0b3912508c Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 6 Aug 2018 16:59:14 +0200 Subject: [PATCH 13/44] Fix policy error --- packages/strapi-admin/package.json | 2 +- .../config/policies/permissions.js | 2 +- packages/strapi-plugin-users-permissions/services/Providers.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index b5778e1491..a918c9edf7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-users-permissions/config/policies/permissions.js b/packages/strapi-plugin-users-permissions/config/policies/permissions.js index 3407b5ee41..11aa925a61 100644 --- a/packages/strapi-plugin-users-permissions/config/policies/permissions.js +++ b/packages/strapi-plugin-users-permissions/config/policies/permissions.js @@ -43,7 +43,7 @@ module.exports = async (ctx, next) => { return ctx.request.graphql = strapi.errors.forbidden(); } - ctx.forbidden(); + return ctx.forbidden(); } // Execute the policies. diff --git a/packages/strapi-plugin-users-permissions/services/Providers.js b/packages/strapi-plugin-users-permissions/services/Providers.js index 57e3f3031c..da8f651186 100644 --- a/packages/strapi-plugin-users-permissions/services/Providers.js +++ b/packages/strapi-plugin-users-permissions/services/Providers.js @@ -134,7 +134,7 @@ const getProfile = async (provider, query, callback) => { callback(err); } else { // Combine username and discriminator because discord username is not unique - var username = body.username + '#' + body.discriminator; + var username = `${body.username}#${body.discriminator}`; callback(null, { username: username, email: body.email From 92cbe5a56f2e880d356ff85b23ca38458a50ba53 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 6 Aug 2018 17:11:10 +0200 Subject: [PATCH 14/44] Fix layout --- .../config/layout.json | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index df730cec83..0967ef424b 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -1,33 +1 @@ -{ - "article": { - "attributes": { - "title": { - "appearance": "" - }, - "content": { - "appearance": "WYSIWYG" - } - } - }, - "tag": { - "attributes": { - "name": { - "appearance": "" - } - } - }, - "category": { - "attributes": { - "name": { - "appearance": "" - } - } - }, - "reference": { - "attributes": { - "name": { - "appearance": "" - } - } - } -} \ No newline at end of file +{} From 3f2576cb6853d0196d5e402a1677e78b4ac04d55 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 6 Aug 2018 17:46:58 +0200 Subject: [PATCH 15/44] Can block a user --- packages/strapi-admin/package.json | 2 +- .../admin/src/translations/en.json | 5 +++-- .../config/policies/permissions.js | 4 ++++ packages/strapi-plugin-users-permissions/controllers/Auth.js | 4 ++++ .../models/User.settings.json | 5 +++++ .../strapi-plugin-users-permissions/services/Providers.js | 2 +- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index b5778e1491..a918c9edf7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-users-permissions/admin/src/translations/en.json b/packages/strapi-plugin-users-permissions/admin/src/translations/en.json index f9878a46be..3ba2151c7e 100755 --- a/packages/strapi-plugin-users-permissions/admin/src/translations/en.json +++ b/packages/strapi-plugin-users-permissions/admin/src/translations/en.json @@ -43,8 +43,9 @@ "Auth.form.error.code.provide": "Incorrect code provided.", "Auth.form.error.password.matching": "Passwords do not match.", "Auth.form.error.params.provide": "Incorrect params provided.", - "Auth.form.error.username.taken": "Username is already taken", - "Auth.form.error.email.taken": "Email is already taken", + "Auth.form.error.username.taken": "Username is already taken.", + "Auth.form.error.email.taken": "Email is already taken.", + "Auth.form.error.blocked": "Your account has been blocked by the administrator.", "Auth.link.forgot-password": "Forgot your password?", "Auth.link.ready": "Ready to sign in?", diff --git a/packages/strapi-plugin-users-permissions/config/policies/permissions.js b/packages/strapi-plugin-users-permissions/config/policies/permissions.js index 3407b5ee41..e817b9c00c 100644 --- a/packages/strapi-plugin-users-permissions/config/policies/permissions.js +++ b/packages/strapi-plugin-users-permissions/config/policies/permissions.js @@ -23,6 +23,10 @@ module.exports = async (ctx, next) => { if (role.type === 'root') { return await next(); } + + if (ctx.state.user.blocked === true) { + return ctx.unauthorized(`Your account has been blocked by the administrator.`); + } } // Retrieve `public` role. if (!role) { diff --git a/packages/strapi-plugin-users-permissions/controllers/Auth.js b/packages/strapi-plugin-users-permissions/controllers/Auth.js index a97a9df50d..1744e6d78e 100644 --- a/packages/strapi-plugin-users-permissions/controllers/Auth.js +++ b/packages/strapi-plugin-users-permissions/controllers/Auth.js @@ -52,6 +52,10 @@ module.exports = { // Check if the user exists. const user = await strapi.query('user', 'users-permissions').findOne(query, ['role']); + if (user.blocked === true) { + return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Auth.form.error.blocked' }] }] : 'Your account has been blocked by the administrator.'); + } + if (!user) { return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Auth.form.error.invalid' }] }] : 'Identifier or password invalid.'); } diff --git a/packages/strapi-plugin-users-permissions/models/User.settings.json b/packages/strapi-plugin-users-permissions/models/User.settings.json index 99479b1cba..1ed6d43186 100644 --- a/packages/strapi-plugin-users-permissions/models/User.settings.json +++ b/packages/strapi-plugin-users-permissions/models/User.settings.json @@ -33,6 +33,11 @@ "configurable": false, "private": true }, + "blocked": { + "type": "boolean", + "default": false, + "configurable": false + }, "role": { "model": "role", "via": "users", diff --git a/packages/strapi-plugin-users-permissions/services/Providers.js b/packages/strapi-plugin-users-permissions/services/Providers.js index 57e3f3031c..da8f651186 100644 --- a/packages/strapi-plugin-users-permissions/services/Providers.js +++ b/packages/strapi-plugin-users-permissions/services/Providers.js @@ -134,7 +134,7 @@ const getProfile = async (provider, query, callback) => { callback(err); } else { // Combine username and discriminator because discord username is not unique - var username = body.username + '#' + body.discriminator; + var username = `${body.username}#${body.discriminator}`; callback(null, { username: username, email: body.email From 186eb4de473549fd22e206c2bb1295145c09c9ec Mon Sep 17 00:00:00 2001 From: Alberto Maturano Date: Mon, 30 Jul 2018 17:40:03 -0500 Subject: [PATCH 16/44] Parse environment variables on build configuration Move existing code to a shared library and invoke it on the build process to parse environment variables on configuration files. Looking for a consistent behavior. close #1590 --- .../internals/webpack/webpack.base.babel.js | 7 +++-- packages/strapi-utils/lib/index.js | 3 +- .../strapi-utils/lib/templateConfiguration.js | 26 +++++++++++++++++ packages/strapi/lib/core/configurations.js | 28 +++---------------- 4 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 packages/strapi-utils/lib/templateConfiguration.js diff --git a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js index 708d4bb4e5..3e446c207e 100755 --- a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js +++ b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js @@ -51,7 +51,10 @@ if (isAdmin && !isSetup) { ); try { - const server = require(serverConfig); + const { templateConfiguration } = require(path.join(adminPath, 'node_modules', 'strapi-utils')); + + let server = require(serverConfig); + server = templateConfiguration(server); if (process.env.PWD.indexOf('/admin') !== -1) { if (_.get(server, 'admin.build.host')) { @@ -61,7 +64,7 @@ if (isAdmin && !isSetup) { } URLs.publicPath = URLs.host; - URLs.backend = _.get(server, 'admin.build.backend', `/`); + URLs.backend = _.get(server, 'admin.build.backend', '/'); if (_.get(server, 'admin.build.plugins.source') === 'backend') { URLs.mode = 'backend'; diff --git a/packages/strapi-utils/lib/index.js b/packages/strapi-utils/lib/index.js index ae57227e18..7c9ce99755 100755 --- a/packages/strapi-utils/lib/index.js +++ b/packages/strapi-utils/lib/index.js @@ -15,5 +15,6 @@ module.exports = { models: require('./models'), packageManager: require('./packageManager'), policy: require('./policy'), - regex: require('./regex') + regex: require('./regex'), + templateConfiguration: require('./templateConfiguration') }; diff --git a/packages/strapi-utils/lib/templateConfiguration.js b/packages/strapi-utils/lib/templateConfiguration.js new file mode 100644 index 0000000000..810a7352a8 --- /dev/null +++ b/packages/strapi-utils/lib/templateConfiguration.js @@ -0,0 +1,26 @@ +const { isString, isPlainObject } = require('lodash'); + +const regex = /\$\{[^()]*\}/g; + +/** + * Allow dynamic config values through the native ES6 template string function. + */ +const templateConfiguration = (obj) => { + // Allow values which looks like such as an ES6 literal string without parenthesis inside (aka function call). + return Object.keys(obj).reduce((acc, key) => { + if (isPlainObject(obj[key]) && !isString(obj[key])) { + acc[key] = templateConfiguration(obj[key]); + + } else if (isString(obj[key]) && obj[key].match(regex) !== null) { + // eslint-disable-next-line prefer-template + acc[key] = eval('`' + obj[key] + '`'); + + } else { + acc[key] = obj[key]; + } + + return acc; + }, {}); +}; + +module.exports = templateConfiguration; diff --git a/packages/strapi/lib/core/configurations.js b/packages/strapi/lib/core/configurations.js index c011683707..82f966d0ce 100755 --- a/packages/strapi/lib/core/configurations.js +++ b/packages/strapi/lib/core/configurations.js @@ -3,7 +3,8 @@ // Dependencies. const path = require('path'); const glob = require('glob'); -const { merge, setWith, get, upperFirst, isString, isEmpty, isObject, pullAll, defaults, isPlainObject, assign, clone, cloneDeep, camelCase } = require('lodash'); +const { merge, setWith, get, upperFirst, isEmpty, isObject, pullAll, defaults, assign, clone, cloneDeep, camelCase } = require('lodash'); +const { templateConfiguration } = require('strapi-utils'); const utils = require('../utils'); module.exports.nested = function() { @@ -84,14 +85,14 @@ module.exports.app = async function() { this.config.currentEnvironment = this.config.environments[this.config.environment] || {}; // Set current connections. - this.config.connections = get(this.config.currentEnvironment, `database.connections`, {}); + this.config.connections = get(this.config.currentEnvironment, 'database.connections', {}); if (get(this.config, 'language.enabled')) { this.config.language.locales = Object.keys(get(strapi.config, 'locales', {})); } // Template literal string. - this.config = templateConfigurations(this.config); + this.config = templateConfiguration(this.config); // Initialize main router to use it in middlewares. this.router = this.koaMiddlewares.routerJoi(); @@ -359,24 +360,3 @@ const enableHookNestedDependencies = function (name, flattenHooksConfig, force = } } }; - -/** - * Allow dynamic config values through - * the native ES6 template string function. - */ -const regex = /\$\{[^()]*\}/g; -const templateConfigurations = function (obj) { - // Allow values which looks like such as - // an ES6 literal string without parenthesis inside (aka function call). - return Object.keys(obj).reduce((acc, key) => { - if (isPlainObject(obj[key]) && !isString(obj[key])) { - acc[key] = templateConfigurations(obj[key]); - } else if (isString(obj[key]) && obj[key].match(regex) !== null) { - acc[key] = eval('`' + obj[key] + '`'); // eslint-disable-line prefer-template - } else { - acc[key] = obj[key]; - } - - return acc; - }, {}); -}; From 3645cc15f453bd328e975ec588f1469bdf17ec57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Sko=C5=99epa?= Date: Tue, 7 Aug 2018 14:42:33 +0200 Subject: [PATCH 17/44] Fix one to many relation querying in the other direction --- packages/strapi-plugin-graphql/services/GraphQL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-plugin-graphql/services/GraphQL.js b/packages/strapi-plugin-graphql/services/GraphQL.js index eb911fae2b..81f03cf3d5 100644 --- a/packages/strapi-plugin-graphql/services/GraphQL.js +++ b/packages/strapi-plugin-graphql/services/GraphQL.js @@ -630,7 +630,7 @@ module.exports = { }; if (association.type === 'model') { - params.id = obj[association.alias]; + params.id = obj[association.alias].id; } else { // Get refering model. const ref = association.plugin ? From b7edcffff876fa5617c2cdc43ef36c025c333ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Sko=C5=99epa?= Date: Wed, 8 Aug 2018 00:05:33 +0200 Subject: [PATCH 18/44] Fix the fix It turns out that in some situations it actually is only the id instead of object (nested queries). --- packages/strapi-plugin-graphql/services/GraphQL.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/strapi-plugin-graphql/services/GraphQL.js b/packages/strapi-plugin-graphql/services/GraphQL.js index 81f03cf3d5..12444bf3d4 100644 --- a/packages/strapi-plugin-graphql/services/GraphQL.js +++ b/packages/strapi-plugin-graphql/services/GraphQL.js @@ -630,7 +630,8 @@ module.exports = { }; if (association.type === 'model') { - params.id = obj[association.alias].id; + const rel = obj[association.alias]; + params.id = typeof rel === 'object' && 'id' in rel ? rel.id : rel; } else { // Get refering model. const ref = association.plugin ? From 0e61914ce296d2d208ed07e05464f1c683afa5b8 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 8 Aug 2018 11:44:27 +0200 Subject: [PATCH 19/44] Add upper first strapi new logs action --- packages/strapi-admin/package.json | 2 +- packages/strapi-generate-new/lib/after.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index b5778e1491..a918c9edf7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-generate-new/lib/after.js b/packages/strapi-generate-new/lib/after.js index f704dc6d5e..17a8e38092 100755 --- a/packages/strapi-generate-new/lib/after.js +++ b/packages/strapi-generate-new/lib/after.js @@ -187,10 +187,10 @@ module.exports = (scope, cb) => { console.log(); console.log(`👌 Your new application ${green(scope.name)} is ready at ${cyan(scope.rootPath)}.`); console.log(); - console.log('⚡️ change directory:'); + console.log('⚡️ Change directory:'); console.log(`$ ${green(`cd ${scope.name}`)}`); console.log(); - console.log('⚡️ start application:'); + console.log('⚡️ Start application:'); console.log(`$ ${green('strapi start')}`); cb(); From 0a3b81fef64b5e4e20e9997c04f0015f5d95edc7 Mon Sep 17 00:00:00 2001 From: Pierre Burgy Date: Wed, 8 Aug 2018 11:50:31 +0200 Subject: [PATCH 20/44] Change default database name --- packages/strapi-generate-new/lib/before.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-generate-new/lib/before.js b/packages/strapi-generate-new/lib/before.js index 4182643982..411063f82e 100755 --- a/packages/strapi-generate-new/lib/before.js +++ b/packages/strapi-generate-new/lib/before.js @@ -132,7 +132,7 @@ module.exports = (scope, cb) => { type: 'input', name: 'database', message: 'Database name:', - default: _.get(scope.database, 'database', 'strapi') + default: _.get(scope.database, 'database', scope.name) }, { when: !hasDatabaseConfig, From ee24171e372fbb3a8e006dcba5c7eb26e28b5cc5 Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 8 Aug 2018 12:21:24 +0200 Subject: [PATCH 21/44] Update README --- README.md | 70 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 8d8a1610c0..e03a1ccba2 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

API creation made simple, secure and fast.

-

The most advanced open-source Content Management Framework to build powerful API with no effort.

+

The most advanced open-source Headless-CMS to build powerful API with no effort.


@@ -32,35 +32,51 @@

- +


-## Quick start +## Getting Started -We've been working on a major update to Strapi for several months now, rewriting the core framework and the administration panel. Performances has been increased, Developer eXperience has been improved and a brand new plugins -ecosystem has been introduced. **Both versions are available, we still recommend you to use v1 for production usage.**. +[Read the Getting Started tutorial](https://strapi.io/getting-started) or follow the steps below: + +#### Installation + +```bash +npm install strapi@alpha -g +```` + +**We recommend to use the latest version of Strapi** to start your new project. Some breaking changes might happen, new releases are shipped every two weeks. + +#### Create a new project + +```bash +strapi new my-project +``` + +It will generate a brand new project with the default features (authentication, permissions, content management, content type builder & file upload). + +Then, you're ready to start your project: + +```bash +cd my-project +strapi start +``` + +**Congratulations, you made it! Enjoy 🎉** + +--- + +You can also give it a try using Heroku. However one of the main feature (content type builder) won't work due to the writing files restriction of Heroku. Deploy -#### Alpha +--- -The alpha has support for the latest version of Node.js (v9) and npm (v5). -```bash -npm install strapi@alpha -g -``` - -#### Stable -This is the production-ready version of Strapi (v1). You should also consider that the migration to v3 will not be easy due to many breaking changes. -```bash -npm install strapi -g -``` - -Read the [Getting started](https://strapi.io/getting-started) page to create your first project using Strapi. ## Features @@ -73,19 +89,17 @@ Read the [Getting started](https://strapi.io/getting-started) page to create you - **Powerful CLI:** Scaffold projects and APIs on the fly. - **SQL & NoSQL databases:** Work with Mongo as a main database, also supports Postgres, MySQL, etc. -## Philosophy ? +**[See more on our website](https://strapi.io/overview)** -> At [Strapi](https://strapi.io), everything we do we believe in changing the status quo of web development. Our products are simple to use, user friendly and production-ready. +## Contributing -Web and mobile applications needed a powerful, simple to use and production-ready API-driven solution. That's why we created Strapi, an open-source Content Management Framework (CMF) for exposing your content (data, media) accross multi-devices. - -Halfway between a CMS and a framework, Strapi takes advantages of both worlds. A powerful dashboard to easily manage your content with a flexible framework layer to develop and integrate specific features. +Please read our [Contributing Guide](./CONTRIBUTING.md) before submitting a Pull Request to the project. ## Support For more information on the upcoming version, please take a look to our [ROADMAP](https://github.com/strapi/strapi/projects). -### Community support +#### Community support For general help using Strapi, please refer to [the official Strapi documentation](https://strapi.io/documentation/). For additional help, you can use one of this channel to ask question: @@ -95,13 +109,15 @@ For general help using Strapi, please refer to [the official Strapi documentatio - [Twitter](https://twitter.com/strapijs) - [Facebook](https://www.facebook.com/Strapi-616063331867161). -### Professional support +#### Professional support -[Strapi Solutions](https://strapi.io), the company behind Strapi, provides a full range of solutions to get better results, faster. We're always looking for the next challenge: coaching, consulting, training, customization, etc. [Drop us an email](mailto:support@strapi.io) to see how we can help you. +[Strapi Solutions](https://strapi.io), the company behind Strapi, provides a full range of solutions to get better results, faster. We're always looking for the next challenge: coaching, consulting, training, customization, etc. + +[Drop us an email](mailto:support@strapi.io) to see how we can help you. ### Migration -Follow our [migration guides](https://github.com/strapi/strapi/wiki) on the wiki to keep your Strapi projects updated. +Follow our [migration guides](https://github.com/strapi/strapi/wiki) on the wiki to keep your projects up-to-date. ## License From 0725cad584870592b24541baa2f8feaea817c16a Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 8 Aug 2018 12:30:59 +0200 Subject: [PATCH 22/44] Update screenshot --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e03a1ccba2..6f4f7a6c5b 100755 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@

- +

From 1acf5c465017f344953246bd88073627e29b7be5 Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 8 Aug 2018 12:36:02 +0200 Subject: [PATCH 23/44] Update screenshot --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f4f7a6c5b..85becf85cb 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

API creation made simple, secure and fast.

-

The most advanced open-source Headless-CMS to build powerful API with no effort.

+

The most advanced open-source Content Management Framework (headless-CMS) to build powerful API with no effort.


@@ -32,7 +32,7 @@

- +

From 73f7dadd7dfba830dc4571661e2dbecc58b1ca8e Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 8 Aug 2018 12:43:27 +0200 Subject: [PATCH 24/44] Update screenshot --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 85becf85cb..fc6b332943 100755 --- a/README.md +++ b/README.md @@ -40,17 +40,18 @@ ## Getting Started -[Read the Getting Started tutorial](https://strapi.io/getting-started) or follow the steps below: +Read the Getting Started tutorial or follow the steps below: -#### Installation +#### ⏳ Installation ```bash npm install strapi@alpha -g ```` -**We recommend to use the latest version of Strapi** to start your new project. Some breaking changes might happen, new releases are shipped every two weeks. +**We recommend to use the latest version of Strapi to start your new project**. +Some breaking changes might happen, new releases are shipped every two weeks to fix/enhance the product. -#### Create a new project +#### 🏗 Create a new project ```bash strapi new my-project @@ -58,18 +59,18 @@ strapi new my-project It will generate a brand new project with the default features (authentication, permissions, content management, content type builder & file upload). -Then, you're ready to start your project: +#### 🚀 Start your project ```bash cd my-project strapi start ``` -**Congratulations, you made it! Enjoy 🎉** +Congratulations, you made it! Enjoy 🎉 ---- +
-You can also give it a try using Heroku. However one of the main feature (content type builder) won't work due to the writing files restriction of Heroku. +You can also give it a try using Heroku! Be aware that one of the content type builder won't work due to the writing files restriction on the Heroku servers. Deploy From b39b9c2fc8342be64321245f67d71b2751fa670d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20GEORGET?= Date: Wed, 8 Aug 2018 12:47:28 +0200 Subject: [PATCH 25/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fc6b332943..41483e350b 100755 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ You can also give it a try using Heroku! Be aware that one of the content type b Deploy ---- +
## Features From c2b97edeb20aaf3f81f8d7ac8287b8aea2c52659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20GEORGET?= Date: Wed, 8 Aug 2018 12:48:17 +0200 Subject: [PATCH 26/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41483e350b..6d152b0053 100755 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ For general help using Strapi, please refer to [the official Strapi documentatio [Drop us an email](mailto:support@strapi.io) to see how we can help you. -### Migration +## Migration Follow our [migration guides](https://github.com/strapi/strapi/wiki) on the wiki to keep your projects up-to-date. From 0afe2eceac1e4b47426148eec0274a451a02fcdb Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Wed, 8 Aug 2018 14:29:10 +0200 Subject: [PATCH 27/44] Add rate limit configs --- .../config/policies/rateLimit.js | 4 ++-- .../strapi-plugin-users-permissions/config/request.json | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 packages/strapi-plugin-users-permissions/config/request.json diff --git a/packages/strapi-plugin-users-permissions/config/policies/rateLimit.js b/packages/strapi-plugin-users-permissions/config/policies/rateLimit.js index 2f44729f32..e5267d2c69 100644 --- a/packages/strapi-plugin-users-permissions/config/policies/rateLimit.js +++ b/packages/strapi-plugin-users-permissions/config/policies/rateLimit.js @@ -3,10 +3,10 @@ const RateLimit = require('koa2-ratelimit').RateLimit; module.exports = async (ctx, next) => { const message = ctx.request.admin ? [{ messages: [{ id: 'Auth.form.error.ratelimit' }] }] : 'Too many attempts, please try again in a minute.'; - return RateLimit.middleware({ + return RateLimit.middleware(Object.assign({}, { interval: 1*60*1000, max: 5, prefixKey: `${ctx.request.url}:${ctx.request.ip}`, message - })(ctx, next); + }, strapi.plugins['users-permissions'].config.ratelimit))(ctx, next); }; diff --git a/packages/strapi-plugin-users-permissions/config/request.json b/packages/strapi-plugin-users-permissions/config/request.json new file mode 100644 index 0000000000..7a74471551 --- /dev/null +++ b/packages/strapi-plugin-users-permissions/config/request.json @@ -0,0 +1,6 @@ +{ + "ratelimit": { + "interval": 60000, + "max": 10 + } +} From 499dbfd43e20ce319149168e76e4a4b61130e012 Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 8 Aug 2018 14:30:40 +0200 Subject: [PATCH 28/44] Update the contributing guide --- CONTRIBUTING.md | 117 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 96 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d9ab64699..da5e784159 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,40 +32,115 @@ If you send a pull request, please do it again the `master` branch. We are devel ## Setup Development Environment To facilitate the contribution, we drastically reduce the amount of commands necessary to install the entire development environment. First of all, you need to check if you're using the recommended versions of Node.js (v8) and npm (v5). -**Then, please follow the instructions below:** +Then, please follow the instructions below: -1. [Fork the repository](https://github.com/strapi/strapi) to your own GitHub account. -2. Clone it to your computer `git clone git@github.com:strapi/strapi.git`. -3. Run `npm run setup` at the root of the directory. +#### 1. Fork the repository -> Note: If the installation failed, please remove the global packages related to Strapi. The command `npm ls strapi` will help you to find where your packages are installed globally. +[Go to the repository](https://github.com/strapi/strapi) and fork it to your own GitHub account. -> Note: You can run `npm run setup:build` to build the plugins' admin (the setup time will be longer). +#### 2. Clone the repository +```bash +git clone git@github.com:strapi/strapi.git +``` -The development environment has been installed. Now, you have to create a development project to live-test your updates. +#### 3. ⏳ Installation + +Go to the root of the repository. +```bash +cd strapi +``` -1. Go to a folder on your computer `cd /path/to/my/folder`. -2. Create a new project `strapi new myDevelopmentProject --dev`. -3. Start your app with `strapi start`. +**Two setup are available... with or without the front-end build.** -Awesome! You are now able to make bug fixes or enhancements in the framework layer of Strapi. **To make updates in the administration panel, you need to go a little bit further.** +Without the front-end build, you won't be able to access to the administration panel via http://localhost:1337/admin, you'll have to run the administration separately and access it through http://localhost:4000/admin. -4. Open a new tab or new terminal window. -5. Go to the `my-app/admin` folder of your currently running app. -6. Run `npm start` and go to the following url [http://localhost:4000/admin](http://localhost:4000/admin) +
+ +Without the front-end build (recommended) +```bash +npm run setup +``` +or with the front-end builds +```bash +npm run setup:build +``` + +> ⚠️  If the installation failed, please remove the global packages related to Strapi. The command `npm ls strapi` will help you to find where your packages are installed globally. + +#### 4. 🏗 Create a new project + +You can open a new terminal window and go into any folder you want for the next steps. +```bash +cd /.../workspace/ +``` + +The command to generate a project is the same, except you have to add the `--dev` argument at the end of line. +```bash +strapi new my-project --dev +``` + +#### 5. 🚀 Start the project + +First, you have to start the server. +```bash +cd ./my-project +strapi start +``` + +The server (API) is available at http://localhost:1337 + +> ⚠️  If you've followed the recommended setup, you should not be able to reach the administration panel at http://localhost:1337/admin. + +Then, you have to start the Webpack server to build and run the administration. +```bash +cd ./my-project/admin +npm run start +``` + +The administration panel is available at http://localhost:4000/admin + +**Awesome! You are now able to contribute to Strapi.** + +--- ## Plugin Development Setup -To create a new plugin, you'll have to run the following commands +To create a new plugin, you'll have to run the following commands: -1. In your project folder `cd myDevelopmentProject && strapi generate:plugin my-plugin`. -2. Make sure that the `strapi-helper-plugin` is linked to your plugin - - In the folder where strapi is cloned `cd pathToStrapiRepo/strapi/packages/strapi-helper-plugin && npm link`. - - In your project folder `cd pathToMyProject/myDevelopmentProject/plugins/my-plugin && npm link strapi-helper-plugin`. -3. Start the server in the admin folder `cd pathToMyProject/myDevelopmentProject/admin && npm start` and go to the following url [http://localhost:4000/admin](http://localhost:4000/admin). +#### 1. Generate a new plugin -*** +```bash +cd ./my-project +strapi generate:plugin my-plugin +``` + +#### 2. Verify the symlink + +Make you that the `strapi-helper-plugin` is linked to your project. + +Please run this command in the repository folder where Strapi is cloned: +```bash +cd /repository/strapi/packages/strapi-helper-plugin +npm link +``` + +Link the `strapi-helper-plugin` node_modules in the plugin folder: +```bash +cd ./my-project/plugins/my-plugin +npm link strapi-helper-plugin +``` + +#### 3. Start the project + +```bash +cd ./my-project/admin +npm run start +``` + +The administration panel is available at http://localhost:4000/admin + +--- ## Reporting an issue From 092cf8f763142aa46bdb00d8da1caaf4f4f88bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20GEORGET?= Date: Wed, 8 Aug 2018 14:39:21 +0200 Subject: [PATCH 29/44] Update CONTRIBUTING.md --- CONTRIBUTING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index da5e784159..fdb300e867 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contribute to Strapi -👍🎉 First off, thanks for taking the time to contribute! 🎉👍 +First off, thanks for taking the time to contribute! 🎉👍 The following is a set of guidelines for contributing to Strapi and its packages. @@ -34,11 +34,11 @@ To facilitate the contribution, we drastically reduce the amount of commands nec Then, please follow the instructions below: -#### 1. Fork the repository +#### 1. ▪️ Fork the repository [Go to the repository](https://github.com/strapi/strapi) and fork it to your own GitHub account. -#### 2. Clone the repository +#### 2. 💿 Clone the repository ```bash git clone git@github.com:strapi/strapi.git @@ -108,14 +108,14 @@ The administration panel is available at http://localhost:4000/admin To create a new plugin, you'll have to run the following commands: -#### 1. Generate a new plugin +#### 1. 🏗 Generate a new plugin ```bash cd ./my-project strapi generate:plugin my-plugin ``` -#### 2. Verify the symlink +#### 2. ✅ Verify the symlink Make you that the `strapi-helper-plugin` is linked to your project. @@ -131,7 +131,7 @@ cd ./my-project/plugins/my-plugin npm link strapi-helper-plugin ``` -#### 3. Start the project +#### 3. 🚀 Start the project ```bash cd ./my-project/admin From cc71294de65456305859f5a13e4f9ad775872133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20GEORGET?= Date: Wed, 8 Aug 2018 14:40:18 +0200 Subject: [PATCH 30/44] Fix typo contributing guide --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fdb300e867..81a301ac52 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,13 +51,13 @@ Go to the root of the repository. cd strapi ``` -**Two setup are available... with or without the front-end build.** +**Two setup are available... with or without the front-end builds.** -Without the front-end build, you won't be able to access to the administration panel via http://localhost:1337/admin, you'll have to run the administration separately and access it through http://localhost:4000/admin. +Without the front-end builds, you won't be able to access to the administration panel via http://localhost:1337/admin, you'll have to run the administration separately and access it through http://localhost:4000/admin.
-Without the front-end build (recommended) +Without the front-end builds (recommended) ```bash npm run setup ``` From e404d4cac29423b8ffd7b1156c89923727e13127 Mon Sep 17 00:00:00 2001 From: Pierre Burgy Date: Wed, 8 Aug 2018 16:30:04 +0200 Subject: [PATCH 31/44] Fix multi active left menu links --- .../strapi-admin/admin/src/components/LeftMenuLink/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/strapi-admin/admin/src/components/LeftMenuLink/index.js b/packages/strapi-admin/admin/src/components/LeftMenuLink/index.js index 5a36b8e12b..d37f84e0bc 100755 --- a/packages/strapi-admin/admin/src/components/LeftMenuLink/index.js +++ b/packages/strapi-admin/admin/src/components/LeftMenuLink/index.js @@ -20,9 +20,10 @@ class LeftMenuLink extends React.Component { // We need to create our own active url checker, // because of the two levels router. const isLinkActive = startsWith( - window.location.pathname.replace('/admin', ''), - this.props.destination, + window.location.pathname.replace('/admin', '').concat('/'), + this.props.destination.concat('/'), ); + const plugin = this.props.source !== 'content-manager' && this.props.source !== '' ? (
From a7f5942a7203c948713bf3fb48b8d8fd327e5d90 Mon Sep 17 00:00:00 2001 From: Pierre Burgy Date: Wed, 8 Aug 2018 16:30:24 +0200 Subject: [PATCH 32/44] Fix multi active left menu links --- packages/strapi-admin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index b5778e1491..a918c9edf7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file From 3532b20ecfd2609c7403833dd89f47d04c7c45d5 Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 8 Aug 2018 16:34:17 +0200 Subject: [PATCH 33/44] Remove pre-checked checkbox --- .../admin/src/containers/AuthPage/actions.js | 2 +- .../admin/src/containers/AuthPage/form.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/actions.js b/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/actions.js index 53d0a91bce..6c1fdd0b05 100644 --- a/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/actions.js +++ b/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/actions.js @@ -60,7 +60,7 @@ export function setForm(formType, email) { password: '', confirmPassword: '', email: '', - news: true, + news: false, }; break; case 'register-success': diff --git a/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/form.json b/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/form.json index 075de9f189..08a23dbdc2 100644 --- a/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/form.json +++ b/packages/strapi-plugin-users-permissions/admin/src/containers/AuthPage/form.json @@ -80,7 +80,7 @@ }, "name": "news", "type": "checkbox", - "value": true + "value": false } ], "register-success": [ From f0c331bd91b23ee921b9b28ad81117c3fb62ad3f Mon Sep 17 00:00:00 2001 From: Aurelsicoko Date: Wed, 8 Aug 2018 16:43:50 +0200 Subject: [PATCH 34/44] Send the user to the right section in the Quickstart tutorial --- packages/strapi-admin/admin/src/containers/HomePage/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-admin/admin/src/containers/HomePage/index.js b/packages/strapi-admin/admin/src/containers/HomePage/index.js index 39a12cc6aa..a307417f03 100644 --- a/packages/strapi-admin/admin/src/containers/HomePage/index.js +++ b/packages/strapi-admin/admin/src/containers/HomePage/index.js @@ -137,7 +137,7 @@ export class HomePage extends React.PureComponent { const data = this.showFirstBlock() ? { className: styles.homePageTutorialButton, - href: 'https://strapi.io/documentation/getting-started/quick-start.html', + href: 'https://strapi.io/documentation/getting-started/quick-start.html#create-your-first-api', id: 'app.components.HomePage.button.quickStart', primary: true, } From 2980c200afd8a89a95e9b8f832dd414db929b858 Mon Sep 17 00:00:00 2001 From: Pierre Burgy Date: Wed, 8 Aug 2018 17:25:25 +0200 Subject: [PATCH 35/44] Fix download display --- .../containers/InstallPluginPage/actions.js | 27 +++++++++++--- .../containers/InstallPluginPage/constants.js | 6 ++- .../src/containers/InstallPluginPage/index.js | 28 ++++++++------ .../containers/InstallPluginPage/reducer.js | 11 +++++- .../src/containers/InstallPluginPage/saga.js | 37 ++++++++++++++++--- packages/strapi-admin/package.json | 2 +- 6 files changed, 82 insertions(+), 29 deletions(-) diff --git a/packages/strapi-admin/admin/src/containers/InstallPluginPage/actions.js b/packages/strapi-admin/admin/src/containers/InstallPluginPage/actions.js index 4de39e11f8..6f58869926 100644 --- a/packages/strapi-admin/admin/src/containers/InstallPluginPage/actions.js +++ b/packages/strapi-admin/admin/src/containers/InstallPluginPage/actions.js @@ -8,8 +8,10 @@ import { DOWNLOAD_PLUGIN, DOWNLOAD_PLUGIN_ERROR, DOWNLOAD_PLUGIN_SUCCEEDED, - GET_PLUGINS, - GET_PLUGINS_SUCCEEDED, + GET_AVAILABLE_PLUGINS, + GET_AVAILABLE_PLUGINS_SUCCEEDED, + GET_INSTALLED_PLUGINS, + GET_INSTALLED_PLUGINS_SUCCEEDED, ON_CHANGE, } from './constants'; @@ -32,19 +34,32 @@ export function downloadPluginSucceeded() { }; } -export function getPlugins() { +export function getAvailablePlugins() { return { - type: GET_PLUGINS, + type: GET_AVAILABLE_PLUGINS, }; } -export function getPluginsSucceeded(availablePlugins) { +export function getAvailablePluginsSucceeded(availablePlugins) { return { - type: GET_PLUGINS_SUCCEEDED, + type: GET_AVAILABLE_PLUGINS_SUCCEEDED, availablePlugins, }; } +export function getInstalledPlugins() { + return { + type: GET_INSTALLED_PLUGINS, + }; +} + +export function getInstalledPluginsSucceeded(installedPlugins) { + return { + type: GET_INSTALLED_PLUGINS_SUCCEEDED, + installedPlugins, + }; +} + export function onChange({ target }) { return { type: ON_CHANGE, diff --git a/packages/strapi-admin/admin/src/containers/InstallPluginPage/constants.js b/packages/strapi-admin/admin/src/containers/InstallPluginPage/constants.js index 2141383d83..06650ea0e6 100644 --- a/packages/strapi-admin/admin/src/containers/InstallPluginPage/constants.js +++ b/packages/strapi-admin/admin/src/containers/InstallPluginPage/constants.js @@ -7,6 +7,8 @@ export const DOWNLOAD_PLUGIN = 'StrapiAdmin/InstallPluginPage/DOWNLOAD_PLUGIN'; export const DOWNLOAD_PLUGIN_ERROR = 'StrapiAdmin/InstallPluginPage/DOWNLOAD_PLUGIN_ERROR'; export const DOWNLOAD_PLUGIN_SUCCEEDED = 'StrapiAdmin/InstallPluginPage/DOWNLOAD_PLUGIN_SUCCEEDED'; -export const GET_PLUGINS = 'StrapiAdmin/InstallPluginPage/GET_PLUGINS'; -export const GET_PLUGINS_SUCCEEDED = 'StrapiAdmin/InstallPluginPage/GET_PLUGINS_SUCCEEDED'; +export const GET_AVAILABLE_PLUGINS = 'StrapiAdmin/InstallPluginPage/GET_AVAILABLE_PLUGINS'; +export const GET_AVAILABLE_PLUGINS_SUCCEEDED = 'StrapiAdmin/InstallPluginPage/GET_AVAILABLE_PLUGINS_SUCCEEDED'; +export const GET_INSTALLED_PLUGINS = 'StrapiAdmin/InstallPluginPage/GET_INSTALLED_PLUGINS'; +export const GET_INSTALLED_PLUGINS_SUCCEEDED = 'StrapiAdmin/InstallPluginPage/GET_INSTALLED_PLUGINS_SUCCEEDED'; export const ON_CHANGE = 'StrapiAdmin/InstallPluginPage/ON_CHANGE'; diff --git a/packages/strapi-admin/admin/src/containers/InstallPluginPage/index.js b/packages/strapi-admin/admin/src/containers/InstallPluginPage/index.js index 49634bb882..c1c4016891 100644 --- a/packages/strapi-admin/admin/src/containers/InstallPluginPage/index.js +++ b/packages/strapi-admin/admin/src/containers/InstallPluginPage/index.js @@ -11,7 +11,7 @@ import { Helmet } from 'react-helmet'; import { FormattedMessage } from 'react-intl'; import { bindActionCreators, compose } from 'redux'; import cn from 'classnames'; -import { get, isUndefined, map } from 'lodash'; +import { map } from 'lodash'; import { disableGlobalOverlayBlocker, @@ -32,7 +32,8 @@ import injectReducer from 'utils/injectReducer'; import { downloadPlugin, - getPlugins, + getAvailablePlugins, + getInstalledPlugins, onChange, } from './actions'; @@ -55,8 +56,11 @@ export class InstallPluginPage extends React.Component { // eslint-disable-line // Don't fetch the available plugins if it has already been done if (!this.props.didFetchPlugins) { - this.props.getPlugins(); + this.props.getAvailablePlugins(); } + + // Get installed plugins + this.props.getInstalledPlugins(); } componentWillUnmount() { @@ -65,10 +69,10 @@ export class InstallPluginPage extends React.Component { // eslint-disable-line } render() { - if (!this.props.didFetchPlugins) { + if (!this.props.didFetchPlugins || !this.props.didFetchInstalledPlugins) { return ; } - + return (
@@ -112,7 +116,7 @@ export class InstallPluginPage extends React.Component { // eslint-disable-line key={plugin.id} plugin={plugin} showSupportUsButton={plugin.id === 'support-us'} - isAlreadyInstalled={!isUndefined(get(this.context.plugins.toJS(), plugin.id))} + isAlreadyInstalled={this.props.installedPlugins.includes(plugin.id)} downloadPlugin={(e) => { e.preventDefault(); e.stopPropagation(); @@ -134,19 +138,18 @@ InstallPluginPage.childContextTypes = { downloadPlugin: PropTypes.func.isRequired, }; -InstallPluginPage.contextTypes = { - plugins: PropTypes.object.isRequired, -}; - InstallPluginPage.propTypes = { availablePlugins: PropTypes.array.isRequired, blockApp: PropTypes.bool.isRequired, + didFetchInstalledPlugins: PropTypes.bool.isRequired, didFetchPlugins: PropTypes.bool.isRequired, disableGlobalOverlayBlocker: PropTypes.func.isRequired, downloadPlugin: PropTypes.func.isRequired, enableGlobalOverlayBlocker: PropTypes.func.isRequired, - getPlugins: PropTypes.func.isRequired, + getAvailablePlugins: PropTypes.func.isRequired, + getInstalledPlugins: PropTypes.func.isRequired, history: PropTypes.object.isRequired, + installedPlugins: PropTypes.array.isRequired, // onChange: PropTypes.func.isRequired, // search: PropTypes.string.isRequired, }; @@ -159,7 +162,8 @@ function mapDispatchToProps(dispatch) { disableGlobalOverlayBlocker, downloadPlugin, enableGlobalOverlayBlocker, - getPlugins, + getAvailablePlugins, + getInstalledPlugins, onChange, }, dispatch, diff --git a/packages/strapi-admin/admin/src/containers/InstallPluginPage/reducer.js b/packages/strapi-admin/admin/src/containers/InstallPluginPage/reducer.js index cc70f6f36c..2f7f007b46 100644 --- a/packages/strapi-admin/admin/src/containers/InstallPluginPage/reducer.js +++ b/packages/strapi-admin/admin/src/containers/InstallPluginPage/reducer.js @@ -9,14 +9,17 @@ import { DOWNLOAD_PLUGIN, DOWNLOAD_PLUGIN_ERROR, DOWNLOAD_PLUGIN_SUCCEEDED, - GET_PLUGINS_SUCCEEDED, + GET_AVAILABLE_PLUGINS_SUCCEEDED, + GET_INSTALLED_PLUGINS_SUCCEEDED, ON_CHANGE, } from './constants'; const initialState = fromJS({ availablePlugins: List([]), + installedPlugins: List([]), blockApp: false, didFetchPlugins: false, + didFetchInstalledPlugins: false, pluginToDownload: '', search: '', }); @@ -35,10 +38,14 @@ function installPluginPageReducer(state = initialState, action) { return state .set('blockApp', false) .set('pluginToDownload', ''); - case GET_PLUGINS_SUCCEEDED: + case GET_AVAILABLE_PLUGINS_SUCCEEDED: return state .set('didFetchPlugins', true) .set('availablePlugins', List(action.availablePlugins)); + case GET_INSTALLED_PLUGINS_SUCCEEDED: + return state + .set('didFetchInstalledPlugins', true) + .set('installedPlugins', List(action.installedPlugins)); case ON_CHANGE: return state.updateIn(action.keys, () => action.value); default: diff --git a/packages/strapi-admin/admin/src/containers/InstallPluginPage/saga.js b/packages/strapi-admin/admin/src/containers/InstallPluginPage/saga.js index ee8c18c416..0a2384a6b0 100644 --- a/packages/strapi-admin/admin/src/containers/InstallPluginPage/saga.js +++ b/packages/strapi-admin/admin/src/containers/InstallPluginPage/saga.js @@ -15,9 +15,10 @@ import { selectLocale } from '../LanguageProvider/selectors'; import { downloadPluginError, downloadPluginSucceeded, - getPluginsSucceeded, + getAvailablePluginsSucceeded, + getInstalledPluginsSucceeded, } from './actions'; -import { DOWNLOAD_PLUGIN, GET_PLUGINS } from './constants'; +import { DOWNLOAD_PLUGIN, GET_AVAILABLE_PLUGINS, GET_INSTALLED_PLUGINS } from './constants'; import { makeSelectPluginToDownload } from './selectors'; @@ -49,7 +50,7 @@ export function* pluginDownload() { } } -export function* pluginsGet() { +export function* getAvailablePlugins() { try { // Get current locale. const locale = yield select(selectLocale()); @@ -73,20 +74,44 @@ export function* pluginsGet() { availablePlugins = []; } - yield put(getPluginsSucceeded(availablePlugins)); + yield put(getAvailablePluginsSucceeded(availablePlugins)); } catch(err) { strapi.notification.error('notification.error'); } } +export function* getInstalledPlugins() { + try { + const opts = { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }; + let installedPlugins; + + try { + // Retrieve plugins list. + installedPlugins = yield call(request, '/admin/plugins', opts); + } catch (e) { + installedPlugins = []; + } + + yield put(getInstalledPluginsSucceeded(Object.keys(installedPlugins.plugins))); + } catch(err) { + strapi.notification.error('notification.error'); + } +} // Individual exports for testing export default function* defaultSaga() { - const loadPluginsWatcher = yield fork(takeLatest, GET_PLUGINS, pluginsGet); + const loadAvailablePluginsWatcher = yield fork(takeLatest, GET_AVAILABLE_PLUGINS, getAvailablePlugins); + const loadInstalledPluginsWatcher = yield fork(takeLatest, GET_INSTALLED_PLUGINS, getInstalledPlugins); yield fork(takeLatest, DOWNLOAD_PLUGIN, pluginDownload); yield take(LOCATION_CHANGE); - yield cancel(loadPluginsWatcher); + yield cancel(loadAvailablePluginsWatcher); + yield cancel(loadInstalledPluginsWatcher); } diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index b5778e1491..a918c9edf7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file From 00b4fc0238fe121cce7e717d702092c77f1e0980 Mon Sep 17 00:00:00 2001 From: Pierre Burgy Date: Wed, 8 Aug 2018 17:27:47 +0200 Subject: [PATCH 36/44] Disable eslint for app.js log --- packages/strapi-admin/admin/src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-admin/admin/src/app.js b/packages/strapi-admin/admin/src/app.js index a7f4cff8d0..83a6e8debd 100755 --- a/packages/strapi-admin/admin/src/app.js +++ b/packages/strapi-admin/admin/src/app.js @@ -129,7 +129,7 @@ if (window.location.port !== '4000') { }); }) .catch(err => { - console.log(err); + console.log(err); // eslint-disable-line no-console }); } else if (findIndex(plugins, ['id', 'users-permissions']) === -1) { store.dispatch(unsetHasUserPlugin()); From b4d97fb9db5e788f7d757392ce7d87094cb2d9b6 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Thu, 9 Aug 2018 13:39:34 +0200 Subject: [PATCH 37/44] 3.0.0-alpha.13.1 --- package.json | 2 +- packages/strapi-admin/package.json | 6 ++--- packages/strapi-email-amazon-ses/package.json | 2 +- packages/strapi-email-mailgun/package.json | 2 +- packages/strapi-email-sendgrid/package.json | 2 +- packages/strapi-email-sendmail/package.json | 2 +- packages/strapi-generate-admin/package.json | 6 ++--- packages/strapi-generate-api/package.json | 4 ++-- .../strapi-generate-controller/package.json | 4 ++-- packages/strapi-generate-model/package.json | 4 ++-- packages/strapi-generate-new/package.json | 6 ++--- packages/strapi-generate-plugin/package.json | 4 ++-- packages/strapi-generate-policy/package.json | 4 ++-- packages/strapi-generate-service/package.json | 4 ++-- packages/strapi-generate/package.json | 4 ++-- packages/strapi-helper-plugin/package.json | 2 +- packages/strapi-hook-bookshelf/package.json | 8 +++---- packages/strapi-hook-ejs/package.json | 4 ++-- packages/strapi-hook-knex/package.json | 2 +- packages/strapi-hook-mongoose/package.json | 4 ++-- packages/strapi-hook-redis/package.json | 4 ++-- packages/strapi-lint/package.json | 2 +- packages/strapi-middleware-views/package.json | 2 +- .../package.json | 4 ++-- .../package.json | 8 +++---- packages/strapi-plugin-email/package.json | 6 ++--- packages/strapi-plugin-graphql/package.json | 4 ++-- .../package.json | 4 ++-- packages/strapi-plugin-upload/package.json | 6 ++--- .../package.json | 4 ++-- packages/strapi-upload-aws-s3/package.json | 2 +- .../strapi-upload-cloudinary/package.json | 2 +- packages/strapi-upload-local/package.json | 2 +- packages/strapi-upload-rackspace/package.json | 2 +- packages/strapi-utils/package.json | 2 +- packages/strapi/package.json | 22 +++++++++---------- 36 files changed, 76 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index e91587fcd6..e313d25372 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "dependencies": {}, "devDependencies": { "assert": "~1.3.0", diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index a918c9edf7..ac84a280e2 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-admin", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Strapi Admin", "repository": { "type": "git", @@ -31,8 +31,8 @@ }, "devDependencies": { "sanitize.css": "^4.1.0", - "strapi-helper-plugin": "3.0.0-alpha.13.0.1", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-helper-plugin": "3.0.0-alpha.13.1", + "strapi-utils": "3.0.0-alpha.13.1" }, "author": { "name": "Strapi", diff --git a/packages/strapi-email-amazon-ses/package.json b/packages/strapi-email-amazon-ses/package.json index 1c58d73fa1..47ece20ed4 100644 --- a/packages/strapi-email-amazon-ses/package.json +++ b/packages/strapi-email-amazon-ses/package.json @@ -1,6 +1,6 @@ { "name": "strapi-email-amazon-ses", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Amazon SES provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-email-mailgun/package.json b/packages/strapi-email-mailgun/package.json index c59e63d4ab..5509d9eaeb 100644 --- a/packages/strapi-email-mailgun/package.json +++ b/packages/strapi-email-mailgun/package.json @@ -1,6 +1,6 @@ { "name": "strapi-email-mailgun", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Mailgun provider for strapi email plugin", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-email-sendgrid/package.json b/packages/strapi-email-sendgrid/package.json index c9f50abcee..317ae57c95 100644 --- a/packages/strapi-email-sendgrid/package.json +++ b/packages/strapi-email-sendgrid/package.json @@ -1,6 +1,6 @@ { "name": "strapi-email-sendgrid", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Sendgrid provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-email-sendmail/package.json b/packages/strapi-email-sendmail/package.json index fa046d68f2..2e5b075970 100644 --- a/packages/strapi-email-sendmail/package.json +++ b/packages/strapi-email-sendmail/package.json @@ -1,6 +1,6 @@ { "name": "strapi-email-sendmail", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Sendmail provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-admin/package.json b/packages/strapi-generate-admin/package.json index 9c05fd7b29..8be68236f4 100755 --- a/packages/strapi-generate-admin/package.json +++ b/packages/strapi-generate-admin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-admin", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate the default admin panel for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ @@ -15,8 +15,8 @@ "dependencies": { "fs-extra": "^4.0.1", "lodash": "^4.17.5", - "strapi-admin": "3.0.0-alpha.13.0.1", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-admin": "3.0.0-alpha.13.1", + "strapi-utils": "3.0.0-alpha.13.1" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-generate-api/package.json b/packages/strapi-generate-api/package.json index a93549e19e..5c45719c0a 100755 --- a/packages/strapi-generate-api/package.json +++ b/packages/strapi-generate-api/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-api", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate an API for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate-controller/package.json b/packages/strapi-generate-controller/package.json index cb6a9cba21..23eeed6231 100755 --- a/packages/strapi-generate-controller/package.json +++ b/packages/strapi-generate-controller/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-controller", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate a controller for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate-model/package.json b/packages/strapi-generate-model/package.json index b74b61a8f1..d297308cea 100755 --- a/packages/strapi-generate-model/package.json +++ b/packages/strapi-generate-model/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-model", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate a model for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate-new/package.json b/packages/strapi-generate-new/package.json index 981620a63d..7d00a873c8 100755 --- a/packages/strapi-generate-new/package.json +++ b/packages/strapi-generate-new/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-new", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate a new Strapi application.", "homepage": "http://strapi.io", "keywords": [ @@ -19,7 +19,7 @@ "listr": "^0.14.1", "lodash": "^4.17.5", "ora": "^2.1.0", - "strapi-utils": "3.0.0-alpha.13.0.1", + "strapi-utils": "3.0.0-alpha.13.1", "uuid": "^3.1.0" }, "scripts": { @@ -49,4 +49,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate-plugin/package.json b/packages/strapi-generate-plugin/package.json index 219a0c3faf..f8a862e611 100755 --- a/packages/strapi-generate-plugin/package.json +++ b/packages/strapi-generate-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-plugin", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate an plugin for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ @@ -44,4 +44,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate-policy/package.json b/packages/strapi-generate-policy/package.json index c93a99cf8e..bad4e49062 100755 --- a/packages/strapi-generate-policy/package.json +++ b/packages/strapi-generate-policy/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-policy", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate a policy for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate-service/package.json b/packages/strapi-generate-service/package.json index 78e9c38b20..f16d1811d1 100755 --- a/packages/strapi-generate-service/package.json +++ b/packages/strapi-generate-service/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-service", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Generate a service for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index 36313632f4..32279fc009 100755 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Master of ceremonies for the Strapi generators.", "homepage": "http://strapi.io", "keywords": [ @@ -17,7 +17,7 @@ "fs-extra": "^4.0.0", "lodash": "^4.17.5", "reportback": "^2.0.1", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-utils": "3.0.0-alpha.13.1" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index 984c20c2fe..82628e9877 100755 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-helper-plugin", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Helper for Strapi plugins development", "engines": { "node": ">= 9.0.0", diff --git a/packages/strapi-hook-bookshelf/package.json b/packages/strapi-hook-bookshelf/package.json index d45f896b48..07156e5c76 100755 --- a/packages/strapi-hook-bookshelf/package.json +++ b/packages/strapi-hook-bookshelf/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-bookshelf", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Bookshelf hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -20,8 +20,8 @@ "inquirer": "^5.2.0", "lodash": "^4.17.5", "pluralize": "^6.0.0", - "strapi-hook-knex": "3.0.0-alpha.13.0.1", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-hook-knex": "3.0.0-alpha.13.1", + "strapi-utils": "3.0.0-alpha.13.1" }, "strapi": { "dependencies": [ @@ -55,4 +55,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-hook-ejs/package.json b/packages/strapi-hook-ejs/package.json index df594d486b..6c38f3bf9a 100755 --- a/packages/strapi-hook-ejs/package.json +++ b/packages/strapi-hook-ejs/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-ejs", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "EJS hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-hook-knex/package.json b/packages/strapi-hook-knex/package.json index 70eed9b792..ae017125cf 100755 --- a/packages/strapi-hook-knex/package.json +++ b/packages/strapi-hook-knex/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-knex", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Knex hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-hook-mongoose/package.json b/packages/strapi-hook-mongoose/package.json index 8594b30991..c36a6b86c4 100755 --- a/packages/strapi-hook-mongoose/package.json +++ b/packages/strapi-hook-mongoose/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-mongoose", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Mongoose hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -19,7 +19,7 @@ "mongoose": "^5.0.16", "mongoose-float": "^1.0.2", "pluralize": "^6.0.0", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-utils": "3.0.0-alpha.13.1" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-hook-redis/package.json b/packages/strapi-hook-redis/package.json index 14f13d2731..717c607002 100755 --- a/packages/strapi-hook-redis/package.json +++ b/packages/strapi-hook-redis/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-redis", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Redis hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -18,7 +18,7 @@ "ioredis": "^3.1.2", "lodash": "^4.17.5", "stack-trace": "0.0.10", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-utils": "3.0.0-alpha.13.1" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-lint/package.json b/packages/strapi-lint/package.json index 2eb9b99121..544762ef2e 100644 --- a/packages/strapi-lint/package.json +++ b/packages/strapi-lint/package.json @@ -1,6 +1,6 @@ { "name": "strapi-lint", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Strapi eslint and prettier configurations", "directories": { "lib": "lib" diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index c82606e56f..6bef9b55e6 100755 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -1,6 +1,6 @@ { "name": "strapi-middleware-views", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Views middleware to enable server-side rendering for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index 6689bb8c02..c796abcee5 100755 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-manager", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "A powerful UI to easily manage your data.", "strapi": { "name": "Content Manager", @@ -29,7 +29,7 @@ "react-select": "^1.2.1", "react-sortable-hoc": "^0.8.3", "showdown": "^1.8.6", - "strapi-helper-plugin": "3.0.0-alpha.13.0.1" + "strapi-helper-plugin": "3.0.0-alpha.13.1" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-content-type-builder/package.json b/packages/strapi-plugin-content-type-builder/package.json index 727a8d695c..fe8ecbdfa6 100755 --- a/packages/strapi-plugin-content-type-builder/package.json +++ b/packages/strapi-plugin-content-type-builder/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-type-builder", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Strapi plugin to create content type (API).", "strapi": { "name": "Content Type Builder", @@ -23,11 +23,11 @@ }, "dependencies": { "pluralize": "^7.0.0", - "strapi-generate": "3.0.0-alpha.13.0.1", - "strapi-generate-api": "3.0.0-alpha.13.0.1" + "strapi-generate": "3.0.0-alpha.13.1", + "strapi-generate-api": "3.0.0-alpha.13.1" }, "devDependencies": { - "strapi-helper-plugin": "3.0.0-alpha.13.0.1" + "strapi-helper-plugin": "3.0.0-alpha.13.1" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-email/package.json b/packages/strapi-plugin-email/package.json index 20cab4dc6d..0bc639c496 100644 --- a/packages/strapi-plugin-email/package.json +++ b/packages/strapi-plugin-email/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-email", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "This is the description of the plugin.", "strapi": { "name": "Email", @@ -22,11 +22,11 @@ "prepublishOnly": "IS_MONOREPO=true npm run build" }, "dependencies": { - "strapi-email-sendmail": "3.0.0-alpha.13.0.1" + "strapi-email-sendmail": "3.0.0-alpha.13.1" }, "devDependencies": { "react-copy-to-clipboard": "5.0.1", - "strapi-helper-plugin": "3.0.0-alpha.13.0.1" + "strapi-helper-plugin": "3.0.0-alpha.13.1" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 482d315d9f..67b9741144 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-graphql", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "This is the description of the plugin.", "strapi": { "name": "graphql", @@ -30,7 +30,7 @@ "graphql-type-json": "^0.2.1", "graphql-type-datetime": "^0.2.2", "pluralize": "^7.0.0", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-utils": "3.0.0-alpha.13.1" }, "author": { "name": "A Strapi developer", diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json index 33763835d5..c5f3899e38 100755 --- a/packages/strapi-plugin-settings-manager/package.json +++ b/packages/strapi-plugin-settings-manager/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-settings-manager", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Strapi plugin to manage settings.", "strapi": { "name": "Settings Manager", @@ -25,7 +25,7 @@ "devDependencies": { "flag-icon-css": "^2.8.0", "react-select": "^1.0.0-rc.5", - "strapi-helper-plugin": "3.0.0-alpha.13.0.1" + "strapi-helper-plugin": "3.0.0-alpha.13.1" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-upload/package.json b/packages/strapi-plugin-upload/package.json index 46c67b8057..7719cf62a8 100644 --- a/packages/strapi-plugin-upload/package.json +++ b/packages/strapi-plugin-upload/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-upload", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "This is the description of the plugin.", "strapi": { "name": "Files Upload", @@ -23,12 +23,12 @@ }, "dependencies": { "react-copy-to-clipboard": "^5.0.1", - "strapi-upload-local": "3.0.0-alpha.13.0.1", + "strapi-upload-local": "3.0.0-alpha.13.1", "stream-to-array": "^2.3.0", "uuid": "^3.2.1" }, "devDependencies": { - "strapi-helper-plugin": "3.0.0-alpha.13.0.1" + "strapi-helper-plugin": "3.0.0-alpha.13.1" }, "author": { "name": "A Strapi developer", diff --git a/packages/strapi-plugin-users-permissions/package.json b/packages/strapi-plugin-users-permissions/package.json index d9545b6d8c..9b3116a73a 100644 --- a/packages/strapi-plugin-users-permissions/package.json +++ b/packages/strapi-plugin-users-permissions/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-users-permissions", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Protect your API with a full-authentication process based on JWT", "strapi": { "name": "Roles & Permissions", @@ -32,7 +32,7 @@ "uuid": "^3.1.0" }, "devDependencies": { - "strapi-helper-plugin": "3.0.0-alpha.13.0.1" + "strapi-helper-plugin": "3.0.0-alpha.13.1" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-upload-aws-s3/package.json b/packages/strapi-upload-aws-s3/package.json index 2888b061bf..9654f6663f 100644 --- a/packages/strapi-upload-aws-s3/package.json +++ b/packages/strapi-upload-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "strapi-upload-aws-s3", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "AWS S3 provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-upload-cloudinary/package.json b/packages/strapi-upload-cloudinary/package.json index 5c92874574..bc176a0c98 100644 --- a/packages/strapi-upload-cloudinary/package.json +++ b/packages/strapi-upload-cloudinary/package.json @@ -1,6 +1,6 @@ { "name": "strapi-upload-cloudinary", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Cloudinary provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-upload-local/package.json b/packages/strapi-upload-local/package.json index 979b53e868..78e988fd49 100644 --- a/packages/strapi-upload-local/package.json +++ b/packages/strapi-upload-local/package.json @@ -1,6 +1,6 @@ { "name": "strapi-upload-local", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Local provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-upload-rackspace/package.json b/packages/strapi-upload-rackspace/package.json index a0e60d2516..1a9bf3f374 100644 --- a/packages/strapi-upload-rackspace/package.json +++ b/packages/strapi-upload-rackspace/package.json @@ -1,6 +1,6 @@ { "name": "strapi-upload-rackspace", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Rackspace provider for strapi upload", "main": "./lib", "scripts": { diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index e3a47e4fc0..72d598a69a 100755 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -1,6 +1,6 @@ { "name": "strapi-utils", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "Shared utilities for the Strapi packages", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi/package.json b/packages/strapi/package.json index 77f9bb11e9..4cec3003a7 100755 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -1,6 +1,6 @@ { "name": "strapi", - "version": "3.0.0-alpha.13.0.1", + "version": "3.0.0-alpha.13.1", "description": "An open source solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier.", "homepage": "http://strapi.io", "keywords": [ @@ -55,16 +55,16 @@ "rimraf": "^2.6.2", "semver": "^5.4.1", "stack-trace": "0.0.10", - "strapi-generate": "3.0.0-alpha.13.0.1", - "strapi-generate-admin": "3.0.0-alpha.13.0.1", - "strapi-generate-api": "3.0.0-alpha.13.0.1", - "strapi-generate-controller": "3.0.0-alpha.13.0.1", - "strapi-generate-model": "3.0.0-alpha.13.0.1", - "strapi-generate-new": "3.0.0-alpha.13.0.1", - "strapi-generate-plugin": "3.0.0-alpha.13.0.1", - "strapi-generate-policy": "3.0.0-alpha.13.0.1", - "strapi-generate-service": "3.0.0-alpha.13.0.1", - "strapi-utils": "3.0.0-alpha.13.0.1" + "strapi-generate": "3.0.0-alpha.13.1", + "strapi-generate-admin": "3.0.0-alpha.13.1", + "strapi-generate-api": "3.0.0-alpha.13.1", + "strapi-generate-controller": "3.0.0-alpha.13.1", + "strapi-generate-model": "3.0.0-alpha.13.1", + "strapi-generate-new": "3.0.0-alpha.13.1", + "strapi-generate-plugin": "3.0.0-alpha.13.1", + "strapi-generate-policy": "3.0.0-alpha.13.1", + "strapi-generate-service": "3.0.0-alpha.13.1", + "strapi-utils": "3.0.0-alpha.13.1" }, "author": { "email": "hi@strapi.io", From 6ec3295ace862348145c49ce52895142cbae9ee3 Mon Sep 17 00:00:00 2001 From: KuongKnight Date: Mon, 13 Aug 2018 10:09:38 +0700 Subject: [PATCH 38/44] updated document --- docs/3.x.x/en/guides/models.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/3.x.x/en/guides/models.md b/docs/3.x.x/en/guides/models.md index 91f0a517bc..de58ff2c6d 100644 --- a/docs/3.x.x/en/guides/models.md +++ b/docs/3.x.x/en/guides/models.md @@ -19,6 +19,11 @@ The info key on the model-json states information about the model. This informat - `description`: The description of the model. - `mainField`: Determines which model-attribute is shown when displaying the model. +## Model options +The options key on the model-json states. + - `idAttribute`: This tells the model which attribute to expect as the unique identifier for each database row (typically an auto-incrementing primary key named 'id'). + - `idAttributeType`: Data type of `idAttribute`, accepted list of value bellow: + ## Define the attributes The following types are currently available: From 95ce4091f7b83fb5b98fd4135cd66526a29aee55 Mon Sep 17 00:00:00 2001 From: Jan Brachhold Date: Thu, 16 Aug 2018 14:33:37 +0200 Subject: [PATCH 39/44] Update DE translations - strapi-admin --- .../admin/src/translations/de.json | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/strapi-admin/admin/src/translations/de.json b/packages/strapi-admin/admin/src/translations/de.json index dffa3c4271..e302899aba 100644 --- a/packages/strapi-admin/admin/src/translations/de.json +++ b/packages/strapi-admin/admin/src/translations/de.json @@ -16,12 +16,12 @@ "app.components.HomePage.welcome": "Willkommen an Bord!", "app.components.HomePage.welcome.again": "Willkommen", "app.components.HomePage.create": "Erstelle deinen ersten Inhaltstyp", - "app.components.HomePage.welcomeBlock.content": "Wir freuen uns, dich als Mitglied der Community zu haben. Wir sind offen für Feedback, senden uns einfach eine direkt Nachricht an\u0020", - "app.components.HomePage.welcomeBlock.content.issues": "Fehler", - "app.components.HomePage.welcomeBlock.content.raise": "\u0020oder erhöhen\u0020", + "app.components.HomePage.welcomeBlock.content": "Wir freuen uns, dich als Mitglied der Community zu haben. Wir sind offen für Feedback, senden uns einfach eine direkt Nachricht in\u0020", + "app.components.HomePage.welcomeBlock.content.issues": "Ticket.", + "app.components.HomePage.welcomeBlock.content.raise": "\u0020oder eröffne\u0020", "app.components.HomePage.createBlock.content.first": "Das\u0020", - "app.components.HomePage.createBlock.content.second": "\u0020Plugin wird dir helfen, die Datenstruktur deiner Modelle zu definieren. Wenn du neu hier bist, empfehlen wir dir unsere\u0020", - "app.components.HomePage.createBlock.content.tutorial": "\u0020Anleitung.", + "app.components.HomePage.createBlock.content.second": "\u0020Plugin wird dir helfen, die Datenstruktur deiner Modelle zu definieren. Wenn du neu hier bist, empfehlen wir dir unser\u0020", + "app.components.HomePage.createBlock.content.tutorial": "\u0020Tutorial.", "app.components.HomePage.welcomeBlock.content.again": "Wir hoffen, dass du Fortschritte bei deinem Projekt machst.... Lese das Neueste über Strapi. Wir geben unser Bestes, um das Produkt auf der Grundlage deines Feedbacks zu verbessern.", "app.components.HomePage.cta": "BESTÄTIGEN", "app.components.HomePage.community": "Finde die Community im Web", @@ -44,7 +44,7 @@ "app.components.InstallPluginPage.helmet": "Marktplatz - Plugins", "app.components.InstallPluginPage.title": "Marktplatz - Plugins", - "app.components.InstallPluginPage.description": "Erweitere problemlos deine App", + "app.components.InstallPluginPage.description": "Erweitere problemlos deine App.", "app.components.InstallPluginPage.plugin.support-us.description": "Unterstütze uns durch den Kauf eines Strapi T-Shirts. Das erlaubt uns, weiter an dem Projekt arbeiten zu können und es so gut wie nur möglich zu gestalten!", "app.components.InstallPluginPage.InputSearch.label": " ", "app.components.InstallPluginPage.InputSearch.placeholder": "Suche nach einem Plugin... (z.B.: Authentifizierung)", @@ -126,20 +126,20 @@ "components.ListRow.empty": "Es gibt keine Daten.", - "components.Wysiwyg.collapse": "Collapse", - "components.Wysiwyg.selectOptions.title": "Add a title", - "components.Wysiwyg.selectOptions.H1": "Title H1", - "components.Wysiwyg.selectOptions.H2": "Title H2", - "components.Wysiwyg.selectOptions.H3": "Title H3", - "components.Wysiwyg.selectOptions.H4": "Title H4", - "components.Wysiwyg.selectOptions.H5": "Title H5", - "components.Wysiwyg.selectOptions.H6": "Title H6", - "components.Wysiwyg.ToggleMode.markdown": "Switch to markdown", - "components.Wysiwyg.ToggleMode.preview": "Switch to preview", - "components.WysiwygBottomControls.charactersIndicators": "characters", - "components.WysiwygBottomControls.uploadFiles": "Attach files by dragging & dropping, {browse}, or pasting from the clipboard.", - "components.WysiwygBottomControls.uploadFiles.browse": "selecting them", - "components.WysiwygBottomControls.fullscreen": "Expand", + "components.Wysiwyg.collapse": "Verkleinern", + "components.Wysiwyg.selectOptions.title": "Füge einen Überschrift hinzu", + "components.Wysiwyg.selectOptions.H1": "Überschrift H1", + "components.Wysiwyg.selectOptions.H2": "Überschrift H2", + "components.Wysiwyg.selectOptions.H3": "Überschrift H3", + "components.Wysiwyg.selectOptions.H4": "Überschrift H4", + "components.Wysiwyg.selectOptions.H5": "Überschrift H5", + "components.Wysiwyg.selectOptions.H6": "Überschrift H6", + "components.Wysiwyg.ToggleMode.markdown": "Wechsel zu Markdown", + "components.Wysiwyg.ToggleMode.preview": "Wechsel zur Vorschau", + "components.WysiwygBottomControls.charactersIndicators": "Zeichen", + "components.WysiwygBottomControls.uploadFiles": "Ziehe eine Datei hierher, {browse} eine Datei zum hochladen aus oder füge sie aus der Zwischenablage ein.", + "components.WysiwygBottomControls.uploadFiles.browse": "wähle", + "components.WysiwygBottomControls.fullscreen": "Vergrößern", "HomePage.notification.newsLetter.success": "Newsletter erfolgreich abonniert", @@ -148,7 +148,7 @@ "Analytics": "Analytics", "Auth & Permissions": "Authentifizierung & Berechtigungen", - "Content Manager": "Content-Manager", + "Content Manager": "Inhalts-Manager", "Content Type Builder": "Inhaltstyp-Manager", "Files Upload": "Dateien hochladen", "Settings Manager": "Einstellungs-Manager", From dbc2a223c311e704ee5bfba8f027f3001b48f7f7 Mon Sep 17 00:00:00 2001 From: Jan Brachhold Date: Thu, 16 Aug 2018 14:33:55 +0200 Subject: [PATCH 40/44] Update DE translations - strapi-plugin-content-manager --- .../admin/src/translations/de.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/strapi-plugin-content-manager/admin/src/translations/de.json b/packages/strapi-plugin-content-manager/admin/src/translations/de.json index c771c16643..48e0430f9f 100644 --- a/packages/strapi-plugin-content-manager/admin/src/translations/de.json +++ b/packages/strapi-plugin-content-manager/admin/src/translations/de.json @@ -1,6 +1,6 @@ { - "plugin.description.short": "Greife blitzschnell auf alle Daten in der Datenbank zu und manipuliere sie.", - "plugin.description.long": "Greife blitzschnell auf alle Daten in der Datenbank zu und manipuliere sie.", + "plugin.description.short": "Greife blitzschnell auf alle Daten in der Datenbank zu und änder sie.", + "plugin.description.long": "Greife blitzschnell auf alle Daten in der Datenbank zu und änder sie.", "containers.Home.pluginHeaderTitle": "Inhalts-Manager", "containers.Home.introduction": "Um deine Einträge zu verwalten, klicke auf den entsprechenden Link im Menü links. Dieses Plugin ist noch in aktiver Entwicklung und seine Einstellungen können nicht optimal angepasst werden.", @@ -24,7 +24,7 @@ "containers.SettingsPage.Block.generalSettings.description": "Konfiguriere die Standardoptionen für deine Inhaltstypen.", "containers.SettingsPage.Block.generalSettings.title" : "Allgemeines", "containers.SettingsPage.Block.contentType.title": "Inhaltstypen", - "containers.SettingsPage.Block.contentType.description": "Konfiguriere die spezifischen Einstellungen", + "containers.SettingsPage.Block.contentType.description": "Konfiguriere die spezifischen Einstellungen.", "containers.SettingsPage.pluginHeaderDescription": "Konfigurieren Sie die Standardeinstellungen für alle Ihre Inhaltstypen.", "components.AddFilterCTA.add": "Filter", From 2440a15eeb6f730d79d71b6eee88445887ef1fef Mon Sep 17 00:00:00 2001 From: Jan Brachhold Date: Thu, 16 Aug 2018 14:34:13 +0200 Subject: [PATCH 41/44] Update DE translations - strapi-plugin-upload --- packages/strapi-plugin-upload/admin/src/translations/de.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strapi-plugin-upload/admin/src/translations/de.json b/packages/strapi-plugin-upload/admin/src/translations/de.json index e0b03b6caa..75c6e44d12 100644 --- a/packages/strapi-plugin-upload/admin/src/translations/de.json +++ b/packages/strapi-plugin-upload/admin/src/translations/de.json @@ -13,8 +13,8 @@ "EntriesNumber.number": "{number} Datei gefunden", "EntriesNumber.number.plural": "{number} Dateien gefunden", - "HomePage.title": "Hochladen", - "HomePage.description": "Übersicht über alle hochgeladenen Dateien", + "HomePage.title": "Dateien hochladen", + "HomePage.description": "Übersicht über alle hochgeladenen Dateien.", "HomePage.InputSearch.placeholder": "Suche nach einer Datei...", "Li.linkCopied": "Link in die Zwischenablage kopiert", From cef161bc2841ce71c0f5c8bc8e697d7e3c9f4c68 Mon Sep 17 00:00:00 2001 From: Jan Brachhold Date: Thu, 16 Aug 2018 14:34:27 +0200 Subject: [PATCH 42/44] Update DE translations - strapi-plugin-users-permissions --- .../admin/src/translations/de.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strapi-plugin-users-permissions/admin/src/translations/de.json b/packages/strapi-plugin-users-permissions/admin/src/translations/de.json index 60ed4e4b33..4e304d04a4 100755 --- a/packages/strapi-plugin-users-permissions/admin/src/translations/de.json +++ b/packages/strapi-plugin-users-permissions/admin/src/translations/de.json @@ -89,8 +89,8 @@ "HeaderNav.link.providers": "Methoden", "HeaderNav.link.roles": "Rollen", - "HomePage.header.title": "Benutzer & Befugnisse", - "HomePage.header.description": "Lege Rollen und deren Befugnisse fest", + "HomePage.header.title": "Benutzer & Berechtigungen", + "HomePage.header.description": "Lege Rollen und deren Berechtigungen fest.", "InputSearch.placeholder": "Suche nach einem Benutzer", From b48dbe09fde009c83ca124d462adb26cc1ee4226 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Tue, 21 Aug 2018 08:56:42 +0200 Subject: [PATCH 43/44] Fix end line --- packages/strapi-admin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index a918c9edf7..b5778e1491 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} From 96515492073cac0188097d58c67cf586ba4b32f2 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Tue, 21 Aug 2018 08:57:34 +0200 Subject: [PATCH 44/44] Fix end line --- packages/strapi-admin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index a918c9edf7..b5778e1491 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +}