-
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
Add interview group forms #1573
base: master
Are you sure you want to change the base?
Changes from all commits
6f22b49
6da1a01
02c1ecf
37a57b3
eb2c2a0
3bb8bba
2706b82
af8d028
e59f88e
657a223
4f42bea
bfa60bd
1772204
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@import "src/constants"; | ||
|
||
@import "src/mixins"; | ||
|
||
.button { | ||
margin-top: 2rem; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { type ReactElement, useCallback, useEffect, useMemo, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { useParams } from 'react-router-dom'; | ||
import { CrudButtons, Link, type Tab, TabView } from '~/Components'; | ||
import { Button, CrudButtons, Link, type Tab, TabView } from '~/Components'; | ||
import { Table } from '~/Components/Table'; | ||
import { deleteRecruitmentSeparatePosition, getRecruitment, getRecruitmentGangs } from '~/api'; | ||
import type { RecruitmentDto, RecruitmentGangDto, RecruitmentSeparatePositionDto } from '~/dto'; | ||
|
@@ -11,7 +11,9 @@ import { reverse } from '~/named-urls'; | |
import { ROUTES } from '~/routes'; | ||
import { dbT, lowerCapitalize } from '~/utils'; | ||
import { AdminPageLayout } from '../AdminPageLayout/AdminPageLayout'; | ||
import { AppletContainer, RecruitmentInterviewGroupsList } from './components'; | ||
import { AppletContainer, RecruitmentSharedInterviewPositionsList } from './components'; | ||
|
||
import styles from './RecruitmentGangOverviewPage.module.scss'; | ||
|
||
export function RecruitmentGangOverviewPage() { | ||
const { recruitmentId } = useParams(); | ||
|
@@ -124,7 +126,26 @@ export function RecruitmentGangOverviewPage() { | |
label: t(KEY.recruitment_gangs_with_separate_positions), | ||
value: <Table columns={tableSeparatePositionColumns} data={tableSeparatePositionData ?? []} />, | ||
}, | ||
{ key: 3, label: t(KEY.recruitment_interview_groups), value: <RecruitmentInterviewGroupsList /> }, | ||
{ | ||
key: 3, | ||
label: t(KEY.recruitment_interview_group_create_header), | ||
value: ( | ||
<> | ||
<Button | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Knappen burde være over listen. Den blir litt gjemt There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
className={styles.button} | ||
theme="success" | ||
rounded={true} | ||
link={reverse({ | ||
pattern: ROUTES.frontend.admin_recruitment_sharedinterviewgroup_create, | ||
urlParams: { recruitmentId: recruitmentId }, | ||
})} | ||
> | ||
{lowerCapitalize(`${t(KEY.common_create)} ${t(KEY.recruitment_interview_group)}`)} | ||
</Button>{' '} | ||
<RecruitmentSharedInterviewPositionsList /> | ||
</> | ||
), | ||
}, | ||
]; | ||
}, [gangs, recruitment, t, recruitmentId, navigate, deleteSeparatePositionHandler]); | ||
|
||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,9 @@ | |
width: 100%; | ||
flex: 1; | ||
} | ||
|
||
.footer { | ||
justify-content: end; | ||
display: flex; | ||
padding: 0.5em; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
import { Button, ExpandableHeader, Table } from '~/Components'; | ||
import type { RecruitmentSharedInterviewPositionsDto, RecruitmentStatsDto } from '~/dto'; | ||
import { KEY } from '~/i18n/constants'; | ||
import { reverse } from '~/named-urls'; | ||
import { ROUTES } from '~/routes'; | ||
import { dbT } from '~/utils'; | ||
import styles from './RecruitmentSharedInterviewPositionsComponent.module.scss'; | ||
|
||
type RecruitmentSharedInterviewPositionsComponentProps = { | ||
interviewGroup: RecruitmentSharedInterviewPositionsDto; | ||
}; | ||
|
||
export function RecruitmentSharedInterviewPositionsComponent({ | ||
interviewGroup, | ||
}: RecruitmentSharedInterviewPositionsComponentProps) { | ||
const interviewGroupHeader = dbT(interviewGroup, 'name') ?? 'N/A'; | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<ExpandableHeader | ||
showByDefault={true} | ||
key={interviewGroup.id} | ||
label={interviewGroupHeader} | ||
className={styles.dropDownHeader} | ||
> | ||
<Table | ||
className={styles.table} | ||
data={interviewGroup.positions.map((position) => { | ||
return { cells: [dbT(position, 'name'), dbT(position.gang, 'name')] }; | ||
})} | ||
/> | ||
<div className={styles.footer}> | ||
<Button | ||
display="basic" | ||
theme="blue" | ||
rounded={true} | ||
link={reverse({ | ||
pattern: ROUTES.frontend.admin_recruitment_sharedinterviewgroup_edit, | ||
urlParams: { recruitmentId: interviewGroup.recruitment, sharedInterviewGroupId: interviewGroup.id }, | ||
})} | ||
> | ||
{t(KEY.common_edit)} | ||
</Button> | ||
</div> | ||
</ExpandableHeader> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { RecruitmentSharedInterviewPositionsComponent } from './RecruitmentSharedInterviewPositionsComponent'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { AppletCard } from './AppletCard/AppletCard'; | ||
export { AppletContainer } from './AppletContainer/AppletContainer'; | ||
export { RecruitmentInterviewGroupsList } from './RecruitmentInterviewGroupsList/RecruitmentInterviewGroupsList'; | ||
export { RecruitmentSharedInterviewPositionsList } from './RecruitmentInterviewGroupsList/RecruitmentSharedInterviewPositionsList'; |
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.
RecruitmentSharedInterviewPositionsSerializer
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