mirror of
https://github.com/strapi/strapi.git
synced 2025-08-13 03:07:32 +00:00
parent
27c3cf7a91
commit
a9c9549458
@ -144,6 +144,7 @@ export class Admin extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<GlobalContextProvider
|
<GlobalContextProvider
|
||||||
|
autoReload={this.props.global.autoReload}
|
||||||
emitEvent={this.props.emitEvent}
|
emitEvent={this.props.emitEvent}
|
||||||
currentEnvironment={this.props.global.currentEnvironment}
|
currentEnvironment={this.props.global.currentEnvironment}
|
||||||
disableGlobalOverlayBlocker={this.props.disableGlobalOverlayBlocker}
|
disableGlobalOverlayBlocker={this.props.disableGlobalOverlayBlocker}
|
||||||
@ -216,6 +217,7 @@ Admin.propTypes = {
|
|||||||
emitEvent: PropTypes.func.isRequired,
|
emitEvent: PropTypes.func.isRequired,
|
||||||
enableGlobalOverlayBlocker: PropTypes.func.isRequired,
|
enableGlobalOverlayBlocker: PropTypes.func.isRequired,
|
||||||
global: PropTypes.shape({
|
global: PropTypes.shape({
|
||||||
|
autoReload: PropTypes.bool,
|
||||||
blockApp: PropTypes.bool,
|
blockApp: PropTypes.bool,
|
||||||
currentEnvironment: PropTypes.string,
|
currentEnvironment: PropTypes.string,
|
||||||
overlayBlockerData: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
overlayBlockerData: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
||||||
|
@ -38,6 +38,7 @@ const DataManagerProvider = ({ allIcons, children }) => {
|
|||||||
const [reducerState, dispatch] = useReducer(reducer, initialState, init);
|
const [reducerState, dispatch] = useReducer(reducer, initialState, init);
|
||||||
const [infoModals, toggleInfoModal] = useState({ cancel: false });
|
const [infoModals, toggleInfoModal] = useState({ cancel: false });
|
||||||
const {
|
const {
|
||||||
|
autoReload,
|
||||||
currentEnvironment,
|
currentEnvironment,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
formatMessage,
|
formatMessage,
|
||||||
@ -59,7 +60,10 @@ const DataManagerProvider = ({ allIcons, children }) => {
|
|||||||
const componentMatch = useRouteMatch(
|
const componentMatch = useRouteMatch(
|
||||||
`/plugins/${pluginId}/component-categories/:categoryUid/:componentUid`
|
`/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 isInContentTypeView = contentTypeMatch !== null;
|
||||||
const firstKeyToMainSchema = isInContentTypeView
|
const firstKeyToMainSchema = isInContentTypeView
|
||||||
@ -120,6 +124,16 @@ const DataManagerProvider = ({ allIcons, children }) => {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [isLoading, pathname]);
|
}, [isLoading, pathname]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (currentEnvironment === 'development' && !autoReload) {
|
||||||
|
strapi.notification.info(
|
||||||
|
formatMessageRef.current({
|
||||||
|
id: getTrad('notification.info.autoreaload-disable'),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [autoReload, currentEnvironment]);
|
||||||
|
|
||||||
const didModifiedComponents =
|
const didModifiedComponents =
|
||||||
getCreatedAndModifiedComponents(modifiedData.components || {}, components)
|
getCreatedAndModifiedComponents(modifiedData.components || {}, components)
|
||||||
.length > 0;
|
.length > 0;
|
||||||
|
@ -132,6 +132,7 @@
|
|||||||
"modelPage.attribute.relationWith": "Relation with",
|
"modelPage.attribute.relationWith": "Relation with",
|
||||||
"modelPage.contentHeader.emptyDescription.description": "There is no description",
|
"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.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.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.",
|
"plugin.description.short": "Modelize the data structure of your API.",
|
||||||
"popUpForm.navContainer.advanced": "Advanced settings",
|
"popUpForm.navContainer.advanced": "Advanced settings",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user