diff --git a/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.html b/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.html index 21304be0cd9c..e6cb055897f2 100644 --- a/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.html +++ b/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.html @@ -24,7 +24,7 @@

Student Activity Logs

- + @@ -54,7 +54,7 @@

Student Activity Logs

- + diff --git a/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.scss b/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.scss index 2b361626fa26..ac08241b16bf 100644 --- a/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.scss +++ b/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.scss @@ -13,3 +13,9 @@ .no-activity-body { padding: .5rem 1rem; } + +.form-control { + &[readonly] { + background-color: white; + } +} diff --git a/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.ts b/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.ts index 6afed8674706..745f0b202e77 100644 --- a/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.ts +++ b/src/web/app/pages-instructor/instructor-audit-logs-page/instructor-audit-logs-page.component.ts @@ -115,23 +115,11 @@ export class InstructorAuditLogsPageComponent implements OnInit { this.searchResults = []; const selectedCourse: Course | undefined = this.courses.find((course: Course) => course.courseId === this.formModel.courseId); - const timeZone: string = selectedCourse ? selectedCourse.timeZone : this.timezoneService.guessTimezone(); const searchFrom: number = this.timezoneService.resolveLocalDateTime( - this.formModel.logsDateFrom, this.formModel.logsTimeFrom, timeZone, true); + this.formModel.logsDateFrom, this.formModel.logsTimeFrom, timeZone, true); const searchUntil: number = this.timezoneService.resolveLocalDateTime( - this.formModel.logsDateTo, this.formModel.logsTimeTo, timeZone, true); - - const indexOfInvalidTime: number = [searchFrom, searchUntil].findIndex(isNaN); - const sequenceOfTimeChecked: string[] = ['Search period from', 'Search period until']; - - if (indexOfInvalidTime !== -1) { - const errorMessage: string = `Invalid datetime range for ${sequenceOfTimeChecked[indexOfInvalidTime]}`; - this.statusMessageService.showErrorToast(errorMessage); - this.isLoading = false; - this.isSearching = false; - return; - } + this.formModel.logsDateTo, this.formModel.logsTimeTo, timeZone, true); this.logsService.searchFeedbackSessionLog({ courseId: this.formModel.courseId, @@ -148,7 +136,6 @@ export class InstructorAuditLogsPageComponent implements OnInit { }, (e: ErrorMessageOutput) => { this.statusMessageService.showErrorToast(e.error.message); }); - } /** diff --git a/src/web/app/pages-instructor/instructor-session-edit-page/instructor-session-edit-page.component.ts b/src/web/app/pages-instructor/instructor-session-edit-page/instructor-session-edit-page.component.ts index ca8f91c5f130..5e17c4d465a7 100644 --- a/src/web/app/pages-instructor/instructor-session-edit-page/instructor-session-edit-page.component.ts +++ b/src/web/app/pages-instructor/instructor-session-edit-page/instructor-session-edit-page.component.ts @@ -397,8 +397,6 @@ export class InstructorSessionEditPageComponent extends InstructorSessionBasePag this.sessionEditFormModel.isEditable = false; this.feedbackSessionModelBeforeEditing = JSON.parse(JSON.stringify(this.sessionEditFormModel)); this.sessionEditFormModel.isSaving = true; - let sessionVisibleTime: number = 0; - let responseVisibleTime: number = 0; const submissionStartTime: number = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.submissionStartDate, this.sessionEditFormModel.submissionStartTime, @@ -406,33 +404,19 @@ export class InstructorSessionEditPageComponent extends InstructorSessionBasePag const submissionEndTime: number = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.submissionEndDate, this.sessionEditFormModel.submissionEndTime, this.sessionEditFormModel.timeZone, true); + let sessionVisibleTime: number = 0; if (this.sessionEditFormModel.sessionVisibleSetting === SessionVisibleSetting.CUSTOM) { sessionVisibleTime = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.customSessionVisibleDate, this.sessionEditFormModel.customSessionVisibleTime, this.sessionEditFormModel.timeZone, true); } + let responseVisibleTime: number = 0; if (this.sessionEditFormModel.responseVisibleSetting === ResponseVisibleSetting.CUSTOM) { responseVisibleTime = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.customResponseVisibleDate, this.sessionEditFormModel.customResponseVisibleTime, this.sessionEditFormModel.timeZone, true); } - const indexOfInvalidTime: number = - [submissionStartTime, submissionEndTime, sessionVisibleTime, responseVisibleTime] - .findIndex(isNaN); - const sequenceOfTimeChecked: string[] = [ - 'submission opening time', - 'submission closing time', - 'session visible time', - 'response visible time']; - - if (indexOfInvalidTime !== -1) { - const errorMessage: string = `Invalid datetime range for ${sequenceOfTimeChecked[indexOfInvalidTime]}`; - this.statusMessageService.showErrorToast(errorMessage); - this.sessionEditFormModel.isSaving = false; - return; - } - this.feedbackSessionsService.updateFeedbackSession(this.courseId, this.feedbackSessionName, { instructions: this.sessionEditFormModel.instructions, diff --git a/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts b/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts index 5def2a278cb0..8070e7ed5570 100644 --- a/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts +++ b/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts @@ -275,8 +275,6 @@ export class InstructorSessionsPageComponent extends InstructorSessionModalPageC */ addNewSessionHandler(): void { this.sessionEditFormModel.isSaving = true; - let sessionVisibleTime: number = 0; - let responseVisibleTime: number = 0; const submissionStartTime: number = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.submissionStartDate, this.sessionEditFormModel.submissionStartTime, @@ -284,33 +282,19 @@ export class InstructorSessionsPageComponent extends InstructorSessionModalPageC const submissionEndTime: number = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.submissionEndDate, this.sessionEditFormModel.submissionEndTime, this.sessionEditFormModel.timeZone, true); + let sessionVisibleTime: number = 0; if (this.sessionEditFormModel.sessionVisibleSetting === SessionVisibleSetting.CUSTOM) { sessionVisibleTime = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.customSessionVisibleDate, this.sessionEditFormModel.customSessionVisibleTime, this.sessionEditFormModel.timeZone, true); } + let responseVisibleTime: number = 0; if (this.sessionEditFormModel.responseVisibleSetting === ResponseVisibleSetting.CUSTOM) { responseVisibleTime = this.timezoneService.resolveLocalDateTime( this.sessionEditFormModel.customResponseVisibleDate, this.sessionEditFormModel.customResponseVisibleTime, this.sessionEditFormModel.timeZone, true); } - const indexOfInvalidTime: number = - [submissionStartTime, submissionEndTime, sessionVisibleTime, responseVisibleTime] - .findIndex(isNaN); - const sequenceOfTimeChecked: string[] = [ - 'submission opening time', - 'submission closing time', - 'session visible time', - 'response visible time']; - - if (indexOfInvalidTime !== -1) { - const errorMessage: string = `Invalid datetime range for ${sequenceOfTimeChecked[indexOfInvalidTime]}`; - this.statusMessageService.showErrorToast(errorMessage); - this.sessionEditFormModel.isSaving = false; - return; - } - this.feedbackSessionsService.createFeedbackSession(this.sessionEditFormModel.courseId, { feedbackSessionName: this.sessionEditFormModel.feedbackSessionName, instructions: this.sessionEditFormModel.instructions, @@ -331,8 +315,8 @@ export class InstructorSessionsPageComponent extends InstructorSessionModalPageC // begin to populate session with template const templateSession: TemplateSession | undefined = - this.feedbackSessionsService.getTemplateSessions().find( - (t: TemplateSession) => t.name === this.sessionEditFormModel.templateSessionName); + this.feedbackSessionsService.getTemplateSessions().find( + (t: TemplateSession) => t.name === this.sessionEditFormModel.templateSessionName); if (!templateSession) { return; }