-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/lagre siste soek #3917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/lagre siste soek #3917
Conversation
…ture/lagre-siste-soek
…ture/lagre-siste-soek
…ture/lagre-siste-soek
…ture/lagre-siste-soek
…ture/lagre-siste-soek
…ture/lagre-siste-soek
There was a problem hiding this 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" |
There was a problem hiding this comment.
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}`, |
There was a problem hiding this comment.
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.
`Tjenestepensjonsavtale org.nr.: ${val?.target?.value}`, | |
`Tjenestepensjonsavtale org.nr.: ${val?.target?.value ?? ''}`, |
Copilot uses AI. Check for mistakes.
useControlled | ||
/> | ||
<DollyTextInput | ||
name="epost" | ||
label="Epost" | ||
size="large" | ||
isDisabled={loading} | ||
useControlled |
There was a problem hiding this comment.
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.
onChange={(val: SyntheticEvent) => | ||
handleChangeList( | ||
val?.map((item: any) => item.value) || null, | ||
'inntekt.inntektstyper', | ||
'Inntektstype', | ||
) | ||
} |
There was a problem hiding this comment.
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 }) => { |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 🤩
No description provided.