-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3191 from navikt/duplisere-tiltak
FEAT: Mulighet for å duplisere tiltak
- Loading branch information
Showing
9 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ | |
display: flex; | ||
justify-content: flex-start; | ||
gap: 1.5rem; | ||
align-items: center; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
frontend/mr-admin-flate/src/components/tiltaksgjennomforinger/DupliserTiltak.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.button { | ||
background-color: var(--a-surface-action); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
max-height: 2rem; | ||
max-width: 2rem; | ||
} |
48 changes: 48 additions & 0 deletions
48
frontend/mr-admin-flate/src/components/tiltaksgjennomforinger/DupliserTiltak.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { LayersPlusIcon } from "@navikt/aksel-icons"; | ||
import styles from "./DupliserTiltak.module.scss"; | ||
import { Button } from "@navikt/ds-react"; | ||
import { Tiltaksgjennomforing, Toggles } from "mulighetsrommet-api-client"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { useFeatureToggle } from "../../api/features/feature-toggles"; | ||
|
||
interface Props { | ||
tiltaksgjennomforing: Tiltaksgjennomforing; | ||
} | ||
|
||
export function DupliserTiltak({ tiltaksgjennomforing }: Props) { | ||
const navigate = useNavigate(); | ||
const { data: kanDuplisereTiltak } = useFeatureToggle( | ||
Toggles.MR_ADMIN_FLATE_KAN_DUPLISERE_TILTAK, | ||
); | ||
|
||
if (!kanDuplisereTiltak) return null; | ||
|
||
function apneRedigeringForDupliseringAvTiltak() { | ||
navigate(`/tiltaksgjennomforinger/${tiltaksgjennomforing.id}/skjema`, { | ||
state: { | ||
tiltaksgjennomforing: { | ||
...tiltaksgjennomforing, | ||
id: window.crypto.randomUUID(), | ||
tiltaksnummer: "", | ||
startDato: undefined, | ||
sluttDato: undefined, | ||
}, | ||
}, | ||
}); | ||
} | ||
|
||
return ( | ||
<Button | ||
title="Dupliser tiltaksgjennomføring" | ||
className={styles.button} | ||
onClick={apneRedigeringForDupliseringAvTiltak} | ||
> | ||
<LayersPlusIcon | ||
style={{ margin: "0 auto", display: "block" }} | ||
color="white" | ||
fontSize="1.5rem" | ||
aria-label="Ikon for duplisering av dokument" | ||
/> | ||
</Button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters