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

Commit

Permalink
Merge pull request #237 from navikt/fjerne_jobbkompetanseendepunkt
Browse files Browse the repository at this point in the history
Fjern jobbsokerkompetanse-kallet
  • Loading branch information
Mathiamu authored Nov 1, 2021
2 parents ce02605 + 4c58c11 commit 43dee17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,52 +1,7 @@
import React from 'react';
import { useAppStore } from '../../../../stores/app-store';
import SistEndret from '../../../felles/sist-endret';
import Grid from '../../../felles/grid';
import InformasjonsbolkPunktliste from '../../../felles/informasjonsbolk-punktliste';
import Informasjonsbolk from '../../../felles/informasjonsbolk';
import { safeMap } from '../../../../utils';
import { RaadVisning } from './raad-visning';
import { useFetchJobbsokerkompetanse } from '../../../../rest/api';
import { Feilmelding, Laster, NoData } from '../../../felles/fetch';
import { isPending, hasError } from '@nutgaard/use-fetch';
import { hasData } from '../../../../rest/utils';
import { NoData } from '../../../felles/fetch';

const JobbsokerkompetansePanelInnhold = () => {
const { fnr } = useAppStore();
const jobbsokerkompetanse = useFetchJobbsokerkompetanse(fnr);

if (isPending(jobbsokerkompetanse)) {
return <Laster midtstilt={true} />;
} else if (hasError(jobbsokerkompetanse)) {
return <Feilmelding />;
} else if (!hasData(jobbsokerkompetanse)) {
return <NoData />;
}

const { besvarelseDato, kulepunkter, raad } = jobbsokerkompetanse.data;
const kulepunktListe = kulepunkter.map(punkt => punkt.kulepunkt);

const raadliste = safeMap(raad, (rad, index) => (
<li key={index}>
<RaadVisning raad={rad} />
</li>
));

return (
<>
<SistEndret sistEndret={besvarelseDato} onlyYearAndMonth={false} />
<Grid columns={1} gap="0rem">
<InformasjonsbolkPunktliste
header="Dette gjør du bra"
list={kulepunktListe}
className="jobbsokerkompetanse__punktliste"
/>
<Informasjonsbolk header="Dette kan du gjøre bedre" className="jobbsokerkompetanse__raadliste">
<ul>{raadliste}</ul>
</Informasjonsbolk>
</Grid>
</>
);
return <NoData />;
};

export default JobbsokerkompetansePanelInnhold;
29 changes: 16 additions & 13 deletions src/rest/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { ArenaPerson } from './datatyper/arenaperson';
import { VeilederData } from './datatyper/veileder';
import { AktorId } from './datatyper/aktor-id';
import { OppfolgingsstatusData } from './datatyper/oppfolgingsstatus';
import { KartleggingData } from './datatyper/kartlegging';
import { YtelseData } from './datatyper/ytelse';
import { UnderOppfolgingData } from './datatyper/underOppfolgingData';
import { OrNothing } from '../utils/felles-typer';
import { PersonaliaV2Info } from './datatyper/personaliav2';
import { TOGGLES, Features } from './datatyper/feature';
import { VergeOgFullmaktData} from "./datatyper/vergeOgFullmakt";
import { TilrettelagtKommunikasjonData} from "./datatyper/tilrettelagtKommunikasjon";
import { VergeOgFullmaktData } from './datatyper/vergeOgFullmakt';
import { TilrettelagtKommunikasjonData } from './datatyper/tilrettelagtKommunikasjon';
import { Innsatsbehov } from './datatyper/innsatsbehov';
import { APP_NAME } from '../utils/konstanter';

Expand All @@ -23,31 +22,35 @@ const headers = {
export const useFetchRegistrering = (fnr: string) =>
useFetch<RegistreringsData>(`/veilarbregistrering/api/registrering?fnr=${fnr}`, headers);

export const useFetchCvOgJobbprofil = (fnr: string) => useFetch<ArenaPerson>(`/veilarbperson/api/person/cv_jobbprofil?fnr=${fnr}`);
export const useFetchCvOgJobbprofil = (fnr: string) =>
useFetch<ArenaPerson>(`/veilarbperson/api/person/cv_jobbprofil?fnr=${fnr}`);

export const useFetchVeileder = (veilederId: OrNothing<string>, config?: Config) =>
useFetch<VeilederData>(`/veilarbveileder/api/veileder/${veilederId}`, headers, config);

export const useFetchAktorId = (fnr: string) => useFetch<AktorId>(`/veilarbperson/api/person/aktorid?fnr=${fnr}`, headers);
export const useFetchAktorId = (fnr: string) =>
useFetch<AktorId>(`/veilarbperson/api/person/aktorid?fnr=${fnr}`, headers);

export const useFetchOppfolgingsstatus = (fnr: string) =>
useFetch<OppfolgingsstatusData>(`/veilarboppfolging/api/person/${fnr}/oppfolgingsstatus`, headers);

export const useFetchJobbsokerkompetanse = (fnr: string) =>
useFetch<KartleggingData>(`/veilarbjobbsokerkompetanse/api/hent?fnr=${fnr}`, headers);

export const useFetchYtelser = (fnr: string) => useFetch<YtelseData>(`/veilarboppfolging/api/person/${fnr}/ytelser`, headers);
export const useFetchYtelser = (fnr: string) =>
useFetch<YtelseData>(`/veilarboppfolging/api/person/${fnr}/ytelser`, headers);

export const useFetchUnderOppfolging = (fnr: string) =>
useFetch<UnderOppfolgingData>(`/veilarboppfolging/api/underoppfolging?fnr=${fnr}`, headers);

export const useFetchPersonalia = (fnr: string) => useFetch<PersonaliaInfo>(`/veilarbperson/api/person/${fnr}`, headers);
export const useFetchPersonalia = (fnr: string) =>
useFetch<PersonaliaInfo>(`/veilarbperson/api/person/${fnr}`, headers);

export const useFetchPersonaliaV2 = (fnr: string) => useFetch<PersonaliaV2Info>(`/veilarbperson/api/v2/person?fnr=${fnr}`, headers);
export const useFetchPersonaliaV2 = (fnr: string) =>
useFetch<PersonaliaV2Info>(`/veilarbperson/api/v2/person?fnr=${fnr}`, headers);

export const useFetchVergOgFullmakt = (fnr: string) => useFetch<VergeOgFullmaktData>(`/veilarbperson/api/v2/person/vergeOgFullmakt?fnr=${fnr}`, headers);
export const useFetchVergOgFullmakt = (fnr: string) =>
useFetch<VergeOgFullmaktData>(`/veilarbperson/api/v2/person/vergeOgFullmakt?fnr=${fnr}`, headers);

export const useFetchSpraakTolk = (fnr: string) => useFetch<TilrettelagtKommunikasjonData>(`/veilarbperson/api/v2/person/tolk?fnr=${fnr}`, headers);
export const useFetchSpraakTolk = (fnr: string) =>
useFetch<TilrettelagtKommunikasjonData>(`/veilarbperson/api/v2/person/tolk?fnr=${fnr}`, headers);

export const useFetchInnsatsbehov = (fnr: string) =>
useFetch<Innsatsbehov>(`/veilarbvedtaksstotte/api/innsatsbehov?fnr=${fnr}`, headers);
Expand Down

0 comments on commit 43dee17

Please sign in to comment.