mirror of
https://github.com/hexastack/hexabot
synced 2024-11-28 06:52:20 +00:00
fix(frontend): add contentEntity normalization logic
This commit is contained in:
parent
d169bdbe92
commit
b3426e3f50
@ -165,8 +165,8 @@ export const Contents = () => {
|
|||||||
field: "entity",
|
field: "entity",
|
||||||
headerName: t("label.entity"),
|
headerName: t("label.entity"),
|
||||||
flex: 1,
|
flex: 1,
|
||||||
valueGetter: (row: IContent) => {
|
valueGetter: (entityId) => {
|
||||||
const contentType = getEntityFromCache(row.id);
|
const contentType = getEntityFromCache(entityId);
|
||||||
|
|
||||||
return contentType?.name;
|
return contentType?.name;
|
||||||
},
|
},
|
||||||
|
@ -164,10 +164,14 @@ export const ContentTypeEntity = new schema.Entity(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export const ContentEntity = new schema.Entity(EntityType.CONTENT, undefined, {
|
export const ContentEntity = new schema.Entity(
|
||||||
|
EntityType.CONTENT,
|
||||||
|
{ entity: ContentTypeEntity },
|
||||||
|
{
|
||||||
idAttribute: ({ id }) => id,
|
idAttribute: ({ id }) => id,
|
||||||
processStrategy: processCommonStrategy,
|
processStrategy: processCommonStrategy,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
export const SettingEntity = new schema.Entity(EntityType.SETTING, {
|
export const SettingEntity = new schema.Entity(EntityType.SETTING, {
|
||||||
idAttribute: ({ id }) => id,
|
idAttribute: ({ id }) => id,
|
||||||
|
Loading…
Reference in New Issue
Block a user