Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Oppsett for manuell reaktivering
Browse files Browse the repository at this point in the history
  • Loading branch information
robertkittilsen committed Aug 29, 2023
1 parent 04824f7 commit 5249b07
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/demo/setup-demo-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
DAGPENGER_STATUS,
ANTATT_INAKTIVERINGSGRUNN,
REAKTIVERING_URL,
FULLFOER_REAKTIVERING_URL,
} from '../ducks/api';

import {
Expand Down Expand Up @@ -174,6 +175,9 @@ export const demo_handlers = [

rest.get(REAKTIVERING_URL, reaktiveringGetResolver),
rest.post(REAKTIVERING_URL, reaktiveringPostResolver),
rest.post(FULLFOER_REAKTIVERING_URL, (req, res, ctx) => {
return res(ctx.status(200));
}),

rest.post('https://amplitude.nav.no/collect', (req, res, ctx) => {
return res(ctx.status(200));
Expand Down
3 changes: 2 additions & 1 deletion src/ducks/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ export const AIA_BACKEND = aiaBackendUrl,
BEHOV_FOR_VEILEDNING_URL = `${AIA_BACKEND}/behov-for-veiledning`,
DAGPENGER_STATUS = `${AIA_BACKEND}/dagpenger-status`,
ANTATT_INAKTIVERINGSGRUNN = `${AIA_BACKEND}/data/meldekort-inaktivering`,
REAKTIVERING_URL = `${AIA_BACKEND}/reaktivering`;
REAKTIVERING_URL = `${AIA_BACKEND}/reaktivering`,
FULLFOER_REAKTIVERING_URL = `${AIA_BACKEND}/fullfoerreaktivering`;
17 changes: 10 additions & 7 deletions src/komponenter/reaktivering/reaktivering-aktuelt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import { useMeldeplikt } from '../../contexts/meldeplikt';
import ErRendret from '../er-rendret/er-rendret';
import InViewport from '../in-viewport/in-viewport';
import { loggAktivitet } from '../../metrics/metrics';
import { dialogLenke, reaktiveringLenke } from '../../innhold/lenker';
import { dialogLenke } from '../../innhold/lenker';
import SisteMeldekortVidereRegistrertValg from './siste-meldekort-videre-registrert-valg';

import styles from '../../innhold/innhold.module.css';
import spacingStyles from '../../spacing.module.css';
import { fetchToJson } from '../../ducks/api-utils';
import { FULLFOER_REAKTIVERING_URL, requestConfig } from '../../ducks/api';

interface Props {
handleIkkeReaktivering: (event: React.SyntheticEvent) => void;
Expand All @@ -23,16 +25,17 @@ const ReaktiveringAktuelt = (props: Props) => {

const { handleIkkeReaktivering } = props;

const handleReaktivering = (aktivitet: string) => {
loggAktivitet({ aktivitet: aktivitet, ...amplitudeData });
window.location.assign(reaktiveringLenke);
};

const handleDialog = (aktivitet: string) => {
loggAktivitet({ aktivitet: aktivitet, ...amplitudeData });
window.location.assign(dialogLenke);
};

const fullfoerReaktivering = async () =>
await fetchToJson(FULLFOER_REAKTIVERING_URL, {
...requestConfig(),
method: 'POST',
});

return (
<section className={`${styles.limit} ${spacingStyles.blokkM}`}>
<ErRendret loggTekst="Rendrer tema: kan reaktiveres" />
Expand All @@ -43,7 +46,7 @@ const ReaktiveringAktuelt = (props: Props) => {
<div>
<SisteMeldekortVidereRegistrertValg meldeplikt={meldeplikt} />
<BodyShort className={spacingStyles.blokkS}>
<Button variant="primary" onClick={() => handleReaktivering('Går til reaktivering')}>
<Button variant="primary" onClick={fullfoerReaktivering}>
Registrer deg som arbeidssøker
</Button>
</BodyShort>
Expand Down

0 comments on commit 5249b07

Please sign in to comment.