Skip to content
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

704 possibility to access interview notes from overview page #739

Merged
5 changes: 5 additions & 0 deletions frontend/src/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { SamfOutlet } from './Components/SamfOutlet';
import { SultenOutlet } from './Components/SultenOutlet';
import { VenuePage } from './Pages/VenuePage';
import { AdminLayout } from './PagesAdmin/AdminLayout/AdminLayout';
import { InterviewNotesPage } from './PagesAdmin/InterviewNotesAdminPage';
import { RecruitmentFormAdminPage } from './PagesAdmin/RecruitmentFormAdminPage';
import { RecruitmentPositionOverviewPage } from './PagesAdmin/RecruitmentPositionOverviewPage/RecruitmentPositionOverviewPage';
import { SaksdokumentAdminPage } from './PagesAdmin/SaksdokumentAdminPage';
Expand Down Expand Up @@ -185,6 +186,10 @@ export function AppRoutes() {
path={ROUTES.frontend.admin_recruitment_users_without_interview}
element={<RecruitmentUsersWithoutInterview />}
/>
<Route
path={ROUTES.frontend.admin_recruitment_gang_position_applicants_interviewNotes}
emilte marked this conversation as resolved.
Show resolved Hide resolved
element={<InterviewNotesPage />}
/>
{/* TODO ADD PERMISSIONS */}
<Route
path={ROUTES.frontend.admin_recruitment_gang_overview}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.container {
emilte marked this conversation as resolved.
Show resolved Hide resolved
display: flex;
flex-direction: column;
align-items: left;
width: auto;
background-color: white;
font-family: inherit;
border-radius: 10px;
transition: 0.2s;
padding: 20px;
margin: 10px;
}

.textbox {
width: 100%;
height: 200px;
border: 1px outset #ccc;
border-radius: 4px;
resize: none;
padding: 12px 20px;
box-sizing: border-box;
display: block;
object-fit: cover;
font-family: Arial, Helvetica, sans-serif;
emilte marked this conversation as resolved.
Show resolved Hide resolved
white-space: pre-wrap;
overflow-y: auto;
}

.textbox textarea {
emilte marked this conversation as resolved.
Show resolved Hide resolved
background-color: #f8f8f8;
hei98 marked this conversation as resolved.
Show resolved Hide resolved
font-size: 25px;
resize: none;
}

.textbox p {
emilte marked this conversation as resolved.
Show resolved Hide resolved
margin: 0;
}

.button {
width: 150px;
padding: 10px 20px;
display: block;
margin: 0 auto;
margin-top: 10px;
border: 1px solid #333;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { useState } from 'react';
import { Button } from '~/Components';
import { AdminPageLayout } from '../AdminPageLayout/AdminPageLayout';
import styles from './InterviewNotesAdminPage.module.scss';

export function InterviewNotesPage() {
//TODO: interview notes from backen
const [editingMode, setEditingMode] = useState(false);
const [text, setText] = useState('Notater fra intervjuet her...'); //TODO: place the text from the backend here.
const posid = 1; //TODO: get the posid from the backend.

function handleOnClick() {
if (editingMode) {
setEditingMode(false);
//TODO: Save the text in the textbox and send it to the backend.
} else {
setEditingMode(true);
//TODO: Get the text from the backend, and place it in the textbox.
}
emilte marked this conversation as resolved.
Show resolved Hide resolved
}

function handleTextarea(e: React.ChangeEvent<HTMLTextAreaElement>) {
setText(e.target.value);
}

return (
<AdminPageLayout title="Interview Notes">
emilte marked this conversation as resolved.
Show resolved Hide resolved
<div className={styles.container}>
<label htmlFor="INotes">Interview Notes for nummer {posid}</label>
{editingMode ? (
<textarea id="INotes" name="INotes" className={styles.textbox} value={text} onChange={handleTextarea}>
{text}
</textarea>
) : (
emilte marked this conversation as resolved.
Show resolved Hide resolved
<div className={styles.textbox}>
<p>{text}</p>
</div>
)}
<Button theme="samf" rounded={true} className={styles.button} onClick={handleOnClick}>
{editingMode ? 'Save' : 'Edit'}
emilte marked this conversation as resolved.
Show resolved Hide resolved
</Button>
</div>
</AdminPageLayout>
);
}
1 change: 1 addition & 0 deletions frontend/src/PagesAdmin/InterviewNotesAdminPage/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { InterviewNotesPage } from './InterviewNotesAdminPage';
1 change: 1 addition & 0 deletions frontend/src/PagesAdmin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { ImageAdminPage } from './ImageAdminPage';
export { ImageFormAdminPage } from './ImageFormAdminPage';
export { InformationAdminPage } from './InformationAdminPage';
export { InformationFormAdminPage } from './InformationFormAdminPage';
export { InterviewNotesPage } from './InterviewNotesAdminPage';
export { OpeningHoursAdminPage } from './OpeningHoursAdminPage';
export { RecruitmentAdminPage } from './RecruitmentAdminPage';
export { RecruitmentGangAdminPage } from './RecruitmentGangAdminPage';
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/routes/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export const ROUTES_FRONTEND = {
admin_recruitment_gang_position_edit: '/control-panel/recruitment/:recruitmentId/gang/:gangId/edit/:positionId',
admin_recruitment_gang_position_applicants_overview:
'/control-panel/recruitment/:recruitmentId/gang/:gangId/position/:positionId',
admin_recruitment_gang_position_applicants_interviewNotes:
'/control-panel/recruitment/:recruitmentId/gang/:gangId/position/:positionId/notesId', //fix when backend is done
// ==================== //
// Development //
// ==================== //
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json
emilte marked this conversation as resolved.
Show resolved Hide resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading