Skip to content

Commit

Permalink
Rettet opp i hht kommentarer på review
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Jan 24, 2024
1 parent ce28e39 commit 31951fa
Showing 1 changed file with 23 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="miljo-velger">
Expand Down Expand Up @@ -114,35 +111,28 @@ export const MiljoVelger = ({
}
}

return order.map((type) => {
const category = filteredEnvironments[type]
if (!category) {
return null
}

return (
<fieldset key={type} name={`Liste over ${type}-miljøer`}>
<StyledH3>Miljøer </StyledH3>
<div className="miljo-velger_checkboxes">
{category.map((env) => (
<DollyCheckbox
key={env.id}
id={env.id}
disabled={
env.disabled ||
(disableAllEnvironments && values.length < 1) ||
alleredeValgtMiljoe.some((miljoe) => miljoe === env.id)
}
label={env?.id?.toUpperCase()}
checked={values.includes(env.id)}
onClick={onClick}
size={'small'}
/>
))}
</div>
</fieldset>
)
})
return (
<fieldset name={`Liste over miljøer`}>
<StyledH3>Miljøer </StyledH3>
<div className="miljo-velger_checkboxes">
{filteredEnvironments.map((env) => (
<DollyCheckbox
key={env.id}
id={env.id}
disabled={
env.disabled ||
(disableAllEnvironments && values.length < 1) ||
alleredeValgtMiljoe.some((miljoe) => miljoe === env.id)
}
label={env?.id?.toUpperCase()}
checked={values.includes(env.id)}
onClick={onClick}
size={'small'}
/>
))}
</div>
</fieldset>
)
}}
</FieldArray>

Expand Down

0 comments on commit 31951fa

Please sign in to comment.