-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interview status with feedback and reschedule option
- Loading branch information
Showing
17 changed files
with
346 additions
and
31 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
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,11 @@ | ||
<div mat-dialog-content> | ||
<form [formGroup] = "form" (ngSubmit)="save()"> | ||
<h1>Feedback</h1> | ||
<mat-form-field appearance="outline"> | ||
<mat-label>Give feedback</mat-label> | ||
<textarea matInput required formControlName="feedback"></textarea> | ||
</mat-form-field> | ||
<mat-error *ngIf="feedback.errors?.required">Feedback is required</mat-error> | ||
<button mat-raised-button color="primary" [disabled]="!form.valid" (click)="save()" class="full-width-button">Save</button> | ||
</form> | ||
</div> |
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,7 @@ | ||
div { | ||
width: 500px; | ||
} | ||
|
||
mat-form-field { | ||
display: block; | ||
} |
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FeedbackComponent } from './feedback.component'; | ||
|
||
describe('FeedbackComponent', () => { | ||
let component: FeedbackComponent; | ||
let fixture: ComponentFixture<FeedbackComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ FeedbackComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FeedbackComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,40 @@ | ||
import { Component, Inject } from '@angular/core'; | ||
import { FormBuilder, Validators } from '@angular/forms'; | ||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
|
||
@Component({ | ||
selector: 'feedback', | ||
templateUrl: './feedback.component.html', | ||
styleUrls: ['./feedback.component.scss'] | ||
}) | ||
export class FeedbackComponent { | ||
|
||
interview; | ||
form; | ||
constructor( | ||
public dialogRef: MatDialogRef<FeedbackComponent>, | ||
private builder : FormBuilder, | ||
@Inject(MAT_DIALOG_DATA) public data: any) { | ||
this.interview = {...data}; | ||
this.form = builder.group({ | ||
feedback : [this.interview.feedback, [Validators.required]] | ||
}); | ||
} | ||
|
||
save(){ | ||
if(this.feedback.value.trim() !== this.interview.feedback.trim()) { | ||
this.interview.feedback = this.feedback.value; | ||
this.dialogRef.close({ event: 'Feedback', data: this.interview }); | ||
} else | ||
this.dialogRef.close({ event: 'Feedback', data: null }); | ||
} | ||
|
||
closeDialog(){ | ||
this.dialogRef.close({event: 'Cancel'}); | ||
} | ||
|
||
get feedback() { | ||
return this.form.get('feedback'); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
width: 100%; | ||
} | ||
mat-card { | ||
// max-width: 300px; | ||
|
||
margin: 2em; | ||
|
||
table { | ||
|
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
33 changes: 33 additions & 0 deletions
33
src/app/interview-form/reschedule/reschedule.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,33 @@ | ||
<mat-card> | ||
<mat-card-content> | ||
<form [formGroup] = "form" (ngSubmit)="save()"> | ||
<h2>Reschedule interview</h2> | ||
<mat-form-field appearance="outline"> | ||
<mat-label>Choose a date</mat-label> | ||
<input matInput [min]="minDate" [max]="maxDate" [matDatepickerFilter]="filter" [matDatepicker]="datePicker" formControlName="date"> | ||
<mat-datepicker-toggle matSuffix [for]="datePicker"></mat-datepicker-toggle> | ||
<mat-datepicker #datePicker></mat-datepicker> | ||
</mat-form-field> | ||
|
||
<mat-form-field appearance="outline"> | ||
<mat-label>Choose start time</mat-label> | ||
<input matInput [ngxTimepicker]="startTimePicker" formControlName="startTime"> | ||
<ngx-material-timepicker #startTimePicker [disableAnimation]="true" | ||
timepickerClass="timePicker"></ngx-material-timepicker> | ||
<ngx-material-timepicker-toggle matSuffix [for]="startTimePicker"></ngx-material-timepicker-toggle> | ||
</mat-form-field> | ||
|
||
<mat-form-field appearance="outline"> | ||
<mat-label>Choose end time</mat-label> | ||
<input matInput [ngxTimepicker]="endTimePicker" formControlName="endTime" [min]="startTime.value"> | ||
<ngx-material-timepicker #endTimePicker [disableAnimation]="true" | ||
timepickerClass="timePicker"></ngx-material-timepicker> | ||
<ngx-material-timepicker-toggle matSuffix [for]="endTimePicker"></ngx-material-timepicker-toggle> | ||
</mat-form-field> | ||
<mat-error *ngIf = "endTime.valid && form.invalid && form.errors?.invalidDuration"> | ||
End time should be greater than start time | ||
</mat-error> | ||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.valid" class="full-width-button">Save</button> | ||
</form> | ||
</mat-card-content> | ||
</mat-card> |
21 changes: 21 additions & 0 deletions
21
src/app/interview-form/reschedule/reschedule.component.scss
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,21 @@ | ||
mat-card { | ||
max-width: 800px; | ||
margin: 2em auto; | ||
text-align: center; | ||
padding: 2em 5em; | ||
} | ||
|
||
mat-form-field { | ||
display: block; | ||
} | ||
|
||
.form-group { | ||
display: flex; | ||
mat-form-field { | ||
margin-right: 0.5em; | ||
box-sizing: border-box; | ||
} | ||
mat-form-field:last-of-type { | ||
margin-right: 0em; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/interview-form/reschedule/reschedule.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { RescheduleComponent } from './reschedule.component'; | ||
|
||
describe('RescheduleComponent', () => { | ||
let component: RescheduleComponent; | ||
let fixture: ComponentFixture<RescheduleComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ RescheduleComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(RescheduleComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.