[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:
Paul Rastoin
2025-01-07 15:20:54 +01:00
committed by GitHub
parent 04f648f7f3
commit 7b70f7d93b
2 changed files with 10 additions and 3 deletions

View File

@ -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,