mirror of
https://github.com/strapi/strapi.git
synced 2025-08-18 13:45:25 +00:00
Merge branch 'master' into fix/#4868
This commit is contained in:
commit
5e358d4549
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -3,7 +3,6 @@
|
||||
## ⏳ Installation
|
||||
|
||||
```bash
|
||||
cd plugins/upload
|
||||
npm i --save strapi-provider-upload-cloudinary
|
||||
````
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user