Skip to content

Commit

Permalink
Merge pull request #852 from navikt/feature/under-18-filter
Browse files Browse the repository at this point in the history
Legger til filter for Passer for deg under 18 år i venstremeny.
  • Loading branch information
otenav authored Nov 1, 2024
2 parents 9c61fa3 + c16adb7 commit 607ff80
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/app/(sok)/_components/filters/FiltersDesktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import Extent from "./Extent";
import Sector from "./Sector";
import EngagementType from "./Engagement";
import WorkLanguage from "./WorkLanguage";
import Under18 from "@/app/(sok)/_components/filters/Under18";
import useIsDebug from "@/app/(sok)/_components/IsDebugProvider";

interface FiltersDesktopProps {
aggregations: FilterAggregations;
Expand All @@ -33,6 +35,8 @@ export default function FiltersDesktop({
searchResult,
errors,
}: FiltersDesktopProps): ReactElement {
const { isDebug } = useIsDebug();

return (
<div>
<Accordion indent={false} headingSize="small">
Expand Down Expand Up @@ -62,6 +66,12 @@ export default function FiltersDesktop({
<Alert variant="info" className="mb-6">
<NewFiltersMessage />
</Alert>
{isDebug && (
<Under18
initialValues={aggregations.under18}
updatedValues={searchResult.aggregations.under18}
/>
)}
<Education
initialValues={aggregations.education}
updatedValues={searchResult.aggregations.education}
Expand Down
9 changes: 9 additions & 0 deletions src/app/(sok)/_components/filters/FiltersMobile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ import Extent from "./Extent";
import Sector from "./Sector";
import EngagementType from "./Engagement";
import WorkLanguage from "./WorkLanguage";
import useIsDebug from "@/app/(sok)/_components/IsDebugProvider";
import Under18 from "@/app/(sok)/_components/filters/Under18";

function FiltersMobile({ onCloseClick, searchResult, aggregations, locations, postcodes, errors }) {
const [selectedFilter, setSelectedFilter] = useState("");
const headingRef = useRef();
const { isDebug } = useIsDebug();

const changeView = () => {
if (selectedFilter !== "") {
Expand Down Expand Up @@ -114,6 +117,12 @@ function FiltersMobile({ onCloseClick, searchResult, aggregations, locations, po
<Alert variant="info" className="mb-4">
<NewFiltersMessage />
</Alert>
{isDebug && (
<Under18
initialValues={aggregations.under18}
updatedValues={searchResult.aggregations.under18}
/>
)}
<Education
initialValues={aggregations.education}
updatedValues={searchResult.aggregations.education}
Expand Down
2 changes: 0 additions & 2 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { getSessionId } from "@/app/_common/monitoring/session";
import { AuthenticationContext, AuthenticationStatus } from "./_common/auth/contexts/AuthenticationProvider";
import { initAmplitude } from "./_common/monitoring/amplitude";
import googleTranslateWorkaround from "./_common/utils/googleTranslateWorkaround";
import Axe from "./Axe";

// Todo: Gå igjennom alle fetch-kall i koden og se om referrer er satt riktig. Nå er den satt referrer: CONTEXT_PATH, men ikke sikker på hva som er rett her.

Expand Down Expand Up @@ -43,7 +42,6 @@ function App({ children, amplitudeToken }: AppProps) {
<div id="app">
<SkipLink href="#main-content" />
<div className="arb-push-footer-down">
<Axe />
<Header
variant="person"
active="ledige-stillinger"
Expand Down

0 comments on commit 607ff80

Please sign in to comment.