-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(interview-feedback): update feedback result usage
- Loading branch information
artsiom aliakseyenka
committed
Aug 20, 2023
1 parent
0b568a7
commit 9a7635e
Showing
19 changed files
with
468 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import * as React from 'react'; | ||
import { Tag, Typography, Table } from 'antd'; | ||
import { Rating } from 'components/Rating'; | ||
import { LegacyFeedback } from 'common/models/profile'; | ||
import { ENGLISH_LEVELS } from 'data/english'; | ||
import { CODING_LEVELS, SKILLS_LEVELS } from 'data/interviews/technical-screening'; | ||
|
||
const { Text } = Typography; | ||
|
||
enum SKILL_NAME { | ||
htmlCss = 'HTML/CSS', | ||
dataStructures = 'Data structures', | ||
common = 'Common of CS / Programming', | ||
} | ||
|
||
/** | ||
* this feedback template will live here until we will migrate all feedbacks to new template | ||
*/ | ||
export function LegacyScreeningFeedback({ feedback }: { feedback: LegacyFeedback }) { | ||
const { comment, skills, programmingTask, english } = feedback; | ||
|
||
const skillSet = [ | ||
...(Object.keys(skills) as any[]).map((key: keyof typeof skills) => ({ | ||
rating: skills[key], | ||
name: SKILL_NAME[key], | ||
key, | ||
isNotCodeWritingLevel: true, | ||
})), | ||
{ | ||
rating: programmingTask.codeWritingLevel, | ||
name: 'Code writing level', | ||
key: 'codeWritingLevel', | ||
isNotCodeWritingLevel: false, | ||
}, | ||
]; | ||
const englishLevel = typeof english === 'number' ? ENGLISH_LEVELS[english] : english; | ||
|
||
return ( | ||
<> | ||
{comment && ( | ||
<p style={{ marginBottom: 20 }}> | ||
<Text strong>Comment: </Text> | ||
{comment} | ||
</p> | ||
)} | ||
<p style={{ marginBottom: 5 }}> | ||
Programming task(s): <br /> <Text code>{programmingTask.task}</Text> | ||
</p> | ||
<p style={{ marginBottom: 5 }}> | ||
Has the student solved the task(s)?{' '} | ||
{programmingTask.resolved === 1 ? ( | ||
<Tag color="green">Yes</Tag> | ||
) : programmingTask.resolved === 2 ? ( | ||
<Tag color="orange">Yes (with tips)</Tag> | ||
) : ( | ||
<Tag color="red">No</Tag> | ||
)} | ||
</p> | ||
<p style={{ marginBottom: 5 }}>Comments about coding level: {programmingTask.comment}</p> | ||
<p style={{ marginBottom: 5 }}>Estimated English level: {englishLevel?.toString().toUpperCase()}</p> | ||
<Table | ||
dataSource={skillSet} | ||
size="small" | ||
rowKey="key" | ||
pagination={false} | ||
columns={[ | ||
{ | ||
dataIndex: 'name', | ||
ellipsis: true, | ||
width: '30%', | ||
}, | ||
{ | ||
dataIndex: 'rating', | ||
render: (rating, record) => ( | ||
<Rating rating={rating} tooltips={record.isNotCodeWritingLevel ? SKILLS_LEVELS : CODING_LEVELS} /> | ||
), | ||
}, | ||
]} | ||
/> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import * as React from 'react'; | ||
import { Typography, Table, Row, Space } from 'antd'; | ||
import { Rating } from 'components/Rating'; | ||
import { StageInterviewDetailedFeedback } from 'common/models/profile'; | ||
import { | ||
CODING_LEVELS, | ||
FeedbackStepId, | ||
InterviewFeedbackStepData, | ||
InterviewFeedbackValues, | ||
InterviewQuestion, | ||
SKILLS_LEVELS, | ||
} from 'data/interviews/technical-screening'; | ||
|
||
const { Text, Title } = Typography; | ||
|
||
export function PrescreeningFeedback({ feedback }: { feedback: StageInterviewDetailedFeedback['feedback'] }) { | ||
const { steps } = feedback as { steps: Record<FeedbackStepId, InterviewFeedbackStepData> }; | ||
|
||
const { theory, practice, english, decision, intro } = steps; | ||
const isRejected = intro.values?.interviewResult === 'missed'; | ||
|
||
if (isRejected) { | ||
return ( | ||
<Space direction="vertical"> | ||
{intro.values?.comment && ( | ||
<Space> | ||
<Text strong>Comment: </Text> | ||
<Text>{intro.values?.comment as string} </Text> | ||
</Space> | ||
)} | ||
</Space> | ||
); | ||
} | ||
|
||
return ( | ||
<> | ||
<Space direction="vertical"> | ||
{decision.values?.redFlags && ( | ||
<Space> | ||
<Text strong>Red flags: </Text> | ||
<Text>{decision.values?.redFlags as string} </Text> | ||
</Space> | ||
)} | ||
{decision.values?.comment && ( | ||
<Space> | ||
<Text strong>Comment: </Text> | ||
<Text>{decision.values?.comment as string} </Text> | ||
</Space> | ||
)} | ||
{english.values && ( | ||
<> | ||
<Space> | ||
<Text strong>Certified level of English: </Text> | ||
<Text>{english.values?.englishCertificate as string} </Text> | ||
</Space> | ||
<Space> | ||
<Text strong>English level by interviewers opinion:</Text> | ||
<Text>{english.values?.selfAssessment as string} </Text> | ||
</Space> | ||
</> | ||
)} | ||
{english.values?.comment && ( | ||
<Space> | ||
<Text strong>Where did the student learn English: </Text> | ||
<Text>{english.values?.comment as string} </Text> | ||
</Space> | ||
)} | ||
<SkillSection skills={theory.values} title="Theory" tooltips={SKILLS_LEVELS} /> | ||
<SkillSection skills={practice.values} title="Practice" tooltips={CODING_LEVELS} /> | ||
</Space> | ||
</> | ||
); | ||
} | ||
|
||
function SkillSection({ | ||
skills, | ||
title, | ||
tooltips, | ||
}: { | ||
skills: InterviewFeedbackValues | undefined; | ||
title: string; | ||
tooltips: string[]; | ||
}) { | ||
if (!skills) return null; | ||
|
||
return ( | ||
<Space direction="vertical" style={{ marginBottom: 20 }}> | ||
<Title level={4}>{title}</Title> | ||
<SkillTable skills={skills.questions as InterviewQuestion[]} tooltips={tooltips} /> | ||
{skills.comment && ( | ||
<Row> | ||
<Text strong>Comment: </Text> {skills.comment as string} | ||
</Row> | ||
)} | ||
</Space> | ||
); | ||
} | ||
|
||
function SkillTable({ skills, tooltips }: { skills: InterviewQuestion[]; tooltips: string[] }) { | ||
return ( | ||
<Table | ||
dataSource={skills} | ||
size="small" | ||
rowKey="key" | ||
pagination={false} | ||
columns={[ | ||
{ | ||
width: '60%', | ||
render: (_, record) => ( | ||
<> | ||
{record.topic && ( | ||
<Row> | ||
<Text type="secondary">{record.topic}</Text> | ||
</Row> | ||
)} | ||
<Text>{record.title}</Text> | ||
</> | ||
), | ||
}, | ||
{ | ||
dataIndex: 'value', | ||
render: rating => <Rating rating={rating} tooltips={tooltips} />, | ||
}, | ||
]} | ||
/> | ||
); | ||
} |
Oops, something went wrong.