-
Notifications
You must be signed in to change notification settings - Fork 1
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
1481 implement similar positions on recruitmentapplicationformpage #1596
base: master
Are you sure you want to change the base?
1481 implement similar positions on recruitmentapplicationformpage #1596
Conversation
…for applicant serializer
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.
Ikke testa, tror ikke det funker, men kan da ikke være så ille heller
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.
Kan kanskje være litt forvirrende om navn og tags ikke stemmer? Ikke så farlig for meg assa
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.
Skjønner ikke helt hva du mener. Samme "kategori" av tags har en "stillings navn prefik", så det skal ikke bli mismatch mellom navn og tag.
recruitment_id = self.kwargs.get('id') | ||
tags_param = self.request.query_params.get('tags') |
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.
Funker det ikke å bruke getlist her?
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.
Hvis jeg forstår det riktig må klienten sende queryparams på denne måten: ?tags=tag1&tags=tag2&tags=tag3
hvis man skal bruke getlist
Gitt at tags i denne implementasjonene er lagret i en komma separert string må man uansett formatere dataen på et elle annet tidspunkt. Om man skulle brukt getlist må man gi API kall funksjonen tags: string[]
og formatere url med params på denne måten:
const tagsQuery = tags.map(t => `tags=${encodeURIComponent(t)}`).join('&');
const url = `${BACKEND_DOMAIN}/positions?id=${recruitmentId}&${tagsQuery}&position_id=${currentPositionId}`;
Jeg tror get er den enkleste måten å gjøre det på siden tags er i en string separert med komma, men hvis noe av det over virker som at jeg ikke har forstått forskjellen på get og getlist så si ifra.
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.
For å erstatte Samf3 funksjonaliteten tror jeg dette er den enkleste måten å gjøre det på
frontend/src/routes/backend.ts
Outdated
} as const; No newline at end of file | ||
} as const; |
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.
Why?
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.
fixed. Noe rart med generering av routes tror jeg
{recruitmentPositionsForGang && recruitmentPositionsForGang.length > 0 && ( | ||
<div className={styles.other_positions}> | ||
<h2 className={styles.sub_header}> | ||
{t(KEY.recruitment_otherpositions)} {dbT(recruitmentPosition?.gang, 'name')} | ||
</h2> | ||
{recruitmentPositionsForGang.map((pos) => ( | ||
<Button | ||
key={pos.id} | ||
display="pill" | ||
theme="outlined" | ||
onClick={() => { | ||
navigate({ | ||
url: reverse({ | ||
pattern: ROUTES.frontend.recruitment_application, | ||
urlParams: { positionId: pos.id, gangId: pos.gang.id }, | ||
}), | ||
}); | ||
}} | ||
> | ||
{dbT(pos, 'name')} | ||
</Button> | ||
))} | ||
</div> | ||
)} |
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.
Dette kan flyttes ut i en konstant
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.
Done! Kunne sikkert lagd en helt egen komponent av det, men planen er at det skal styles bedre i et annet issue uansett.
What
Created backend and frontend for fetching positions from tags. This makes it possible to fetch positions similar to each other.
Modified seed script to create more realisitc tags.
Fixes some rendering issues on RecruitmentApplicationFromPage
Bette styling will be done in another PR. The entire page should get a glow-up.
Why
Fetching similar positions is a feature on Samf3
closes #1481