From 31951fa06a3196d050e31a95eee6cf527826929d Mon Sep 17 00:00:00 2001 From: kristenhaerum Date: Wed, 24 Jan 2024 15:48:48 +0100 Subject: [PATCH] =?UTF-8?q?Rettet=20opp=20i=20hht=20kommentarer=20p=C3=A5?= =?UTF-8?q?=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/miljoVelger/MiljoVelger.tsx | 56 ++++++++----------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/miljoVelger/MiljoVelger.tsx b/apps/dolly-frontend/src/main/js/src/components/miljoVelger/MiljoVelger.tsx index 92a2325ce61..c43eeecf39c 100644 --- a/apps/dolly-frontend/src/main/js/src/components/miljoVelger/MiljoVelger.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/miljoVelger/MiljoVelger.tsx @@ -77,14 +77,11 @@ export const MiljoVelger = ({ if (tilgjengeligMiljo === 'q2') return bankIdQ2 return bankIdQ1 } - return { - Q: miljoer.Q.filter((env) => env.id !== 'qx'), - } + return miljoer.Q.filter((env: any) => env.id !== 'qx') } const disableAllEnvironments = erMiljouavhengig(bestillingsdata) const filteredEnvironments = filterEnvironments(dollyEnvironments, bankIdBruker) - const order = ['Q'] return (
@@ -114,35 +111,28 @@ export const MiljoVelger = ({ } } - return order.map((type) => { - const category = filteredEnvironments[type] - if (!category) { - return null - } - - return ( -
- Miljøer -
- {category.map((env) => ( - miljoe === env.id) - } - label={env?.id?.toUpperCase()} - checked={values.includes(env.id)} - onClick={onClick} - size={'small'} - /> - ))} -
-
- ) - }) + return ( +
+ Miljøer +
+ {filteredEnvironments.map((env) => ( + miljoe === env.id) + } + label={env?.id?.toUpperCase()} + checked={values.includes(env.id)} + onClick={onClick} + size={'small'} + /> + ))} +
+
+ ) }}