Skip to content

Commit

Permalink
delete old metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjas committed Aug 17, 2023
1 parent f69714c commit 22b1e46
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 174 deletions.
11 changes: 0 additions & 11 deletions src/felles-komponenter/utils/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,6 @@ export function loggStillingFraNavStillingslenkeKlikk(veileder: boolean) {
loggEvent(STILLING_FRA_NAV_AAPNE_STILLINGSLENKE, { erVeileder: veileder });
}

const HAR_BRUKT_NIVAA_4 = 'aktivitetsplan.innsikt.harBruktNivaa4';
const IKKE_REGISTRERT_I_KRR = 'aktivitetsplan.innsikt.ikkeRegistrertIKrr';

export function loggHarBruktNivaa4(harBruktNivaa4: boolean) {
loggEvent(HAR_BRUKT_NIVAA_4, { harBruktNivaa4: harBruktNivaa4 });
}

export function loggIkkeRegistrertIKrr() {
loggEvent(IKKE_REGISTRERT_I_KRR);
}

function tidBruktFra(fraDato: number | string, tilDato?: number | string) {
const tilD = tilDato ? new Date(tilDato).getTime() : new Date().getTime();
return Math.ceil(Math.abs(new Date(fraDato).getTime() - tilD) / (1000 * 3600 * 24));
Expand Down
131 changes: 0 additions & 131 deletions src/moduler/feilmelding/IkkeNiva4.test.tsx

This file was deleted.

34 changes: 2 additions & 32 deletions src/moduler/feilmelding/IkkeNiva4.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import { Alert, HelpText } from '@navikt/ds-react';
import React, { useEffect } from 'react';
import React from 'react';
import { useSelector } from 'react-redux';

import { Status } from '../../createGenericSlice';
import { loggHarBruktNivaa4, loggIkkeRegistrertIKrr } from '../../felles-komponenter/utils/logging';
import { useErVeileder } from '../../Provider';
import {
selectErBrukerManuell,
selectOppfolgingSlice,
selectOppfolgingStatus,
selectReservasjonKRR,
} from '../oppfolging-status/oppfolging-selector';
import { selectErBrukerManuell, selectReservasjonKRR } from '../oppfolging-status/oppfolging-selector';
import { selectNivaa4, selectNivaa4LastetOk } from '../tilgang/tilgang-selector';

const Mere = () => (
Expand All @@ -24,29 +16,7 @@ const Nivaa4Feilmelding = () => {
const niva4 = useSelector(selectNivaa4);
const lastetOk = useSelector(selectNivaa4LastetOk);
const erreservertKRR = useSelector(selectReservasjonKRR);
const erVeileder = useErVeileder();
const erManuell = useSelector(selectErBrukerManuell);
const oppfolging = useSelector(selectOppfolgingSlice).data;
const oppfolgingLastetOk = useSelector(selectOppfolgingStatus) === Status.OK;

// todo fjern dette etter innsikt er gjort
useEffect(() => {
if (!oppfolgingLastetOk) return;
if (erVeileder) {
const { reservasjonKRR, manuell, kanVarsles } = oppfolging;
const ikkeRegistrertIKRR = !reservasjonKRR && !manuell && !kanVarsles;
if (ikkeRegistrertIKRR) {
loggIkkeRegistrertIKrr();
}
}
}, [oppfolging, erVeileder, oppfolgingLastetOk]);

useEffect(() => {
if (!lastetOk) return;
if (erVeileder) {
loggHarBruktNivaa4(niva4);
}
}, [niva4, erVeileder, lastetOk]);

if (niva4 || !lastetOk || erManuell || erreservertKRR) {
return null;
Expand Down

0 comments on commit 22b1e46

Please sign in to comment.