Skip to content

Commit

Permalink
Fix teacherName
Browse files Browse the repository at this point in the history
  • Loading branch information
disturm committed Jul 1, 2021
1 parent 37e132b commit bf03335
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/apis/BrsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ export interface Discipline {
disciplineLoad: string;
groupHistoryId: string;
isModule: boolean;
teacherName: string;
teacherName?: string;
}

// eslint-disable-next-line
Expand Down
6 changes: 5 additions & 1 deletion src/components/work/WorkerDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export default class WorkerDialog extends React.Component<Props, State> {
reportToNestedListItems(report: Report): Promise<NestedItem[]> {
const logItems = this.state.logItems;
return new Promise((resolve) => {
let title = `Группа ${report.group}, преподаватель ${report.teacher}`;
let title =
`Группа ${report.group}` +
(report.teacher !== undefined
? `, преподаватель ${report.teacher}`
: "");
const nestedItems: NestedItem[] = [];
const mainItem: NestedItem = { title, collapsed: true, nestedItems };

Expand Down
13 changes: 6 additions & 7 deletions src/managers/MarksManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ export default class MarksManager {

if (suitableControlActions.length === 0) {
errorMessages.push(
`Группа ${discipline.group}, преподаватель ${discipline.teacherName}`
`Группа ${discipline.group}` +
(discipline.teacherName !== undefined
? `, преподаватель ${discipline.teacherName}`
: "")
);
errorMessages.push(
`- контрольное мероприятие «${config.controlAction}» не сопоставлено с БРС`
Expand Down Expand Up @@ -453,14 +456,10 @@ export default class MarksManager {
report.merge.succeed = mergedStudents.length;

if (skippedActualStudents.length > 0)
report.merge.failedActual = skippedActualStudents.map(
(s) => s.fullName
);
report.merge.failedActual = skippedActualStudents.map((s) => s.fullName);

if (skippedBrsStudents.length > 0) {
report.merge.failedBrs = skippedBrsStudents.map(
(s) => s.studentFio
);
report.merge.failedBrs = skippedBrsStudents.map((s) => s.studentFio);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/managers/ReportManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class ReportManager {
return this._currentReport;
}

newReport(group: string, teacher: string) {
newReport(group: string, teacher?: string) {
this.finishReport();
this._currentReport = {
group,
Expand All @@ -41,7 +41,7 @@ export default class ReportManager {

export interface Report {
group: string;
teacher: string;
teacher?: string;
merge: {
succeed: number;
failedActual?: string[];
Expand Down

0 comments on commit bf03335

Please sign in to comment.