Merge branch 'webhooks/tests' of github.com:strapi/strapi into webhooks/tests

This commit is contained in:
Virginie Ky 2020-01-30 18:00:52 +01:00
commit 896a15ca84
44 changed files with 126 additions and 95 deletions

View File

@ -213,7 +213,7 @@ And for your files, they have to be prefixed by `files`.
Example here with cover attribute `files.cover`.
::: tip
If you want to upload files for a component, you will have to specify the inidex of the item you wan to add the file.
If you want to upload files for a component, you will have to specify the index of the item you want to add the file.
Example `files.my_component_name[the_index].attribute_name`
:::

View File

@ -1,7 +1,7 @@
{
"name": "getstarted",
"private": true,
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "A Strapi application.",
"scripts": {
"develop": "strapi develop",
@ -15,21 +15,21 @@
"mysql": "^2.17.1",
"pg": "^7.10.0",
"sqlite3": "^4.0.6",
"strapi": "3.0.0-beta.18.6",
"strapi-admin": "3.0.0-beta.18.6",
"strapi-connector-bookshelf": "3.0.0-beta.18.6",
"strapi-connector-mongoose": "3.0.0-beta.18.6",
"strapi-middleware-views": "3.0.0-beta.18.6",
"strapi-plugin-content-manager": "3.0.0-beta.18.6",
"strapi-plugin-content-type-builder": "3.0.0-beta.18.6",
"strapi-plugin-documentation": "3.0.0-beta.18.6",
"strapi-plugin-email": "3.0.0-beta.18.6",
"strapi-plugin-graphql": "3.0.0-beta.18.6",
"strapi-plugin-upload": "3.0.0-beta.18.6",
"strapi-plugin-users-permissions": "3.0.0-beta.18.6",
"strapi-provider-email-mailgun": "3.0.0-beta.18.6",
"strapi-provider-upload-aws-s3": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6"
"strapi": "3.0.0-beta.18.7",
"strapi-admin": "3.0.0-beta.18.7",
"strapi-connector-bookshelf": "3.0.0-beta.18.7",
"strapi-connector-mongoose": "3.0.0-beta.18.7",
"strapi-middleware-views": "3.0.0-beta.18.7",
"strapi-plugin-content-manager": "3.0.0-beta.18.7",
"strapi-plugin-content-type-builder": "3.0.0-beta.18.7",
"strapi-plugin-documentation": "3.0.0-beta.18.7",
"strapi-plugin-email": "3.0.0-beta.18.7",
"strapi-plugin-graphql": "3.0.0-beta.18.7",
"strapi-plugin-upload": "3.0.0-beta.18.7",
"strapi-plugin-users-permissions": "3.0.0-beta.18.7",
"strapi-provider-email-mailgun": "3.0.0-beta.18.7",
"strapi-provider-upload-aws-s3": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7"
},
"strapi": {
"uuid": "getstarted"

View File

@ -1,5 +1,5 @@
{
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"packages": [
"packages/*",
"examples/*"

View File

@ -1,6 +1,6 @@
{
"name": "create-strapi-app",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate a new Strapi application.",
"license": "MIT",
"homepage": "http://strapi.io",
@ -21,7 +21,7 @@
],
"dependencies": {
"commander": "^2.20.0",
"strapi-generate-new": "3.0.0-beta.18.6"
"strapi-generate-new": "3.0.0-beta.18.7"
},
"scripts": {
"test": "echo \"no tests yet\""

View File

@ -124,12 +124,19 @@ export class Admin extends React.Component {
render() {
const {
global: {
autoReload,
blockApp,
currentEnvironment,
overlayBlockerData,
plugins,
showGlobalAppBlocker,
strapiVersion,
},
disableGlobalOverlayBlocker,
emitEvent,
enableGlobalOverlayBlocker,
intl: { formatMessage },
updatePlugin,
} = this.props;
// We need the admin data in order to make the initializers work
@ -144,13 +151,14 @@ export class Admin extends React.Component {
return (
<GlobalContextProvider
emitEvent={this.props.emitEvent}
currentEnvironment={this.props.global.currentEnvironment}
disableGlobalOverlayBlocker={this.props.disableGlobalOverlayBlocker}
enableGlobalOverlayBlocker={this.props.enableGlobalOverlayBlocker}
formatMessage={this.props.intl.formatMessage}
plugins={this.props.global.plugins}
updatePlugin={this.props.updatePlugin}
autoReload={autoReload}
emitEvent={emitEvent}
currentEnvironment={currentEnvironment}
disableGlobalOverlayBlocker={disableGlobalOverlayBlocker}
enableGlobalOverlayBlocker={enableGlobalOverlayBlocker}
formatMessage={formatMessage}
plugins={plugins}
updatePlugin={updatePlugin}
>
<Wrapper>
<LeftMenu version={strapiVersion} plugins={plugins} />
@ -216,6 +224,7 @@ Admin.propTypes = {
emitEvent: PropTypes.func.isRequired,
enableGlobalOverlayBlocker: PropTypes.func.isRequired,
global: PropTypes.shape({
autoReload: PropTypes.bool,
blockApp: PropTypes.bool,
currentEnvironment: PropTypes.string,
overlayBlockerData: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),

View File

@ -213,5 +213,9 @@
"Auth.link.forgot-password": "Esqueceu sua senha?",
"Auth.link.ready": "Pronto para entrar?",
"app.containers.App.notification.error.init": "Ocorreu um erro ao solicitar a API",
"components.Input.error.password.noMatch": "As senhas não conferem"
"components.Input.error.password.noMatch": "As senhas não conferem",
"form.button.done": "Terminar",
"form.button.finish": "Finalizar",
"notification.form.error.fields": "O formulário contém alguns erros",
"global.prompt.unsaved": "Você tem certeza que deseja sair desta página? Todas as suas modificacões serão perdidas"
}

View File

@ -1,6 +1,6 @@
{
"name": "strapi-admin",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Strapi Admin",
"repository": {
"type": "git",
@ -83,8 +83,8 @@
"reselect": "^3.0.1",
"sanitize.css": "^4.1.0",
"shelljs": "^0.7.8",
"strapi-helper-plugin": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6",
"strapi-helper-plugin": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7",
"style-loader": "^0.23.1",
"styled-components": "^4.2.0",
"terser-webpack-plugin": "^1.2.3",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-connector-bookshelf",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Bookshelf hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -22,7 +22,7 @@
"lodash": "^4.17.11",
"pluralize": "^7.0.0",
"rimraf": "^2.6.3",
"strapi-utils": "3.0.0-beta.18.6"
"strapi-utils": "3.0.0-beta.18.7"
},
"peerDependencies": {
"knex": "^0.20.0"

View File

@ -229,7 +229,8 @@ module.exports = ({ models, target, plugin = false }, ctx) => {
const refToStrapiRef = obj => {
const ref = obj.ref;
let plainData = typeof ref.toJSON === 'function' ? ref.toJSON() : ref;
let plainData =
ref && typeof ref.toJSON === 'function' ? ref.toJSON() : ref;
if (typeof plainData !== 'object') return ref;

View File

@ -1,6 +1,6 @@
{
"name": "strapi-connector-mongoose",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Mongoose hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -20,7 +20,7 @@
"mongoose-float": "^1.0.4",
"mongoose-long": "^0.2.1",
"pluralize": "^7.0.0",
"strapi-utils": "3.0.0-beta.18.6"
"strapi-utils": "3.0.0-beta.18.7"
},
"author": {
"email": "hi@strapi.io",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-database",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Strapi's database layer",
"homepage": "http://strapi.io",
"main": "./lib/index.js",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-api",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate an API for a Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-controller",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate a controller for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-model",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate a model for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-new",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate a new Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-plugin",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate an plugin for a Strapi application.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-policy",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate a policy for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate-service",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Generate a service for a Strapi API.",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-generate",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Master of ceremonies for the Strapi generators.",
"homepage": "http://strapi.io",
"keywords": [
@ -20,7 +20,7 @@
"fs-extra": "^8.0.1",
"lodash": "^4.17.11",
"reportback": "^2.0.2",
"strapi-utils": "3.0.0-beta.18.6"
"strapi-utils": "3.0.0-beta.18.7"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-helper-plugin",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Helper for Strapi plugins development",
"files": [
"dist"

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-ejs",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "EJS hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-hook-redis",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Redis hook for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [
@ -19,7 +19,7 @@
"lodash": "^4.17.11",
"rimraf": "^2.6.3",
"stack-trace": "0.0.10",
"strapi-utils": "3.0.0-beta.18.6"
"strapi-utils": "3.0.0-beta.18.7"
},
"author": {
"email": "hi@strapi.io",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-middleware-views",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Views middleware to enable server-side rendering for the Strapi framework",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-content-manager",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "A powerful UI to easily manage your data.",
"strapi": {
"name": "Content Manager",
@ -29,8 +29,8 @@
"redux-immutable": "^4.0.0",
"reselect": "^3.0.1",
"showdown": "^1.9.0",
"strapi-helper-plugin": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6",
"strapi-helper-plugin": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7",
"styled-components": "^4.2.0",
"yup": "^0.27.0"
},

View File

@ -38,6 +38,7 @@ const DataManagerProvider = ({ allIcons, children }) => {
const [reducerState, dispatch] = useReducer(reducer, initialState, init);
const [infoModals, toggleInfoModal] = useState({ cancel: false });
const {
autoReload,
currentEnvironment,
emitEvent,
formatMessage,
@ -59,7 +60,10 @@ const DataManagerProvider = ({ allIcons, children }) => {
const componentMatch = useRouteMatch(
`/plugins/${pluginId}/component-categories/:categoryUid/:componentUid`
);
const isInDevelopmentMode = currentEnvironment === 'development';
const formatMessageRef = useRef();
formatMessageRef.current = formatMessage;
const isInDevelopmentMode =
currentEnvironment === 'development' && autoReload;
const isInContentTypeView = contentTypeMatch !== null;
const firstKeyToMainSchema = isInContentTypeView
@ -120,6 +124,16 @@ const DataManagerProvider = ({ allIcons, children }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLoading, pathname]);
useEffect(() => {
if (currentEnvironment === 'development' && !autoReload) {
strapi.notification.info(
formatMessageRef.current({
id: getTrad('notification.info.autoreaload-disable'),
})
);
}
}, [autoReload, currentEnvironment]);
const didModifiedComponents =
getCreatedAndModifiedComponents(modifiedData.components || {}, components)
.length > 0;

View File

@ -132,6 +132,7 @@
"modelPage.attribute.relationWith": "Relation with",
"modelPage.contentHeader.emptyDescription.description": "There is no description",
"notification.info.creating.notSaved": "Please save your work before creating a new content type or component",
"notification.info.autoreaload-disable": "The autoReload feature is required to use this plugin. Start your server with `strapi develop`",
"plugin.description.long": "Modelize the data structure of your API. Create new fields and relations in just a minute. The files are automatically created and updated in your project.",
"plugin.description.short": "Modelize the data structure of your API.",
"popUpForm.navContainer.advanced": "Advanced settings",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-content-type-builder",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Strapi plugin to create content type (API).",
"strapi": {
"name": "Content Type Builder",
@ -26,10 +26,10 @@
"redux": "^4.0.1",
"redux-immutable": "^4.0.0",
"reselect": "^3.0.1",
"strapi-generate": "3.0.0-beta.18.6",
"strapi-generate-api": "3.0.0-beta.18.6",
"strapi-helper-plugin": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6",
"strapi-generate": "3.0.0-beta.18.7",
"strapi-generate-api": "3.0.0-beta.18.7",
"strapi-helper-plugin": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7",
"yup": "^0.27.0"
},
"author": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-documentation",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Documentation",
@ -32,7 +32,7 @@
"redux": "^4.0.1",
"redux-immutable": "^4.0.0",
"reselect": "^4.0.0",
"strapi-helper-plugin": "3.0.0-beta.18.6",
"strapi-helper-plugin": "3.0.0-beta.18.7",
"swagger-ui-dist": "3.24.3"
},
"author": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-email",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Email",
@ -13,13 +13,13 @@
},
"dependencies": {
"lodash": "^4.17.11",
"strapi-provider-email-sendmail": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6"
"strapi-provider-email-sendmail": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7"
},
"devDependencies": {
"react-copy-to-clipboard": "5.0.1",
"rimraf": "^2.6.3",
"strapi-helper-plugin": "3.0.0-beta.18.6"
"strapi-helper-plugin": "3.0.0-beta.18.7"
},
"author": {
"name": "Strapi team",

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-graphql",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "This is the description of the plugin.",
"strapi": {
"name": "graphql",
@ -24,7 +24,7 @@
"koa-compose": "^4.1.0",
"lodash": "^4.17.11",
"pluralize": "^7.0.0",
"strapi-utils": "3.0.0-beta.18.6"
"strapi-utils": "3.0.0-beta.18.7"
},
"devDependencies": {
"cross-env": "^5.2.0",

View File

@ -185,6 +185,7 @@ module.exports = {
request: Object.assign(_.clone(context.request), {
graphql: null,
}),
response: _.clone(context.response),
});
// Execute policies stack.

View File

@ -246,6 +246,7 @@ module.exports = {
request: Object.assign(_.clone(context.request), {
graphql: null,
}),
response: _.clone(context.response),
});
// Note: we've to used the Object.defineProperties to reset the prototype. It seems that the cloning the context

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-upload",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "This is the description of the plugin.",
"strapi": {
"name": "Files Upload",
@ -23,9 +23,9 @@
"react-router-dom": "^5.0.0",
"react-transition-group": "^2.5.0",
"reactstrap": "^5.0.0",
"strapi-helper-plugin": "3.0.0-beta.18.6",
"strapi-provider-upload-local": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6",
"strapi-helper-plugin": "3.0.0-beta.18.7",
"strapi-provider-upload-local": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7",
"stream-to-array": "^2.3.0",
"uuid": "^3.2.1"
},

View File

@ -1,6 +1,6 @@
{
"name": "strapi-plugin-users-permissions",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Protect your API with a full-authentication process based on JWT",
"strapi": {
"name": "Roles & Permissions",
@ -32,8 +32,8 @@
"reactstrap": "^5.0.0",
"redux-saga": "^0.16.0",
"request": "^2.83.0",
"strapi-helper-plugin": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6",
"strapi-helper-plugin": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7",
"uuid": "^3.1.0"
},
"devDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-amazon-ses",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Amazon SES provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-mailgun",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Mailgun provider for strapi email plugin",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-sendgrid",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Sendgrid provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-email-sendmail",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Sendmail provider for strapi email",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-aws-s3",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "AWS S3 provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-cloudinary",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Cloudinary provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-local",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Local provider for strapi upload",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi-provider-upload-rackspace",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Rackspace provider for strapi upload",
"main": "./lib",
"keywords": [],

View File

@ -1,6 +1,6 @@
{
"name": "strapi-utils",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "Shared utilities for the Strapi packages",
"homepage": "http://strapi.io",
"keywords": [

View File

@ -1,6 +1,6 @@
{
"name": "strapi",
"version": "3.0.0-beta.18.6",
"version": "3.0.0-beta.18.7",
"description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite",
"homepage": "http://strapi.io",
"directories": {
@ -50,16 +50,16 @@
"resolve-cwd": "^3.0.0",
"rimraf": "^2.6.2",
"shelljs": "^0.8.3",
"strapi-database": "3.0.0-beta.18.6",
"strapi-generate": "3.0.0-beta.18.6",
"strapi-generate-api": "3.0.0-beta.18.6",
"strapi-generate-controller": "3.0.0-beta.18.6",
"strapi-generate-model": "3.0.0-beta.18.6",
"strapi-generate-new": "3.0.0-beta.18.6",
"strapi-generate-plugin": "3.0.0-beta.18.6",
"strapi-generate-policy": "3.0.0-beta.18.6",
"strapi-generate-service": "3.0.0-beta.18.6",
"strapi-utils": "3.0.0-beta.18.6"
"strapi-database": "3.0.0-beta.18.7",
"strapi-generate": "3.0.0-beta.18.7",
"strapi-generate-api": "3.0.0-beta.18.7",
"strapi-generate-controller": "3.0.0-beta.18.7",
"strapi-generate-model": "3.0.0-beta.18.7",
"strapi-generate-new": "3.0.0-beta.18.7",
"strapi-generate-plugin": "3.0.0-beta.18.7",
"strapi-generate-policy": "3.0.0-beta.18.7",
"strapi-generate-service": "3.0.0-beta.18.7",
"strapi-utils": "3.0.0-beta.18.7"
},
"scripts": {
"postinstall": "node lib/utils/success.js"