Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
matsbyfl committed Feb 16, 2024
2 parents ccfaaa5 + ecacd33 commit ea6ede4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/src/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Lenke = styled.a`
`

export const Toppmeny: React.FC = () => {
const { erInnlogget, enheter, ...rest } = useInnloggetSaksbehandler()
const { erInnlogget, enhetsnumre, ...rest } = useInnloggetSaksbehandler()
const saksbehandler = erInnlogget ? rest : { navn: '', navIdent: '' }
const { setFodselsnummer } = usePersonContext()
const navigate = useNavigate()
Expand Down
2 changes: 1 addition & 1 deletion client/src/mocks/data/SaksbehandlerStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function lagSaksbehandler(saksbehandler: Partial<InnloggetSaksbehandler>): Innlo
epost: '',
navIdent: '',
grupper: [Gruppe.HOTSAK_BRUKERE, Gruppe.BRILLEADMIN_BRUKERE],
enheter: ['2970', '4710', '4711'],
enhetsnumre: ['2970', '4710', '4711'],
erInnlogget: true,
...saksbehandler,
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/state/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface InnloggetSaksbehandler {
epost: string
navIdent: string
grupper: Gruppe[]
enheter: string[]
enhetsnumre: string[]
erInnlogget?: boolean
}

Expand All @@ -34,20 +34,20 @@ const innloggetSaksbehandlerState = atom<InnloggetSaksbehandler>({
epost: '',
navIdent: '',
grupper: [],
enheter: [],
enhetsnumre: [],
erInnlogget: undefined,
},
})

const visOppgavelisteTabsState = selector<boolean>({
key: 'VisOppgavelisteTabs',
get: ({ get }) => {
const { grupper, enheter } = get(innloggetSaksbehandlerState)
const { grupper, enhetsnumre } = get(innloggetSaksbehandlerState)
return (
window.appSettings.MILJO !== 'prod-gcp' ||
grupper.includes(Gruppe.TEAMDIGIHOT) ||
grupper.includes(Gruppe.BRILLEADMIN_BRUKERE) ||
enheter.includes(Enhet.NAV_VIKAFOSSEN)
enhetsnumre.includes(Enhet.NAV_VIKAFOSSEN)
)
},
})
Expand Down

0 comments on commit ea6ede4

Please sign in to comment.