mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 08:46:42 +00:00
parent
b3be6dea99
commit
99dfd24eaf
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useMemo, useState } from 'react';
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { Prompt, useHistory, useLocation } from 'react-router-dom';
|
import { Prompt, useHistory, useLocation } from 'react-router-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { get, has, isEqual } from 'lodash';
|
import { get, has, isEqual } from 'lodash';
|
||||||
@ -255,7 +255,7 @@ const ListView = () => {
|
|||||||
handleClickAddField(forTarget, targetUid, headerDisplayObject);
|
handleClickAddField(forTarget, targetUid, headerDisplayObject);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const goToCMSettingsPage = () => {
|
const goToCMSettingsPage = useCallback(() => {
|
||||||
const endPoint = isInContentTypeView
|
const endPoint = isInContentTypeView
|
||||||
? `/plugins/content-manager/${contentTypeKind}/${targetUid}/ctm-configurations/edit-settings/content-types`
|
? `/plugins/content-manager/${contentTypeKind}/${targetUid}/ctm-configurations/edit-settings/content-types`
|
||||||
: `/plugins/content-manager/ctm-configurations/edit-settings/components/${targetUid}/`;
|
: `/plugins/content-manager/ctm-configurations/edit-settings/components/${targetUid}/`;
|
||||||
@ -263,7 +263,7 @@ const ListView = () => {
|
|||||||
if (!isTemporary) {
|
if (!isTemporary) {
|
||||||
push(endPoint);
|
push(endPoint);
|
||||||
}
|
}
|
||||||
};
|
}, [contentTypeKind, isInContentTypeView, isTemporary, push, targetUid]);
|
||||||
|
|
||||||
const listInjectedComponents = useMemo(() => {
|
const listInjectedComponents = useMemo(() => {
|
||||||
return getComponents('listView', 'list.link', plugins, {
|
return getComponents('listView', 'list.link', plugins, {
|
||||||
@ -272,8 +272,7 @@ const ListView = () => {
|
|||||||
isInContentTypeView,
|
isInContentTypeView,
|
||||||
contentTypeKind,
|
contentTypeKind,
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
}, [plugins, goToCMSettingsPage, isTemporary, isInContentTypeView, contentTypeKind]);
|
||||||
}, [isTemporary, isInContentTypeView, contentTypeKind]);
|
|
||||||
|
|
||||||
const listActions = isInDevelopmentMode
|
const listActions = isInDevelopmentMode
|
||||||
? [...listInjectedComponents, <ListButton {...addButtonProps} key="add-button" />]
|
? [...listInjectedComponents, <ListButton {...addButtonProps} key="add-button" />]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user