-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Janzz-element for å søke opp janz-stilling * Deploy to dev * Bytt ut styrk-felt med janzz * Manglet PAM_ONTOLOGI_URL * pam-ontologi-kall krever Nav-CallId * crypto ikke tilgjengelig, men det er uuid * Sjekk melding fra azure om hvorfor det er feil * Må lese ut av body * Må lese ut av body * Må lese ut av body * Må lese ut av body * Må lese ut av body * Må lese ut av body * Må lese ut av body * Kall til pam-ontologi ser ikke ut til å kreve token * Kallet skal være en GET, ikke en delete * pam-ontologi må være i outbound for service-discovery * Lagre Janzz i stilling i stedet for styrk * Feil i adValidationReducer.ts * Fjern Styrk-referanser * Mangler css * Feil i referanse til css-fil * Initiell verdi på stilling * bygg-feil på grunn av mock * Legg til lokal mocking av pam-ontologi * categoryList skal være en array, ikke en objekt * Dispatch bare endring på categoryList om ny yrkestittel er valgt * Fiks mock * Les tittel-felt istedet for styrkEllerTittel * Bruk tittel-felt hvis tilgjengelig * Default mocktittel på stilling * Bruk tittel-felt alltid * Fjern styrkEllerTittel til fordel for det nye tittel-feltet * fiks metode for å hente tittel, skal ikke ha default verdi * Janzz felt skal kunne tømmes helt * Janzz felt skal ikke under opprettelse ha stilling uten valgt jobbtittel * Janzz felt skal ikke under opprettelse ha stilling uten valgt jobbtittel * Legg på validering på janzz-feltet * Legg på validering av janzz med feilmelding * Bytt til combobox * Fiks feil med at ingenting kan skrives inn * Prøv med typeahead for yrke på første bokstav * Refactor løsning * Sett til minimum to bokstaver i yrkestypeahead * Lag use metode for janzz titler * Fiks url mot ontologi * Fiks url ontologi * Legg på headers slik at vi kan kalle arbeidsplassen for janzz kall * Se om det går fint uten å sende unndefined janzz ved sletting av ykestittel * FIlterer bort jobbmessetittel, og legg på påkrevd label for yrkestittel * Legg inn nyhetssak for yrkestittel * Legg til filteroptions --------- Co-authored-by: Joar Aurdal <[email protected]>
- Loading branch information
Showing
33 changed files
with
264 additions
and
749 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { pamOntologiMockMsw } from './pamOntologi'; | ||
|
||
export const pamOntologiMock = [pamOntologiMockMsw]; |
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,37 @@ | ||
/** | ||
* Endepunkt /statistikk | ||
*/ | ||
import { HttpResponse, http } from 'msw'; | ||
import { z } from 'zod'; | ||
|
||
export const pamOntologiEndepunkt = `/pam-ontologi/rest/typeahead/stilling*`; | ||
|
||
const janzzKategoriDTOSchema = z.object({ | ||
konseptId: z.number(), | ||
styrk08: z.string(), | ||
esco: z.string(), | ||
escoLabel: z.string(), | ||
label: z.string(), | ||
undertype: z.string(), | ||
}); | ||
|
||
export type janzzKategoriDTO = z.infer<typeof janzzKategoriDTOSchema>; | ||
|
||
const janzzKategoriMock = (): janzzKategoriDTO[] | null => { | ||
return [ | ||
{ | ||
konseptId: 358507, | ||
styrk08: '1112', | ||
esco: 'http://data.europa.eu/esco/isco/C1112', | ||
escoLabel: 'Toppledere i offentlig administrasjon', | ||
label: 'Departementsråd', | ||
undertype: '', | ||
}, | ||
]; | ||
}; | ||
|
||
export const pamOntologiMockMsw = http.get(pamOntologiEndepunkt, ({ request }) => { | ||
const janzzKategorier = janzzKategoriMock(); | ||
|
||
return HttpResponse.json(janzzKategorier); | ||
}); |
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,36 @@ | ||
import useSWR from 'swr'; | ||
import { getAPIwithSchema } from '../fetcher'; | ||
import { z } from 'zod'; | ||
import { api } from 'felles/api'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
export const hentJanzzYrkerEndepunkt = `${api.pamOntologi}/rest/typeahead/stilling`; | ||
|
||
export const janzzStillingSchema = z.object({ | ||
label: z.string(), | ||
konseptId: z.number(), | ||
styrk08: z.any().optional(), | ||
esco: z.any().optional(), | ||
escoLabel: z.any().optional(), | ||
undertype: z.any().optional(), | ||
}); | ||
|
||
const hentJanzzYrkerSchema = z.array(janzzStillingSchema); | ||
|
||
export type JanzzStillingDTO = z.infer<typeof janzzStillingSchema>; | ||
export type HentJanzzYrkerDTO = z.infer<typeof hentJanzzYrkerSchema>; | ||
|
||
export const useHentJanzzYrker = (query: string) => { | ||
const shouldFetch = query.length > 1; | ||
const endpoint = shouldFetch | ||
? `${hentJanzzYrkerEndepunkt}?stillingstittel=${encodeURIComponent(query)}` | ||
: null; | ||
|
||
const headers = { | ||
'X-Requested-With': 'XMLHttpRequest', | ||
'Cache-Control': 'no-cache, no-store', | ||
'Nav-CallId': uuidv4(), | ||
}; | ||
|
||
return useSWR(endpoint, getAPIwithSchema(hentJanzzYrkerSchema, headers)); | ||
}; |
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
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
Oops, something went wrong.