Use displayName in ctb menu and listview header

Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
soupette 2021-10-21 09:50:29 +02:00
parent 3ad3432a67
commit fe5b80f236
2 changed files with 5 additions and 2 deletions

View File

@ -133,7 +133,7 @@ const sortContentType = types =>
.map(uid => ({ .map(uid => ({
visible: types[uid].schema.visible, visible: types[uid].schema.visible,
name: uid, name: uid,
title: types[uid].schema.name, title: types[uid].schema.displayName,
plugin: types[uid].plugin || null, plugin: types[uid].plugin || null,
uid, uid,
to: `/plugins/${pluginId}/content-types/${uid}`, to: `/plugins/${pluginId}/content-types/${uid}`,

View File

@ -80,7 +80,10 @@ const ListView = () => {
}); });
}; };
let label = get(modifiedData, [firstMainDataPath, 'schema', 'name'], ''); // TODO: fixme
let label = isInContentTypeView
? get(modifiedData, [firstMainDataPath, 'schema', 'displayName'], '')
: get(modifiedData, [firstMainDataPath, 'schema', 'name'], '');
const kind = get(modifiedData, [firstMainDataPath, 'schema', 'kind'], ''); const kind = get(modifiedData, [firstMainDataPath, 'schema', 'kind'], '');
const isCreatingFirstContentType = match?.params.currentUID === 'create-content-type'; const isCreatingFirstContentType = match?.params.currentUID === 'create-content-type';