mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Fix ctb button link for components
This commit is contained in:
parent
ee9af6c0d3
commit
d0952e5188
@ -403,7 +403,7 @@ const EditSettingsView = ({
|
||||
slug,
|
||||
emitEvent,
|
||||
push,
|
||||
{ componentSlug, type }
|
||||
{ componentSlug, type, modifiedData }
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
"components.TableEmpty.withoutFilter": "There is no {contentType}...",
|
||||
|
||||
"containers.Edit.addAnItem": "Add an item...",
|
||||
"containers.Edit.pluginHeader.title.new": "Create an Entry",
|
||||
"containers.Edit.pluginHeader.title.new": "Create an entry",
|
||||
"containers.Edit.clickToJump": "Click to jump to the entry",
|
||||
"containers.Edit.delete": "Delete",
|
||||
"containers.Edit.editing": "Editing...",
|
||||
|
||||
@ -16,7 +16,7 @@ import getTrad from '../../utils/getTrad';
|
||||
function EditViewButton(props) {
|
||||
const { formatMessage } = useGlobalContext();
|
||||
// Retrieve URL from props
|
||||
const { componentSlug, type } = get(
|
||||
const { modifiedData, componentSlug, type } = get(
|
||||
props,
|
||||
['viewProps', '0'],
|
||||
|
||||
@ -28,16 +28,12 @@ function EditViewButton(props) {
|
||||
const baseUrl = `/plugins/content-type-builder/${
|
||||
type === 'content-types' ? type : 'component-categories'
|
||||
}`;
|
||||
let splitted = [];
|
||||
|
||||
if (componentSlug) {
|
||||
splitted = componentSlug.split('.');
|
||||
}
|
||||
const category = get(modifiedData, 'category', '');
|
||||
|
||||
const suffixUrl =
|
||||
type === 'content-types'
|
||||
? props.getModelName()
|
||||
: `${splitted[0]}/${componentSlug}`;
|
||||
: `${category}/${componentSlug}`;
|
||||
|
||||
const handleClick = () => {
|
||||
props.push(`${baseUrl}/${suffixUrl}`);
|
||||
@ -3,7 +3,7 @@ import pluginPkg from '../../package.json';
|
||||
import App from './containers/App';
|
||||
import Initializer from './containers/Initializer';
|
||||
import Link from './InjectedComponents/ContentManager/EditViewLink';
|
||||
import Button from './InjectedComponents/ContentManager/EditViewButton';
|
||||
import Button from './InjectedComponents/ContentManager/EditSettingViewButton';
|
||||
import lifecycles from './lifecycles';
|
||||
import trads from './translations';
|
||||
import pluginId from './pluginId';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user