From 58941331dce53f4177ad184baab2ea8e7a4271b1 Mon Sep 17 00:00:00 2001 From: Mathias Oppedal Heggelund <98742460+mheggelund@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:47:16 +0200 Subject: [PATCH] feat: Add mouthbar as option for compute object. (#299) --- .../CaseCardComponent/FormattedMethodNames.tsx | 2 ++ src/features/Compute/CaseGroup/CaseGroup.tsx | 17 ++++++++++++----- .../Compute/CaseGroup/CaseRow/CaseRow.tsx | 13 +++++++++++++ .../CaseGroup/CaseRow/hooks/useSetSaved.tsx | 3 +++ .../Compute/ComputeObject/ComputeObject.tsx | 17 +++++++++++++---- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/components/CaseCardComponent/FormattedMethodNames.tsx b/src/components/CaseCardComponent/FormattedMethodNames.tsx index 140291ec..c974fabd 100644 --- a/src/components/CaseCardComponent/FormattedMethodNames.tsx +++ b/src/components/CaseCardComponent/FormattedMethodNames.tsx @@ -1,4 +1,6 @@ export const titleMapping: Record = { + Channel: 'Channel', + Mouthbar: 'Mouthbar', Indicator: 'Indicator', 'Net-To-Gross': 'Net-to-gross', ContiniousParameter: 'Continious parameter', diff --git a/src/features/Compute/CaseGroup/CaseGroup.tsx b/src/features/Compute/CaseGroup/CaseGroup.tsx index 712d6c15..e66854c0 100644 --- a/src/features/Compute/CaseGroup/CaseGroup.tsx +++ b/src/features/Compute/CaseGroup/CaseGroup.tsx @@ -137,7 +137,10 @@ export const CaseGroup = ({ const setListItem = (methodType: string, newCase: ComputeCaseDto) => { const filteredList = filerLocalList(methodType); - if (methodType === 'Channel' && filteredList.length < 1) { + if ( + (methodType === 'Channel' || methodType === 'Mouthbar') && + filteredList.length < 1 + ) { setLocalList([...localList, newCase]); } else if ( methodType !== 'Channel' && @@ -325,7 +328,7 @@ export const CaseGroup = ({ return ( <> - {methodName === 'Channel' && ( + {(methodName === 'Channel' || methodName === 'Mouthbar') && (