Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into override_legacy-peer-deps
  • Loading branch information
Wiklem committed Aug 2, 2023
2 parents 2886653 + b428e70 commit 4c7172a
Show file tree
Hide file tree
Showing 17 changed files with 367 additions and 283 deletions.
3 changes: 0 additions & 3 deletions deploy/dev-gcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
"modiaContextHolderHost": "modiacontextholder-q0.dev-fss-pub.nais.io",

"statistikkApiUrl": "https://rekrutteringsbistand-statistikk-api.dev-fss-pub.nais.io/rekrutteringsbistand-statistikk-api",
"stillingssokProxyUrl": "http://rekrutteringsbistand-stillingssok-proxy",
"stillingApiUrl": "http://rekrutteringsbistand-stilling-api",
"kandidatApiUrl": "https://rekrutteringsbistand-kandidat-api.dev-fss-pub.nais.io/rekrutteringsbistand-kandidat-api/rest",
"smsApi": "https://rekrutteringsbistand-sms.dev-fss-pub.nais.io/rekrutteringsbistand-sms/sms",
"foresporselOmDelingAvCvApi": "https://foresporsel-om-deling-av-cv-api.dev-fss-pub.nais.io",
"synlighetsmotorApi": "http://toi-synlighetsmotor",
"modiaContextHolderApi": "https://modiacontextholder-q0.dev-fss-pub.nais.io/modiacontextholder"
}
9 changes: 6 additions & 3 deletions deploy/nais.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ spec:
- application: rekrutteringsbistand-stilling-api
- application: rekrutteringsbistand-stillingssok-proxy
- application: toi-synlighetsmotor
- application: presenterte-kandidater-api
external:
- host: {{ statistikkApiHost }}
- host: {{ smsApiHost }}
Expand All @@ -56,16 +57,18 @@ spec:
- name: STATISTIKK_API_URL
value: {{ statistikkApiUrl }}
- name: STILLINGSSOK_PROXY_URL
value: {{ stillingssokProxyUrl }}
value: http://rekrutteringsbistand-stillingssok-proxy
- name: STILLING_API_URL
value: {{ stillingApiUrl }}
value: http://rekrutteringsbistand-stilling-api
- name: KANDIDAT_API_URL
value: {{ kandidatApiUrl }}
- name: SMS_API
value: {{ smsApi }}
- name: FORESPORSEL_OM_DELING_AV_CV_API
value: {{ foresporselOmDelingAvCvApi }}
- name: SYNLIGHETSMOTOR_API
value: {{ synlighetsmotorApi }}
value: http://toi-synlighetsmotor
- name: PRESENTERTE_KANDIDATER_API
value: http://presenterte-kandidater-api
- name: MODIA_CONTEXT_HOLDER_API
value: {{ modiaContextHolderApi }}
3 changes: 0 additions & 3 deletions deploy/prod-gcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
"modiaContextHolderHost": "modiacontextholder.prod-fss-pub.nais.io",

"statistikkApiUrl": "https://rekrutteringsbistand-statistikk-api.prod-fss-pub.nais.io/rekrutteringsbistand-statistikk-api",
"stillingssokProxyUrl": "http://rekrutteringsbistand-stillingssok-proxy",
"stillingApiUrl": "http://rekrutteringsbistand-stilling-api",
"kandidatApiUrl": "https://rekrutteringsbistand-kandidat-api.prod-fss-pub.nais.io/rekrutteringsbistand-kandidat-api/rest",
"smsApi": "https://rekrutteringsbistand-sms.prod-fss-pub.nais.io/rekrutteringsbistand-sms/sms",
"foresporselOmDelingAvCvApi": "https://foresporsel-om-deling-av-cv-api.prod-fss-pub.nais.io",
"synlighetsmotorApi": "http://toi-synlighetsmotor",
"modiaContextHolderApi": "https://modiacontextholder.prod-fss-pub.nais.io/modiacontextholder"
}
115 changes: 67 additions & 48 deletions mock/kandidatsok-proxy/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,73 @@ import { api } from '../../src/felles/api';
import { Innsatsgruppe } from 'felles/domene/kandidat/Oppfølgingsinformasjon';

export const kandidatsøkMock = [
rest.post(api.kandidatsøk, (_, res, ctx) => {
const respons: Respons = {
_shards: {
total: 0,
failed: 0,
skipped: 0,
successful: 0,
},
took: 23,
timed_out: false,
hits: {
total: {
value: 1,
relation: 'eq',
},
max_score: 1,
hits: [
{
_id: '',
_index: '',
_score: 1,
_type: '',
_source: {
aktorId: '123',
arenaKandidatnr: 'AB123456',
fornavn: 'Joar',
etternavn: 'Giil',
fodselsnummer: '01010101006',
geografiJobbonsker: [
{
geografiKodeTekst: 'Geiranger',
geografiKode: '1000',
},
],
kvalifiseringsgruppekode: Innsatsgruppe.SituasjonsbestemtInnsats,
yrkeJobbonskerObj: [
{
primaertJobbonske: true,
sokeTitler: [],
styrkBeskrivelse: 'Gartner',
styrkKode: '01',
},
],
},
},
],
},
};
rest.post(api.kandidatsøk, async (req, res, ctx) => {
const respons: Respons = (await req.text()).includes('09043826678')
? {
took: 1,
timed_out: false,
_shards: {
total: 3,
successful: 3,
skipped: 0,
failed: 0,
},
hits: {
total: {
value: 0,
relation: 'eq',
},
max_score: null,
hits: [],
},
}
: {
_shards: {
total: 0,
failed: 0,
skipped: 0,
successful: 0,
},
took: 23,
timed_out: false,
hits: {
total: {
value: 1,
relation: 'eq',
},
max_score: 1,
hits: [
{
_id: '',
_index: '',
_score: 1,
_type: '',
_source: {
aktorId: '123',
arenaKandidatnr: 'AB123456',
fornavn: 'Joar',
etternavn: 'Giil',
fodselsnummer: '01010101006',
geografiJobbonsker: [
{
geografiKodeTekst: 'Geiranger',
geografiKode: '1000',
},
],
kvalifiseringsgruppekode: Innsatsgruppe.SituasjonsbestemtInnsats,
yrkeJobbonskerObj: [
{
primaertJobbonske: true,
sokeTitler: [],
styrkBeskrivelse: 'Gartner',
styrkKode: '01',
},
],
},
},
],
},
};

return res(ctx.json(respons));
}),
Expand Down
15 changes: 15 additions & 0 deletions mock/presenterte-kandidater-api/mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { rest } from 'msw';
import { api } from '../../src/felles/api';

export const presenterteKandidaterApiMock = [
rest.get(
`${api.presenterteKandidaterApi}/kandidatliste/:stillingsId/vurdering`,
(_, res, ctx) => res(ctx.json(mockArbeidsgiversVurderinger))
),
];
const mockArbeidsgiversVurderinger: any = [
{
aktørId: '123',
vurdering: 'abc',
},
];
2 changes: 2 additions & 0 deletions mock/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { forespørselOmDelingAvCvMock } from './foresporsel-om-deling-av-cv-api/
import { statistikkApiMock } from './statistikk-api/mock';
import { stillingApiMock } from './stilling-api/mock';
import { stillingssøkMock } from './stillingssok-proxy/mock';
import { presenterteKandidaterApiMock } from './presenterte-kandidater-api/mock';

const handlers = [
...innloggetBrukerMock,
Expand All @@ -17,6 +18,7 @@ const handlers = [
...(import.meta.env.VITE_MOCK_MODIA ? modiaContextHolderMock : []),
...(import.meta.env.VITE_MOCK_AIVEN ? kandidatsøkMock : []),
...(import.meta.env.VITE_MOCK_AIVEN ? stillingssøkMock : []),
...presenterteKandidaterApiMock,
];

const worker = setupWorker(...handlers);
Expand Down
8 changes: 7 additions & 1 deletion server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const scopes = {
sms: `api://${clusterOnPrem}.toi.rekrutteringsbistand-sms/.default`,
forespørselOmDelingAvCv: `api://${clusterOnPrem}.arbeidsgiver-inkludering.foresporsel-om-deling-av-cv-api/.default`,
synlighetsmotor: `api://${cluster}.toi.toi-synlighetsmotor/.default`,
presenterteKandidater: `api://${cluster}.toi.presenterte-kandidater-api/.default`,
};

const {
Expand All @@ -36,6 +37,7 @@ const {
SMS_API,
FORESPORSEL_OM_DELING_AV_CV_API,
SYNLIGHETSMOTOR_API,
PRESENTERTE_KANDIDATER_API,
OPEN_SEARCH_URI,
OPEN_SEARCH_USERNAME,
OPEN_SEARCH_PASSWORD,
Expand All @@ -62,7 +64,11 @@ const startServer = () => {
scopes.forespørselOmDelingAvCv
);
proxyMedOboToken('/synlighet-api', SYNLIGHETSMOTOR_API, scopes.synlighetsmotor);

proxyMedOboToken(
'/presenterte-kandidater-api',
PRESENTERTE_KANDIDATER_API,
scopes.presenterteKandidater
);
proxyTilKandidatsøkEs(
'/kandidatsok-proxy',
OPEN_SEARCH_URI,
Expand Down
1 change: 1 addition & 0 deletions src/felles/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const api = {
kandidat: '/kandidat-api',
kandidatsøk: '/kandidatsok-proxy',
forespørselOmDelingAvCv: '/foresporsel-om-deling-av-cv-api',
presenterteKandidaterApi: '/presenterte-kandidater-api',
};

export const videresendTilInnlogging = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.forklaring {
margin: 1.5rem 0;
}

.forklaring ul {
margin-bottom: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Synlighetsevaluering, {
KravTilKandidaten,
KravTilVeileder,
} from 'felles/domene/synlighet/Synlighetsevaluering';
import css from './LeggTilKandidat.module.css';
import css from './KandidatenFinnesIkke.module.css';

type Props = {
synlighetsevaluering: Synlighetsevaluering;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
.forklaring {
margin: 1.5rem 0;
}

.forklaring ul {
margin-bottom: 0;
}

.notat {
margin-top: 2rem;
min-height: 10rem;
Expand Down
26 changes: 26 additions & 0 deletions src/kandidat/kandidatliste/Kandidatliste.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import FeilVedSendingAvForespørsel from './feil-ved-sending-av-forespørsel/Fei
import { Search } from '@navikt/ds-react';
import css from './Kandidatliste.module.css';
import { Kandidatstatus } from 'felles/domene/kandidatliste/KandidatIKandidatliste';
import { api } from 'felles/api';

type Props = {
kandidatliste: Kandidatlistetype;
Expand All @@ -65,6 +66,31 @@ const Kandidatliste: FunctionComponent<Props> = ({
onToggleMarkert,
onToggleArkivert,
}) => {
useEffect(() => {
const hentArbeidsgiversVurderinger = async (stillingId: string) => {
try {
const respons = await fetch(
`${api.presenterteKandidaterApi}/kandidatliste/${stillingId}/vurdering`,
{
method: 'GET',
headers: { 'Content-Type': 'application/json' },
}
);
const vurderingerJson = await respons.json();
console.log(
'Arbeidsgivers vurderinger: ',
vurderingerJson,
JSON.stringify(vurderingerJson)
);
} catch (e) {
console.log('Kall mot arbeidsgivers vurderinger feilet: ' + e);
}
};
if (kandidatliste.stillingId !== null) {
hentArbeidsgiversVurderinger(kandidatliste.stillingId);
}
}, [kandidatliste.stillingId]);

useMaskerFødselsnumre();
useHentSendteMeldinger(kandidatliste.kandidatlisteId);
useHentForespørslerOmDelingAvCv(kandidatliste.stillingId);
Expand Down
11 changes: 4 additions & 7 deletions src/kandidat/kandidatside/cv/CvSide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { useSelector } from 'react-redux';

import { Nettstatus } from 'felles/nettressurs';
import AppState from '../../state/AppState';
import Jobbprofil from './jobbprofil/Jobbprofil';
import KandidatCv from './cv/Cv';
import Cv from './cv/Cv';
import IkkeFunnet from './ikke-funnet/IkkeFunnet';
import Sidelaster from '../../komponenter/sidelaster/Sidelaster';
import Jobbprofil from './jobbprofil/Jobbprofil';
import Sidefeil from '../../komponenter/sidefeil/Sidefeil';
import Sidelaster from '../../komponenter/sidelaster/Sidelaster';
import css from './CvSide.module.css';

const CvSide: FunctionComponent = () => {
Expand All @@ -25,10 +25,7 @@ const CvSide: FunctionComponent = () => {
return (
<div className={css.side}>
<Jobbprofil cv={cv.data} />
<KandidatCv cv={cv.data} />
{/*cv.data.tilretteleggingsbehov && (
<KandidatTilretteleggingsbehov fnr={cv.data.fodselsnummer} />
)*/}
<Cv cv={cv.data} />
</div>
);
}
Expand Down
Loading

0 comments on commit 4c7172a

Please sign in to comment.