From beba4cb91b08290cf0527674ebc6c093f7042d6e Mon Sep 17 00:00:00 2001 From: jasquat Date: Wed, 3 May 2023 09:08:25 -0400 Subject: [PATCH] use hyphens instead of parenthesis for process model search --- .../src/components/ProcessModelSearch.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx b/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx index 9f5b7245..b19b1cb6 100644 --- a/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx +++ b/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx @@ -33,9 +33,14 @@ export default function ProcessModelSearch({ const getProcessModelLabelForDisplay = (processModel: ProcessModel) => { let processModelId = processModel.id; if (truncateProcessModelDisplayName) { - processModelId = processModelId.split('/').slice(-2).join('/'); + let processModelIdArray = processModelId.split('/'); + if (processModelIdArray.length > 2) { + processModelIdArray = processModelIdArray.slice(-2); + processModelIdArray.unshift('...'); + } + processModelId = processModelIdArray.join('/'); } - return `${processModel.display_name} (${processModelId})`; + return `${processModel.display_name} - ${processModelId}`; }; const getProcessModelLabelForSearch = (processModel: ProcessModel) => {