From 06772857327d97e39d79958d0a06cc41d09ec804 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 3 Mar 2025 15:29:19 +0100 Subject: [PATCH] front: fix MacroEditorState.getPathKeys() when missing secondary code getPathKey() (right above) produces different keys when an OP is missing a secondary code: it omits the "/code" suffix. Do the same here so that positions don't get lost for these OPs. Signed-off-by: Simon Ser --- .../components/MacroEditor/MacroEditorState.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/applications/operationalStudies/components/MacroEditor/MacroEditorState.ts b/front/src/applications/operationalStudies/components/MacroEditor/MacroEditorState.ts index 9455ce930f9..792369bc82d 100644 --- a/front/src/applications/operationalStudies/components/MacroEditor/MacroEditorState.ts +++ b/front/src/applications/operationalStudies/components/MacroEditor/MacroEditorState.ts @@ -224,8 +224,8 @@ export default class MacroEditorState { static getPathKeys(item: SearchResultItemOperationalPoint): string[] { const result = []; result.push(`op_id:${item.obj_id}`); - result.push(`trigram:${item.trigram}/${item.ch}`); - result.push(`uic:${item.uic}/${item.ch}`); + result.push(`trigram:${item.trigram}${item.ch ? `/${item.ch}` : ''}`); + result.push(`uic:${item.uic}${item.ch ? `/${item.ch}` : ''}`); item.track_sections.forEach((ts) => { result.push(`track_offset:${ts.track}+${ts.position}`); });