Merge branch 'master' into fix/#4868

This commit is contained in:
Alexandre BODIN 2020-01-06 09:55:45 +01:00 committed by GitHub
commit 5e358d4549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 11 deletions

View File

@ -56,6 +56,10 @@ You can access to any controllers, services or models thanks to the global varia
To apply policies to a route, you need to associate an array of policies to it. There are two kinds of policies: global or scoped.
::: warning
To apply policies with GraphQL please see the [following guide](../plugins/graphql.md#execute-a-policy-before-a-resolver)
:::
### Global policies
The global policies can be associated to any routes in your project.

View File

@ -14,7 +14,7 @@ import getTrad from '../../utils/getTrad';
// Create link from content-type-builder to content-manager
function EditViewButton(props) {
const { emitEvent, formatMessage } = useGlobalContext();
const { currentEnvironment, emitEvent, formatMessage } = useGlobalContext();
// Retrieve URL from props
const { modifiedData, componentSlug, type } = get(
props,
@ -41,6 +41,10 @@ function EditViewButton(props) {
props.push(`${baseUrl}/${suffixUrl}`);
};
if (currentEnvironment !== 'development') {
return null;
}
if (props.getModelName() === 'strapi::administrator') {
return null;
}

View File

@ -10,10 +10,14 @@ import { LiLink, useGlobalContext } from 'strapi-helper-plugin';
// Create link from content-type-builder to content-manager
function EditViewLink(props) {
const { emitEvent } = useGlobalContext();
const { currentEnvironment, emitEvent } = useGlobalContext();
// Retrieve URL from props
const url = `/plugins/content-type-builder/content-types/${props.getModelName()}`;
if (currentEnvironment !== 'development') {
return null;
}
if (props.getModelName() === 'strapi::administrator') {
return null;
}

View File

@ -1,14 +1,21 @@
const JS_BUILT_IN_OBJECTS = [
'object',
'function',
'boolean',
'symbol',
'error',
'infinity',
'number',
'math',
'date',
'error',
'function',
'infinity',
'map',
'math',
'number',
'object',
'symbol',
];
const RESERVED_NAMES = [
'admin',
'series',
'file',
'news',
...JS_BUILT_IN_OBJECTS,
];
const RESERVED_NAMES = ['admin', 'series', 'file', ...JS_BUILT_IN_OBJECTS];
export default RESERVED_NAMES;

View File

@ -3,7 +3,6 @@
## ⏳ Installation
```bash
cd plugins/upload
npm i --save strapi-provider-upload-cloudinary
````