Skip to content

Conversation

betsytraran
Copy link
Contributor

No description provided.

@betsytraran
Copy link
Contributor Author

Lagring av søk

@betsytraran betsytraran marked this pull request as ready for review September 26, 2025 07:29
@betsytraran betsytraran requested a review from a team as a code owner September 26, 2025 07:29
@Copilot Copilot AI review requested due to automatic review settings September 26, 2025 07:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a feature to save and display the user's last search parameters across Dolly and Tenor search interfaces. The main functionality allows users to see their recently used search criteria as clickable chips that can be applied to new searches.

  • Adds functionality to save search parameters when users make searches
  • Introduces a "SisteSoek" (Last Search) component to display recent search criteria as clickable chips
  • Updates all search form components to include proper labeling for search tracking

Reviewed Changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
useSoek.tsx New hook to fetch saved searches from backend
DollyService.tsx Adds service method to save search data
DollyEndpoints.tsx Adds endpoint for saving search data
TenorSoekPage.tsx Integrates search saving and display functionality
SoekForm.tsx Refactors to support new search handling methods
DollySoekPage.tsx Integrates search saving for Dolly search
SisteSoek.tsx New component for displaying saved search options
Multiple form partials Updates to include proper labeling for search parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

options={Options('boolean')}
label="Har flere fornnavn"
onChange={(val: any) => handleChange(val?.value, 'navn.harFlereFornavn')}
label="Har flere fornavn"
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label was corrected from 'fornnavn' to 'fornavn', which is the correct spelling.

Copilot uses AI. Check for mistakes.

handleChange(
val?.target?.value ?? null,
'tjenestepensjonsavtale.pensjonsinnretningOrgnr',
`Tjenestepensjonsavtale org.nr.: ${val?.target?.value}`,
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nullish coalescing operator (??) is used instead of the logical OR operator (||). This is more precise as it only checks for null/undefined, not other falsy values like empty strings or 0.

Suggested change
`Tjenestepensjonsavtale org.nr.: ${val?.target?.value}`,
`Tjenestepensjonsavtale org.nr.: ${val?.target?.value ?? ''}`,

Copilot uses AI. Check for mistakes.

Comment on lines +119 to +126
useControlled
/>
<DollyTextInput
name="epost"
label="Epost"
size="large"
isDisabled={loading}
useControlled
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The useControlled prop is added to both inputs but there's inconsistent formatting - the first input has it as a separate line while the second has it inline. For consistency, both should follow the same pattern.

Copilot uses AI. Check for mistakes.

Comment on lines +67 to +73
onChange={(val: SyntheticEvent) =>
handleChangeList(
val?.map((item: any) => item.value) || null,
'inntekt.inntektstyper',
'Inntektstype',
)
}
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapping operation val?.map((item: any) => item.value) could fail if val is null/undefined. The optional chaining should be applied after the null check or the fallback should handle the case where val is falsy.

Copilot uses AI. Check for mistakes.

'inntekt.forskuddstrekk',
]

export const SisteSoek = ({ type, formValues, handleChange, handleChangeList }) => {
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component parameters are not typed. Consider adding TypeScript interfaces for better type safety and developer experience.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@stigus stigus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Det blir ikke mitt siste soek med denne nydelige funksjonaliteten for å si det sånn, nice nice nice 🤩

@betsytraran betsytraran merged commit df05fb0 into master Sep 30, 2025
38 checks passed
@betsytraran betsytraran deleted the feature/lagre-siste-soek branch September 30, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants