diff --git a/src/felles/amplitude.ts b/src/felles/amplitude.ts index 822dbac4..b856e05f 100644 --- a/src/felles/amplitude.ts +++ b/src/felles/amplitude.ts @@ -1,8 +1,6 @@ import amplitudeJs, { AmplitudeClient } from 'amplitude-js'; import { Miljø, getMiljø } from './miljø'; -const SEND_EVENTS = true; - export enum AmplitudeEvent { Sidevisning = 'sidevisning', Navigere = 'navigere', @@ -23,7 +21,7 @@ export const setNavKontorForAmplitude = (navKontor: string) => { }; export const sendEvent = (område: string, hendelse: string, data?: Object) => { - if (import.meta.env.PROD && SEND_EVENTS) { + if (import.meta.env.PROD) { client.logEvent(['#rekrutteringsbistand', område, hendelse].join('-'), data); } }; @@ -32,7 +30,7 @@ export const sendGenerellEvent = ( event: AmplitudeEvent | string, properties: Record ): Promise => { - if (import.meta.env.PROD && SEND_EVENTS) { + if (import.meta.env.PROD) { const eventProperties = { app: 'rekrutteringsbistand', ...properties, diff --git a/src/forside/Forside.tsx b/src/forside/Forside.tsx index fec1eb9c..c96c978d 100644 --- a/src/forside/Forside.tsx +++ b/src/forside/Forside.tsx @@ -1,7 +1,7 @@ import { Loader } from '@navikt/ds-react'; import Hurtiglenker from './hurtiglenker/Hurtiglenker'; import css from './Forside.module.css'; -import useNavKontor from '../felles/store/navKontor'; +import useNavKontor from 'felles/store/navKontor'; import Statistikk from './statistikk/Statistikk'; const Forside = () => { diff --git a/src/forside/statistikk/useSvarstatistikk.ts b/src/forside/statistikk/useSvarstatistikk.ts index b9f8b8b2..f808f48f 100644 --- a/src/forside/statistikk/useSvarstatistikk.ts +++ b/src/forside/statistikk/useSvarstatistikk.ts @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; +import { api, videresendTilInnlogging } from 'felles/api'; import { formaterDatoTilApi } from './datoUtils'; -import { Nettressurs } from '../../felles/nettressurs'; -import { api, videresendTilInnlogging } from '../../felles/api'; +import { Nettressurs } from 'felles/nettressurs'; export type Svarstatistikk = { antallSvartJa: number; diff --git a/src/forside/statistikk/useUtfallsstatistikk.ts b/src/forside/statistikk/useUtfallsstatistikk.ts index 9ba4a616..f07cf5bb 100644 --- a/src/forside/statistikk/useUtfallsstatistikk.ts +++ b/src/forside/statistikk/useUtfallsstatistikk.ts @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; import { formaterDatoTilApi } from './datoUtils'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; type AntallFormidlingerInboundDto = { antallPresentert: number; diff --git a/src/header/Header.tsx b/src/header/Header.tsx index c08515e6..d03c0c3b 100644 --- a/src/header/Header.tsx +++ b/src/header/Header.tsx @@ -1,7 +1,7 @@ import { Outlet } from 'react-router-dom'; import Modiadekoratør from './modiadekoratør/Modiadekoratør'; import Navigeringsmeny from './navigeringsmeny/Navigeringsmeny'; -import useNavKontor from '../felles/store/navKontor'; +import useNavKontor from 'felles/store/navKontor'; import useAmplitude from './useAmplitude'; import Placeholder from './modiadekoratør/Placeholder'; diff --git a/src/header/useAmplitude.ts b/src/header/useAmplitude.ts index cac8b383..2be6ffdc 100644 --- a/src/header/useAmplitude.ts +++ b/src/header/useAmplitude.ts @@ -4,7 +4,7 @@ import { sendGenerellEvent, AmplitudeEvent, sendEvent, -} from '../felles/amplitude'; +} from 'felles/amplitude'; import { generaliserPath } from './utils/path'; import { useLocation } from 'react-router-dom'; diff --git a/src/kandidat/api/api.ts b/src/kandidat/api/api.ts index 921f071f..a911216b 100644 --- a/src/kandidat/api/api.ts +++ b/src/kandidat/api/api.ts @@ -6,7 +6,7 @@ import { FormidlingAvUsynligKandidatOutboundDto } from '../felles/legg-til-kandi import { MineKandidatlister } from '../kandidatside/fraSøkUtenKontekst/lagre-kandidat-modal/useMineKandidatlister'; import { KandidatlisteDto } from '../kandidatlisteoversikt/modaler/Kandidatlisteskjema'; import Cv from '../cv/reducer/cv-typer'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; export const ENHETSREGISTER_API = `/${api.stilling}/search-api`; diff --git a/src/kandidat/api/fetchUtils.ts b/src/kandidat/api/fetchUtils.ts index 9a7db2fc..d462f41e 100644 --- a/src/kandidat/api/fetchUtils.ts +++ b/src/kandidat/api/fetchUtils.ts @@ -1,9 +1,9 @@ -import { videresendTilInnlogging } from '../../felles/api'; +import { videresendTilInnlogging } from 'felles/api'; import { lenkeTilTilgangsside } from '../app/paths'; import { feil, Nettressurs, suksess } from './Nettressurs'; export const createCallIdHeader = () => ({ - 'Nav-CallId': Math.random().toString(16).substr(2), + 'Nav-CallId': Math.random().toString(16).substring(2), }); export class SearchApiError { diff --git "a/src/kandidat/api/foresp\303\270rselOmDelingAvCvApi.ts" "b/src/kandidat/api/foresp\303\270rselOmDelingAvCvApi.ts" index 1e3d48f8..87dc697c 100644 --- "a/src/kandidat/api/foresp\303\270rselOmDelingAvCvApi.ts" +++ "b/src/kandidat/api/foresp\303\270rselOmDelingAvCvApi.ts" @@ -5,7 +5,7 @@ import { } from '../kandidatliste/knappe-rad/forespørsel-om-deling-av-cv/Forespørsel'; import { fetchJson, postJson } from './fetchUtils'; import { AktørId } from '../kandidatliste/domene/Kandidat'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; export type ForespørslerForStillingInboundDto = Partial>; diff --git a/src/kandidat/app/KandidatApp.tsx b/src/kandidat/app/KandidatApp.tsx index 84d0d926..108a49f8 100644 --- a/src/kandidat/app/KandidatApp.tsx +++ b/src/kandidat/app/KandidatApp.tsx @@ -13,7 +13,7 @@ import Kandidatside from '../kandidatside/Kandidatside'; import ManglerTilgang from './ManglerTilgang'; import NotFound from '../komponenter/errorside/NotFound'; import store from '../state/reduxStore'; -import useNavKontor from '../../felles/store/navKontor'; +import useNavKontor from 'felles/store/navKontor'; import Varsling from '../varsling/Varsling'; import css from './KandidatApp.module.css'; diff --git a/src/kandidat/felles/legg-til-kandidat-modal/api.ts b/src/kandidat/felles/legg-til-kandidat-modal/api.ts index 4feb1c10..3833e20d 100644 --- a/src/kandidat/felles/legg-til-kandidat-modal/api.ts +++ b/src/kandidat/felles/legg-til-kandidat-modal/api.ts @@ -1,4 +1,4 @@ -import { api } from '../../../felles/api'; +import { api } from 'felles/api'; import { Nettressurs, Nettstatus } from '../../api/Nettressurs'; import { SearchApiError, postHeaders } from '../../api/fetchUtils'; import { Synlighetsevaluering } from './kandidaten-finnes-ikke/Synlighetsevaluering'; diff --git a/src/kandidat/mock/mock-api.ts b/src/kandidat/mock/mock-api.ts index d150045b..8a210818 100644 --- a/src/kandidat/mock/mock-api.ts +++ b/src/kandidat/mock/mock-api.ts @@ -5,7 +5,7 @@ import { Kandidatutfall } from '../kandidatliste/domene/Kandidat'; import { mock } from './mock-data'; import { meg } from './data/kandidat/veileder.mock'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; import { ENHETSREGISTER_API } from '../api/api'; fetchMock.config.fallbackToNetwork = true; diff --git a/src/kandidatsok/App.tsx b/src/kandidatsok/App.tsx index 76149fd4..7cd3fe7f 100644 --- a/src/kandidatsok/App.tsx +++ b/src/kandidatsok/App.tsx @@ -4,7 +4,7 @@ import useKontekstAvKandidatlisteEllerStilling from './hooks/useKontekstAvKandid import useNavigeringsstate from './hooks/useNavigeringsstate'; import { ØktContext, ØktContextProvider } from './Økt'; import Kandidatsøk from './Kandidatsøk'; -import useNavKontor from '../felles/store/navKontor'; +import useNavKontor from 'felles/store/navKontor'; import '@reach/combobox/styles.css'; const App = () => { diff --git a/src/kandidatsok/api/api.ts b/src/kandidatsok/api/api.ts index 2abf9c94..68849988 100644 --- a/src/kandidatsok/api/api.ts +++ b/src/kandidatsok/api/api.ts @@ -9,7 +9,7 @@ import { import { Kandidatliste, Stilling } from '../hooks/useKontekstAvKandidatlisteEllerStilling'; import { LagreKandidaterDto } from '../kandidatliste/LagreKandidaterIMineKandidatlisterModal'; import { MineKandidatlister } from '../kandidatliste/useMineKandidatlister'; -import { api, videresendTilInnlogging } from '../../felles/api'; +import { api, videresendTilInnlogging } from 'felles/api'; export const søk = async (query: SearchQuery): Promise => { const respons = await post(api.kandidatsøk, query); diff --git "a/src/kandidatsok/api/query/m\303\245lQuery.ts" "b/src/kandidatsok/api/query/m\303\245lQuery.ts" index 9ddbee13..614a0931 100644 --- "a/src/kandidatsok/api/query/m\303\245lQuery.ts" +++ "b/src/kandidatsok/api/query/m\303\245lQuery.ts" @@ -1,4 +1,4 @@ -import { sendEvent } from '../../../felles/amplitude'; +import { sendEvent } from 'felles/amplitude'; import { Portefølje } from '../../filter/porteføljetabs/PorteføljeTabs'; import { Søkekriterier } from '../../hooks/useSøkekriterier'; diff --git a/src/kandidatsok/hooks/useBrukerensIdent.ts b/src/kandidatsok/hooks/useBrukerensIdent.ts index 9510f8a1..a56cd2d6 100644 --- a/src/kandidatsok/hooks/useBrukerensIdent.ts +++ b/src/kandidatsok/hooks/useBrukerensIdent.ts @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; import { get } from '../api/api'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; export type InnloggetBruker = { navIdent: string | null; diff --git a/src/kandidatsok/kandidater/sortering/Sortering.tsx b/src/kandidatsok/kandidater/sortering/Sortering.tsx index 4dae5f24..78882ac7 100644 --- a/src/kandidatsok/kandidater/sortering/Sortering.tsx +++ b/src/kandidatsok/kandidater/sortering/Sortering.tsx @@ -2,8 +2,8 @@ import { ToggleGroup, Tooltip } from '@navikt/ds-react'; import { CheckmarkIcon, ClockIcon } from '@navikt/aksel-icons'; import useSøkekriterier from '../../hooks/useSøkekriterier'; import { FilterParam } from '../../hooks/useRespons'; +import { sendEvent } from 'felles/amplitude'; import css from './Sortering.module.css'; -import { sendEvent } from '../../../felles/amplitude'; export enum Sortering { SisteFørst = 'nyeste', diff --git a/src/stilling/api/api.ts b/src/stilling/api/api.ts index c0221408..3287ac3a 100644 --- a/src/stilling/api/api.ts +++ b/src/stilling/api/api.ts @@ -10,8 +10,8 @@ import Stilling, { Rekrutteringsbistandstilling, Stillingsinfo, } from '../domene/Stilling'; -import { Miljø, getMiljø } from '../../felles/miljø'; -import { api } from '../../felles/api'; +import { Miljø, getMiljø } from 'felles/miljø'; +import { api } from 'felles/api'; export type Side = { content: T[]; diff --git a/src/stilling/mock/mock-api.ts b/src/stilling/mock/mock-api.ts index 3e7af675..7eb78d27 100644 --- a/src/stilling/mock/mock-api.ts +++ b/src/stilling/mock/mock-api.ts @@ -1,7 +1,7 @@ import fetchMock, { MockRequest, MockResponse, MockResponseFunction } from 'fetch-mock'; import { Rekrutteringsbistandstilling } from '../domene/Stilling'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; import fnrsok from './data/fnrsok'; import kandidatliste from './data/kandidatliste'; diff --git a/src/stilling/reportee/reporteeReducer.ts b/src/stilling/reportee/reporteeReducer.ts index 974606a9..521b50a9 100644 --- a/src/stilling/reportee/reporteeReducer.ts +++ b/src/stilling/reportee/reporteeReducer.ts @@ -1,7 +1,7 @@ import { put, select, takeLatest } from 'redux-saga/effects'; import { fetchGet, ApiError } from '../api/apiUtils'; import { ReporteeAction, ReporteeActionType } from './ReporteeAction'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; export type Reportee = { displayName: string; diff --git a/src/stilling/stilling/adReducer.ts b/src/stilling/stilling/adReducer.ts index 57a5368c..5c9d5cd2 100644 --- a/src/stilling/stilling/adReducer.ts +++ b/src/stilling/stilling/adReducer.ts @@ -33,7 +33,7 @@ import { MineStillingerActionType } from '../mine-stillinger/MineStillingerActio import { VarslingAction, VarslingActionType } from '../common/varsling/varslingReducer'; import { State } from '../redux/store'; import { formatISOString } from '../utils/datoUtils'; -import { sendEvent } from '../../felles/amplitude'; +import { sendEvent } from 'felles/amplitude'; import Stilling, { AdminStatus, Kilde, @@ -42,7 +42,7 @@ import Stilling, { Status, System, } from '../domene/Stilling'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; export const FETCH_AD = 'FETCH_AD'; export const FETCH_AD_BEGIN = 'FETCH_AD_BEGIN'; diff --git a/src/stilling/stilling/adUtils.ts b/src/stilling/stilling/adUtils.ts index a017ef36..6fea50c6 100644 --- a/src/stilling/stilling/adUtils.ts +++ b/src/stilling/stilling/adUtils.ts @@ -1,4 +1,4 @@ -import { Miljø, getMiljø } from '../../felles/miljø'; +import { Miljø, getMiljø } from 'felles/miljø'; const visStillingUrl = getMiljø() === Miljø.DevGcp diff --git a/src/stilling/stilling/edit/arbeidssted/locationAreaReducer.js b/src/stilling/stilling/edit/arbeidssted/locationAreaReducer.js index a0afef77..4601630d 100644 --- a/src/stilling/stilling/edit/arbeidssted/locationAreaReducer.js +++ b/src/stilling/stilling/edit/arbeidssted/locationAreaReducer.js @@ -1,7 +1,7 @@ import { put, takeLatest } from 'redux-saga/effects'; import { fetchGet } from '../../../api/apiUtils'; import { ADD_LOCATION_AREA } from '../../adDataReducer'; -import { api } from '../../../../felles/api'; +import { api } from 'felles/api'; /** ********************************************************* * ACTIONS diff --git a/src/stilling/stilling/edit/arbeidssted/locationCodeReducer.js b/src/stilling/stilling/edit/arbeidssted/locationCodeReducer.js index 1f04ffae..b56f1d82 100644 --- a/src/stilling/stilling/edit/arbeidssted/locationCodeReducer.js +++ b/src/stilling/stilling/edit/arbeidssted/locationCodeReducer.js @@ -8,7 +8,7 @@ import { SAVE_AD_SUCCESS, FETCH_AD_SUCCESS, } from '../../adReducer'; -import { api } from '../../../../felles/api'; +import { api } from 'felles/api'; export const FETCH_LOCATIONS = 'FETCH_LOCATIONS'; export const FETCH_LOCATIONS_BEGIN = 'FETCH_LOCATIONS_BEGIN'; diff --git a/src/stilling/stilling/edit/om-stillingen/styrk/styrkReducer.js b/src/stilling/stilling/edit/om-stillingen/styrk/styrkReducer.js index 6a3892ad..1dbd5c67 100644 --- a/src/stilling/stilling/edit/om-stillingen/styrk/styrkReducer.js +++ b/src/stilling/stilling/edit/om-stillingen/styrk/styrkReducer.js @@ -1,7 +1,7 @@ import { put, takeLatest, throttle } from 'redux-saga/effects'; import { ApiError, fetchGet } from '../../../../api/apiUtils'; import { SET_STYRK } from '../../../adDataReducer'; -import { api } from '../../../../../felles/api'; +import { api } from 'felles/api'; export const SET_STYRK_TYPEAHEAD_VALUE = 'SET_STYRK_TYPEAHEAD_VALUE'; export const FETCH_STYRK = 'FETCH_STYRK'; diff --git a/src/stilling/stilling/kandidathandlinger/Kandidathandlinger.tsx b/src/stilling/stilling/kandidathandlinger/Kandidathandlinger.tsx index b2dd2b99..e2fdee04 100644 --- a/src/stilling/stilling/kandidathandlinger/Kandidathandlinger.tsx +++ b/src/stilling/stilling/kandidathandlinger/Kandidathandlinger.tsx @@ -8,7 +8,7 @@ import { Kandidatliste } from '../legg-til-kandidat-modal/kandidatlistetyper'; import { Nettressurs, Nettstatus } from '../../api/Nettressurs'; import { State } from '../../redux/store'; import { stillingenHarKandidatliste } from '../adUtils'; -import { sendGenerellEvent } from '../../../felles/amplitude'; +import { sendGenerellEvent } from 'felles/amplitude'; import LeggTilKandidatModal from '../legg-til-kandidat-modal/LeggTilKandidatModal'; import css from './Kandidathandlinger.module.css'; import Stilling from '../../domene/Stilling'; diff --git a/src/stilling/stilling/kontekst-av-kandidat/useKandidat.ts b/src/stilling/stilling/kontekst-av-kandidat/useKandidat.ts index 91d77476..74f45667 100644 --- a/src/stilling/stilling/kontekst-av-kandidat/useKandidat.ts +++ b/src/stilling/stilling/kontekst-av-kandidat/useKandidat.ts @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react'; -import { api } from '../../../felles/api'; +import { api } from 'felles/api'; export type EsRespons = { hits: { diff --git a/src/stilling/stilling/legg-til-kandidat-modal/BekreftMedNotat.tsx b/src/stilling/stilling/legg-til-kandidat-modal/BekreftMedNotat.tsx index d4104e49..cd8832cb 100644 --- a/src/stilling/stilling/legg-til-kandidat-modal/BekreftMedNotat.tsx +++ b/src/stilling/stilling/legg-til-kandidat-modal/BekreftMedNotat.tsx @@ -10,7 +10,7 @@ import { postKandidaterTilKandidatliste } from './kandidatApi'; import { VarslingAction, VarslingActionType } from '../../common/varsling/varslingReducer'; import LeggTilEllerAvbryt from './LeggTilEllerAvbryt'; import css from './LeggTilKandidatModal.module.css'; -import { sendEvent } from '../../../felles/amplitude'; +import { sendEvent } from 'felles/amplitude'; const MAKS_NOTATLENGDE = 2000; diff --git a/src/stilling/stilling/legg-til-kandidat-modal/LeggTilKandidat.tsx b/src/stilling/stilling/legg-til-kandidat-modal/LeggTilKandidat.tsx index 9bb8cdb0..7d368c32 100644 --- a/src/stilling/stilling/legg-til-kandidat-modal/LeggTilKandidat.tsx +++ b/src/stilling/stilling/legg-til-kandidat-modal/LeggTilKandidat.tsx @@ -12,7 +12,7 @@ import BekreftMedNotat from './BekreftMedNotat'; import KandidatenFinnesIkke from './kandidaten-finnes-ikke/KandidatenFinnesIkke'; import LeggTilEllerAvbryt from './LeggTilEllerAvbryt'; import css from './LeggTilKandidatModal.module.css'; -import { sendEvent } from '../../../felles/amplitude'; +import { sendEvent } from 'felles/amplitude'; type Props = { kandidatliste: Kandidatliste; diff --git a/src/stilling/stilling/legg-til-kandidat-modal/kandidatApi.ts b/src/stilling/stilling/legg-til-kandidat-modal/kandidatApi.ts index 477917da..9bd25440 100644 --- a/src/stilling/stilling/legg-til-kandidat-modal/kandidatApi.ts +++ b/src/stilling/stilling/legg-til-kandidat-modal/kandidatApi.ts @@ -1,4 +1,4 @@ -import { api } from '../../../felles/api'; +import { api } from 'felles/api'; import { ApiError } from '../../api/apiUtils'; import { Nettressurs, Nettstatus } from '../../api/Nettressurs'; import { Kandidat, Kandidatliste, Synlighetsevaluering } from './kandidatlistetyper'; diff --git a/src/stillingssok/api/api.ts b/src/stillingssok/api/api.ts index dded0581..7163a73f 100644 --- a/src/stillingssok/api/api.ts +++ b/src/stillingssok/api/api.ts @@ -1,4 +1,4 @@ -import { api, videresendTilInnlogging } from '../../felles/api'; +import { api, videresendTilInnlogging } from 'felles/api'; import { Query, Respons } from '../domene/elasticSearchTyper'; import StandardsøkDto from '../filter/standardsøk/Standardsøk'; diff --git a/src/stillingssok/filter/inkludering/Inkludering.tsx b/src/stillingssok/filter/inkludering/Inkludering.tsx index f0bfcd29..6d087479 100644 --- a/src/stillingssok/filter/inkludering/Inkludering.tsx +++ b/src/stillingssok/filter/inkludering/Inkludering.tsx @@ -3,10 +3,10 @@ import { Checkbox, CheckboxGroup } from '@navikt/ds-react'; import { hentSøkekriterier, oppdaterUrlMedParam, QueryParam } from '../../utils/urlUtils'; import { hierarkiAvTagsForFilter, visningsnavnForFilter } from './tags'; +import { sendEvent } from 'felles/amplitude'; import Filtergruppe from '../Filtergruppe'; import useNavigering from '../../useNavigering'; import css from '../Filter.module.css'; -import { sendEvent } from '../../../felles/amplitude'; const Inkludering: FunctionComponent = () => { const { searchParams, navigate } = useNavigering(); diff --git a/src/stillingssok/kontekst-av-kandidat/KontekstAvKandidat.tsx b/src/stillingssok/kontekst-av-kandidat/KontekstAvKandidat.tsx index af7f472b..22156555 100644 --- a/src/stillingssok/kontekst-av-kandidat/KontekstAvKandidat.tsx +++ b/src/stillingssok/kontekst-av-kandidat/KontekstAvKandidat.tsx @@ -1,5 +1,5 @@ import useKandidat from './useKandidat'; -import Kandidatbanner from '../../felles/banner/kandidatbanner/Kandidatbanner'; +import Kandidatbanner from 'felles/banner/kandidatbanner/Kandidatbanner'; type Props = { fnr: string; diff --git a/src/stillingssok/kontekst-av-kandidat/useKandidat.ts b/src/stillingssok/kontekst-av-kandidat/useKandidat.ts index cfb8518b..bf2ccd4d 100644 --- a/src/stillingssok/kontekst-av-kandidat/useKandidat.ts +++ b/src/stillingssok/kontekst-av-kandidat/useKandidat.ts @@ -12,9 +12,9 @@ import { Yrkejobbønske, byggKandidatQuery, } from './kandidatQuery'; -import { sendEvent } from '../../felles/amplitude'; +import { sendEvent } from 'felles/amplitude'; import fylkerOgKommuner from '../filter/geografi/fylkerOgKommuner.json'; -import { api } from '../../felles/api'; +import { api } from 'felles/api'; const useKandidat = (fnr: string) => { const { searchParams, navigate } = useNavigering(); diff --git "a/src/stillingssok/useS\303\270kMedQuery.ts" "b/src/stillingssok/useS\303\270kMedQuery.ts" index a3b5d6ce..ab6ea54e 100644 --- "a/src/stillingssok/useS\303\270kMedQuery.ts" +++ "b/src/stillingssok/useS\303\270kMedQuery.ts" @@ -5,7 +5,7 @@ import { QueryParam, hentSøkekriterier, oppdaterUrlMedParam } from './utils/url import { Respons } from './domene/elasticSearchTyper'; import useNavigering from './useNavigering'; import useStandardsøk from './standardsøk/StandardsøkContext'; -import { sendEvent } from '../felles/amplitude'; +import { sendEvent } from 'felles/amplitude'; export const DEFAULT_VALGTE_KRITERIER = '?publisert=intern&statuser=publisert'; diff --git a/tsconfig.json b/tsconfig.json index 8e348ca1..c8a2bd14 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,10 @@ "types": ["jest", "vite/client", "vite-plugin-svgr/client"], "allowSyntheticDefaultImports": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "paths": { + "felles/*": ["./src/felles/*"] + } }, "include": ["src", "mock"] } diff --git a/vite.config.ts b/vite.config.ts index 4b5dda29..20637157 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,7 @@ import { defineConfig, splitVendorChunkPlugin, loadEnv } from 'vite'; import reactPlugin from '@vitejs/plugin-react'; import svgrPlugin from 'vite-plugin-svgr'; import checkerPlugin from 'vite-plugin-checker'; +import path from 'path'; export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), ''); @@ -43,5 +44,10 @@ export default defineConfig(({ mode }) => { }, }, }, + resolve: { + alias: { + felles: path.resolve(__dirname, './src/felles'), + }, + }, }; });