[9382][FRONT]: Compute highlighted object view using raw name plural (#9394)
# Introduction Please find related ticket here #9382 To fix the issue the solution seems to be to stop searching for last viewed `objectMetadata` using their slugged version `namePlural` ## Upcoming cleanup After discussing with @charlesBochet it seems like a bad practice to slug the `objectMetadata`, in this way in a following PR we will suggest a cleanup of the remaining method that does within the `useFilteredObjectMetadataItems.ts` ## Conclusion As always any suggestions are welcomed ! Please let me know closes #9382 --------- Co-authored-by: Paul Rastoin <paulrastoin@Pauls-MacBook-Pro.local>
This commit is contained in:
@ -38,6 +38,12 @@ export const useFilteredObjectMetadataItems = () => {
|
||||
getObjectSlug(activeObjectMetadataItem) === slug,
|
||||
);
|
||||
|
||||
const findActiveObjectMetadataItemByNamePlural = (namePlural: string) =>
|
||||
activeObjectMetadataItems.find(
|
||||
(activeObjectMetadataItem) =>
|
||||
activeObjectMetadataItem.namePlural === namePlural,
|
||||
);
|
||||
|
||||
const findObjectMetadataItemById = (id: string) =>
|
||||
objectMetadataItems.find(
|
||||
(objectMetadataItem) => objectMetadataItem.id === id,
|
||||
@ -53,6 +59,7 @@ export const useFilteredObjectMetadataItems = () => {
|
||||
findActiveObjectMetadataItemBySlug,
|
||||
findObjectMetadataItemById,
|
||||
findObjectMetadataItemByNamePlural,
|
||||
findActiveObjectMetadataItemByNamePlural,
|
||||
inactiveObjectMetadataItems,
|
||||
objectMetadataItems,
|
||||
findObjectMetadataItemBySlug,
|
||||
|
||||
Reference in New Issue
Block a user