From ad0193cc65e636b042f5db2fd3170f87a9068ff1 Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Tue, 30 May 2023 12:32:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20the=20`appWorkingGroup`=20?= =?UTF-8?q?opening=20links=20(#4388)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the `appWorkingGroup` opening links --- packages/ui/src/working-groups/model/workingGroupName.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/working-groups/model/workingGroupName.ts b/packages/ui/src/working-groups/model/workingGroupName.ts index 9c770ee935..190ab84957 100644 --- a/packages/ui/src/working-groups/model/workingGroupName.ts +++ b/packages/ui/src/working-groups/model/workingGroupName.ts @@ -1,3 +1,5 @@ +import { GroupIdToGroupParam } from '../constants' + const exceptionWorkingGroupNames = ['hr', 'marketing', 'builders', 'apps'] export const urlParamToWorkingGroupId = (name: string) => { @@ -21,8 +23,7 @@ export const urlParamToWorkingGroupId = (name: string) => { export const groupNameToURLParam = (name: string) => name.toLowerCase().replace(/ /g, '-') -export const urlParamToOpeningId = (name: string) => { - if (name.includes('operationsWorkingGroup')) return name - const params = name.split('-') - return `${urlParamToWorkingGroupId(params[0])}-${params[1]}` +export const urlParamToOpeningId = (param: string) => { + const [group, runtimeId] = param.split('-') + return group in GroupIdToGroupParam ? param : `${urlParamToWorkingGroupId(group)}-${runtimeId}` }