Skip to content

Commit

Permalink
bruker ny tiltakstypeFilter != gammel filter som går mot search params
Browse files Browse the repository at this point in the history
  • Loading branch information
d142796 committed Aug 1, 2024
1 parent 11e53cc commit aeaa25e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/AvtaleOversikt/Filtrering/BeslutterFiltrering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import BEMHelper from '@/utils/bem';
import { FunctionComponent } from 'react';
import { DeltakerOgBedriftFilterGammel } from './GammelFiltrering/DeltakerOgBedriftFilterGammel';
import TiltakstypeFilterGammel from './GammelFiltrering/TiltakstypeFilterGamel';
import TiltakstypeFilter from '@/AvtaleOversikt/Filtrering/TiltakstypeFilter';

const cls = BEMHelper('filtrering');
const BeslutterFiltrering: FunctionComponent = () => {
Expand All @@ -12,7 +13,7 @@ const BeslutterFiltrering: FunctionComponent = () => {
<EtterRegistrering />
<DeltakerOgBedriftFilterGammel />
<TilskuddPeriodeStatusFilter />
<TiltakstypeFilterGammel erBeslutter={true} />
<TiltakstypeFilter erBeslutter={true} />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ import { Filter } from '@/AvtaleOversikt/Filtrering/Filter';
import { OptionProps } from '@/komponenter/form/SelectInput';
import { TiltaksType } from '@/types/avtale';
import { Radio, RadioGroup } from '@navikt/ds-react';
import { FunctionComponent } from 'react';
import { FunctionComponent, useContext } from 'react';
import { useFilterGammel } from './useFilterGammel';
import { Feature, FeatureToggleContext } from '@/FeatureToggleProvider';

export type FiltreringMedBeslutterProps = { erBeslutter: boolean };
const TiltakstypeFilterGammel: FunctionComponent<FiltreringMedBeslutterProps> = (props) => {
const { endreFilter, filtre } = useFilterGammel();
const contex = useContext(FeatureToggleContext);
const vtaoAktivert = contex[Feature.VtaoTiltakToggle];

const alleTiltakstyperBeslutter: OptionProps[] = [
{ value: '', label: 'Alle' },
{ value: 'MIDLERTIDIG_LONNSTILSKUDD', label: 'Midlertidig lønnstilskudd' },
{ value: 'VARIG_LONNSTILSKUDD', label: 'Varig lønnstilskudd' },
{ value: 'SOMMERJOBB', label: 'Sommerjobb' },
{ value: 'VTAO', label: 'VTA-oppfølging' },
];
vtaoAktivert ? { value: 'VTAO', label: 'VTA-oppfølging' } : null,
].filter((x) => x !== null) as OptionProps[];

const alleTiltakstyper: OptionProps[] = [
{ value: '', label: 'Alle' },
Expand All @@ -25,7 +28,6 @@ const TiltakstypeFilterGammel: FunctionComponent<FiltreringMedBeslutterProps> =
{ value: 'SOMMERJOBB', label: 'Sommerjobb' },
{ value: 'MENTOR', label: 'Mentor' },
{ value: 'INKLUDERINGSTILSKUDD', label: 'Inkluderingstilskudd' },
{ value: 'VTAO', label: 'VTA-oppfølging' },
];

const tiltakstyper = props.erBeslutter ? alleTiltakstyperBeslutter : alleTiltakstyper;
Expand Down
3 changes: 2 additions & 1 deletion src/AvtaleOversikt/Filtrering/TiltakstypeFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const TiltakstypeFilter: FunctionComponent<FiltreringMedBeslutterProps> = (props
{ value: 'MIDLERTIDIG_LONNSTILSKUDD', label: 'Midlertidig lønnstilskudd' },
{ value: 'VARIG_LONNSTILSKUDD', label: 'Varig lønnstilskudd' },
{ value: 'SOMMERJOBB', label: 'Sommerjobb' },
];
vtaoAktivert ? { value: 'VTAO', label: 'VTA-oppfølging' } : null,
].filter((x) => x !== null) as OptionProps[];

const alleTiltakstyper: OptionProps[] = [
{ value: '', label: 'Alle' },
Expand Down

0 comments on commit aeaa25e

Please sign in to comment.