-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/extend-deadline-for-not-responded-yet
- Loading branch information
Showing
22 changed files
with
816 additions
and
485 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
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
212 changes: 212 additions & 0 deletions
212
.../modified-timestamps-modal/__snapshots__/modified-timestamps-modal.component.spec.ts.snap
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,212 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ModifiedTimestampModalComponent should snap with coursesOfModifiedSession and modifiedSessions 1`] = ` | ||
<tm-modified-timestamps-modal | ||
__ngContext__={[Function Number]} | ||
coursesOfModifiedSession={[Function Array]} | ||
modifiedSessions={[Function Object]} | ||
> | ||
<p> | ||
The feedback session has been copied to all courses. However, changes are made to some session timings as the existing timings are no longer valid in these courses: CS315-Semester12023. The changes are as follows: | ||
</p><table | ||
class="table table-bordered" | ||
> | ||
<thead> | ||
<tr> | ||
<th> | ||
Session Name | ||
</th> | ||
<th> | ||
Timings | ||
</th> | ||
<th> | ||
Existing | ||
</th> | ||
<th> | ||
Modified | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td | ||
rowspan="4" | ||
> | ||
Instructor Feedback Session | ||
</td> | ||
<td> | ||
Submission opening time | ||
</td> | ||
<td> | ||
22 Mar 2023 9:00 PM | ||
</td> | ||
<td> | ||
23 Apr 2023 9:00 PM | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
Submission closing time | ||
</td> | ||
<td> | ||
31 Mar 2023 11:59 PM | ||
</td> | ||
<td> | ||
27 Apr 2023 11:59 PM | ||
</td> | ||
</tr> | ||
<tr | ||
class="text-color-lightgray" | ||
> | ||
<td> | ||
Session visible time | ||
</td> | ||
<td> | ||
On submission opening time | ||
</td> | ||
<td> | ||
On submission opening time | ||
</td> | ||
</tr> | ||
<tr | ||
class="text-color-lightgray" | ||
> | ||
<td> | ||
Response visible time | ||
</td> | ||
<td> | ||
Not now (publish manually) | ||
</td> | ||
<td> | ||
Not now (publish manually) | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table><br /><p> | ||
Please modify the timings as necessary. | ||
</p> | ||
</tm-modified-timestamps-modal> | ||
`; | ||
|
||
exports[`ModifiedTimestampModalComponent should snap with default fields 1`] = ` | ||
<tm-modified-timestamps-modal | ||
__ngContext__={[Function Number]} | ||
coursesOfModifiedSession={[Function Array]} | ||
modifiedSessions={[Function Object]} | ||
> | ||
<p> | ||
The course has been added. However, changes are made to some session timings as the existing timings are no longer valid. The changes are as follows: | ||
</p><table | ||
class="table table-bordered" | ||
> | ||
<thead> | ||
<tr> | ||
<th> | ||
Session Name | ||
</th> | ||
<th> | ||
Timings | ||
</th> | ||
<th> | ||
Existing | ||
</th> | ||
<th> | ||
Modified | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
</tbody> | ||
</table><br /><p> | ||
Please modify the timings as necessary. | ||
</p> | ||
</tm-modified-timestamps-modal> | ||
`; | ||
|
||
exports[`ModifiedTimestampModalComponent should snap with modifiedSessions 1`] = ` | ||
<tm-modified-timestamps-modal | ||
__ngContext__={[Function Number]} | ||
coursesOfModifiedSession={[Function Array]} | ||
modifiedSessions={[Function Object]} | ||
> | ||
<p> | ||
The course has been added. However, changes are made to some session timings as the existing timings are no longer valid. The changes are as follows: | ||
</p><table | ||
class="table table-bordered" | ||
> | ||
<thead> | ||
<tr> | ||
<th> | ||
Session Name | ||
</th> | ||
<th> | ||
Timings | ||
</th> | ||
<th> | ||
Existing | ||
</th> | ||
<th> | ||
Modified | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td | ||
rowspan="4" | ||
> | ||
Instructor Feedback Session | ||
</td> | ||
<td> | ||
Submission opening time | ||
</td> | ||
<td> | ||
22 Mar 2023 9:00 PM | ||
</td> | ||
<td> | ||
23 Apr 2023 9:00 PM | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
Submission closing time | ||
</td> | ||
<td> | ||
31 Mar 2023 11:59 PM | ||
</td> | ||
<td> | ||
27 Apr 2023 11:59 PM | ||
</td> | ||
</tr> | ||
<tr | ||
class="text-color-lightgray" | ||
> | ||
<td> | ||
Session visible time | ||
</td> | ||
<td> | ||
On submission opening time | ||
</td> | ||
<td> | ||
On submission opening time | ||
</td> | ||
</tr> | ||
<tr | ||
class="text-color-lightgray" | ||
> | ||
<td> | ||
Response visible time | ||
</td> | ||
<td> | ||
Not now (publish manually) | ||
</td> | ||
<td> | ||
Not now (publish manually) | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table><br /><p> | ||
Please modify the timings as necessary. | ||
</p> | ||
</tm-modified-timestamps-modal> | ||
`; |
52 changes: 52 additions & 0 deletions
52
src/web/app/components/modified-timestamps-modal/modified-timestamps-modal.component.html
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,52 @@ | ||
<p *ngIf="coursesOfModifiedSession.length !== 0"> | ||
The feedback session has been copied to all courses. However, changes are made to some session timings as the | ||
existing timings are no longer valid in these courses: {{ this.coursesOfModifiedSession.join(', ') }}. | ||
The changes are as follows: | ||
</p> | ||
<p *ngIf="coursesOfModifiedSession.length === 0"> | ||
The course has been added. However, changes are made to some session timings as the existing timings are | ||
no longer valid. The changes are as follows: | ||
</p> | ||
<table class="table table-bordered"> | ||
<thead> | ||
<tr> | ||
<th>Session Name</th> | ||
<th>Timings</th> | ||
<th>Existing</th> | ||
<th>Modified</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<ng-container *ngFor="let session of this.modifiedSessions | keyvalue"> | ||
<tr | ||
[ngClass]="{'text-color-lightgray' : session.value.oldTimestamp.submissionStartTimestamp === session.value.newTimestamp.submissionStartTimestamp}"> | ||
<td rowspan="4">{{ session.key }}</td> | ||
<td>Submission opening time</td> | ||
<td>{{ session.value.oldTimestamp.submissionStartTimestamp }}</td> | ||
<td>{{ session.value.newTimestamp.submissionStartTimestamp }}</td> | ||
</tr> | ||
<tr | ||
[ngClass]="{'text-color-lightgray' : session.value.oldTimestamp.submissionEndTimestamp === session.value.newTimestamp.submissionEndTimestamp}"> | ||
<td>Submission closing time</td> | ||
<td>{{ session.value.oldTimestamp.submissionEndTimestamp }}</td> | ||
<td>{{ session.value.newTimestamp.submissionEndTimestamp }}</td> | ||
</tr> | ||
<tr | ||
[ngClass]="{'text-color-lightgray' : session.value.oldTimestamp.sessionVisibleTimestamp === session.value.newTimestamp.sessionVisibleTimestamp}"> | ||
<td>Session visible time</td> | ||
<td>{{ session.value.oldTimestamp.sessionVisibleTimestamp }}</td> | ||
<td>{{ session.value.newTimestamp.sessionVisibleTimestamp }}</td> | ||
</tr> | ||
<tr | ||
[ngClass]="{'text-color-lightgray' : session.value.oldTimestamp.responseVisibleTimestamp === session.value.newTimestamp.responseVisibleTimestamp}"> | ||
<td>Response visible time</td> | ||
<td>{{ session.value.oldTimestamp.responseVisibleTimestamp }}</td> | ||
<td>{{ session.value.newTimestamp.responseVisibleTimestamp }}</td> | ||
</tr> | ||
</ng-container> | ||
</tbody> | ||
</table> | ||
<br> | ||
<p> | ||
Please modify the timings as necessary. | ||
</p> |
Empty file.
65 changes: 65 additions & 0 deletions
65
src/web/app/components/modified-timestamps-modal/modified-timestamps-modal.component.spec.ts
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,65 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { TweakedTimestampData } from '../../pages-instructor/instructor-session-base-page.component'; | ||
import { ModifiedTimestampModalComponent } from './modified-timestamps-modal.component'; | ||
|
||
describe('ModifiedTimestampModalComponent', () => { | ||
let component: ModifiedTimestampModalComponent; | ||
let fixture: ComponentFixture<ModifiedTimestampModalComponent>; | ||
|
||
const coursesOfModifiedSession: string[] = [ | ||
'CS315-Semester12023', | ||
]; | ||
|
||
const modifiedSessions: Record<string, TweakedTimestampData> = { | ||
'Instructor Feedback Session': { | ||
newTimestamp: { | ||
submissionStartTimestamp: '23 Apr 2023 9:00 PM', | ||
submissionEndTimestamp: '27 Apr 2023 11:59 PM', | ||
sessionVisibleTimestamp: 'On submission opening time', | ||
responseVisibleTimestamp: 'Not now (publish manually)', | ||
}, | ||
oldTimestamp: { | ||
submissionStartTimestamp: '22 Mar 2023 9:00 PM', | ||
submissionEndTimestamp: '31 Mar 2023 11:59 PM', | ||
sessionVisibleTimestamp: 'On submission opening time', | ||
responseVisibleTimestamp: 'Not now (publish manually)', | ||
}, | ||
}, | ||
}; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ModifiedTimestampModalComponent], | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ModifiedTimestampModalComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
it('should snap with default fields', () => { | ||
expect(fixture).toMatchSnapshot(); | ||
}); | ||
|
||
it('should snap with coursesOfModifiedSession and modifiedSessions', () => { | ||
component.coursesOfModifiedSession = coursesOfModifiedSession; | ||
component.modifiedSessions = modifiedSessions; | ||
fixture.detectChanges(); | ||
|
||
expect(fixture).toMatchSnapshot(); | ||
}); | ||
|
||
it('should snap with modifiedSessions', () => { | ||
component.modifiedSessions = modifiedSessions; | ||
fixture.detectChanges(); | ||
|
||
expect(fixture).toMatchSnapshot(); | ||
}); | ||
|
||
}); |
14 changes: 14 additions & 0 deletions
14
src/web/app/components/modified-timestamps-modal/modified-timestamps-modal.component.ts
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,14 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { TweakedTimestampData } from '../../pages-instructor/instructor-session-base-page.component'; | ||
|
||
@Component({ | ||
selector: 'tm-modified-timestamps-modal', | ||
templateUrl: './modified-timestamps-modal.component.html', | ||
styleUrls: ['./modified-timestamps-modal.component.scss'], | ||
}) | ||
export class ModifiedTimestampModalComponent { | ||
@Input() | ||
coursesOfModifiedSession: string[] = []; | ||
@Input() | ||
modifiedSessions: Record<string, TweakedTimestampData> = {}; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/web/app/components/modified-timestamps-modal/modified-timestamps-module.module.ts
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,19 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { ModifiedTimestampModalComponent } from './modified-timestamps-modal.component'; | ||
|
||
/** | ||
* Module for instructor home page. | ||
*/ | ||
@NgModule({ | ||
declarations: [ | ||
ModifiedTimestampModalComponent, | ||
], | ||
imports: [ | ||
CommonModule, | ||
], | ||
exports: [ | ||
ModifiedTimestampModalComponent, | ||
], | ||
}) | ||
export class ModifiedTimestampModalModule { } |
Oops, something went wrong.