Skip to content

Commit

Permalink
Vis logg ut i prod for admin-flate og fjern debug-toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
sndrem committed Dec 3, 2024
1 parent 8780fae commit e137964
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import { useHentAnsatt } from "@/api/ansatt/useHentAnsatt";
import { useFeatureToggle } from "@/api/features/useFeatureToggle";
import { ExternalLinkIcon, MenuGridIcon } from "@navikt/aksel-icons";
import { Dropdown, InternalHeader, Spacer } from "@navikt/ds-react";
import { Toggles } from "@mr/api-client";
import { InlineErrorBoundary } from "@mr/frontend-common";
import { useRef } from "react";
import { Link } from "react-router-dom";
import {
ENDRINGSMELDINGER_URL,
LOGOUT_AND_SELECT_ACCOUNT_URL,
PREVIEW_ARBEIDSMARKEDSTILTAK_URL,
SANITY_STUDIO_URL,
} from "@/constants";
import { InlineErrorBoundary } from "@mr/frontend-common";
import { ExternalLinkIcon, MenuGridIcon } from "@navikt/aksel-icons";
import { Dropdown, InternalHeader, Spacer } from "@navikt/ds-react";
import { useRef } from "react";
import { Link } from "react-router-dom";
import { Notifikasjonsbjelle } from "../notifikasjoner/Notifikasjonsbjelle";
import styles from "./AdministratorHeader.module.scss";

export function AdministratorHeader() {
const { data: debugIsEnabled } = useFeatureToggle(
Toggles.MULIGHETSROMMET_ADMIN_FLATE_ENABLE_DEBUGGER,
);

const tiltakstyperLinkRef = useRef<HTMLAnchorElement>(null);
const avtalerLinkRef = useRef<HTMLAnchorElement>(null);
const gjennomforingerLinkRef = useRef<HTMLAnchorElement>(null);
Expand Down Expand Up @@ -136,18 +130,16 @@ export function AdministratorHeader() {
</Link>
</Dropdown.Menu.GroupedList.Item>
</Dropdown.Menu.GroupedList>
{debugIsEnabled ? (
<>
<Dropdown.Menu.Divider />
<Dropdown.Menu.List>
<Dropdown.Menu.List.Item as="span" onClick={() => logoutLinkRef.current?.click()}>
<a ref={logoutLinkRef} href={LOGOUT_AND_SELECT_ACCOUNT_URL}>
Logg ut
</a>
</Dropdown.Menu.List.Item>
</Dropdown.Menu.List>
</>
) : null}
<>
<Dropdown.Menu.Divider />
<Dropdown.Menu.List>
<Dropdown.Menu.List.Item as="span" onClick={() => logoutLinkRef.current?.click()}>
<a ref={logoutLinkRef} href={LOGOUT_AND_SELECT_ACCOUNT_URL}>
Logg ut
</a>
</Dropdown.Menu.List.Item>
</Dropdown.Menu.List>
</>
</Dropdown.Menu>
<InlineErrorBoundary>
<Brukernavn />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Features } from "@/api/features/useFeatureToggle";
import { Toggles } from "@mr/api-client";

const mockFeatures: Features = {
[Toggles.MULIGHETSROMMET_ADMIN_FLATE_ENABLE_DEBUGGER]: true,
[Toggles.MULIGHETSROMMET_ADMIN_FLATE_OPPRETT_TILSAGN]: true,
[Toggles.MULIGHETSROMMET_VEILEDERFLATE_VIS_TILBAKEMELDING]: true,
[Toggles.MULIGHETSROMMET_TILTAKSTYPE_MIGRERING_DELTAKER]: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Features } from "@/api/feature-toggles";
import { Toggles } from "@mr/api-client";

const mockFeatures: Features = {
[Toggles.MULIGHETSROMMET_ADMIN_FLATE_ENABLE_DEBUGGER]: true,
[Toggles.MULIGHETSROMMET_ADMIN_FLATE_OPPRETT_TILSAGN]: true,
[Toggles.MULIGHETSROMMET_VEILEDERFLATE_VIS_TILBAKEMELDING]: true,
[Toggles.MULIGHETSROMMET_TILTAKSTYPE_MIGRERING_DELTAKER]: true,
Expand Down
1 change: 0 additions & 1 deletion mulighetsrommet-api/src/main/resources/web/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4153,7 +4153,6 @@ components:
type: string
enum:
- mulighetsrommet-veilederflate.vis-tilbakemelding
- mulighetsrommet.admin-flate.enableDebugger
- mulighetsrommet.admin-flate.opprett-tilsagn
- mulighetsrommet.tiltakstype.migrering.deltaker
- mulighetsrommet.tiltakstype.pamelding-info-komet
Expand Down

0 comments on commit e137964

Please sign in to comment.