-
Notifications
You must be signed in to change notification settings - Fork 4
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 VIH-9899---New-Notify-template-for-LIP---2…
…nd-email---new-users-of-the-platform
- Loading branch information
Showing
24 changed files
with
235 additions
and
85 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 |
---|---|---|
|
@@ -350,4 +350,4 @@ jasmine-tests | |
.DS_Store | ||
|
||
.env | ||
.angular/ | ||
.angular/ |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
16 changes: 16 additions & 0 deletions
16
...AdminWebsite/ClientApp/src/app/bookings-list/booking-status/booking-status.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,16 @@ | ||
<span *ngIf="this.hasNoJudge" class="vh-sml vh-nojudge">NO JUDGE ASSIGNED</span> | ||
<div *ngIf="this.showTime"> | ||
<div class="vh-sml vh-col govuk-!-margin-top-2">{{ bookingDetails.StartTime | amLocal | amDateFormat : 'h:mm a' }}</div> | ||
<div class="govuk-hint vh-sml vh-col vh-font-black">listed for {{ bookingDetails.DurationInHoursAndMinutes }}</div> | ||
</div> | ||
<div | ||
*ngIf="statusMessage !== null" | ||
class="vh-status" | ||
[ngClass]="{ | ||
'vh-cancelled-booking': bookingDetails.isCancelled, | ||
'vh-created-booking': bookingDetails.isCreated || bookingDetails.hasConfirmationWithNoJudge, | ||
'vh-confirmation-failed': bookingDetails.hasBookingConfirmationFailed | ||
}" | ||
> | ||
{{ this.statusMessage }} | ||
</div> |
41 changes: 41 additions & 0 deletions
41
...AdminWebsite/ClientApp/src/app/bookings-list/booking-status/booking-status.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,41 @@ | ||
@import 'govuk-frontend/govuk/base'; | ||
.vh-sml { | ||
font-size: smaller; | ||
} | ||
|
||
.vh-status { | ||
color: govuk-colour('white'); | ||
margin-left: 9px; | ||
padding-top: 3px; | ||
padding-bottom: 3px; | ||
width: 50%; | ||
font-weight: 200; | ||
text-align: center; | ||
} | ||
|
||
.vh-cancelled-booking, | ||
.vh-confirmation-failed { | ||
background-color: govuk-colour('red'); | ||
} | ||
|
||
.vh-created-booking { | ||
background-color: govuk-colour('blue'); | ||
} | ||
|
||
.vh-nojudge { | ||
background: govuk-colour('red'); | ||
color: govuk-colour('white'); | ||
padding: 0px 4px; | ||
} | ||
|
||
.vh-col { | ||
margin-left: 10px; | ||
} | ||
|
||
.govuk-hint { | ||
margin-bottom: 0; | ||
} | ||
|
||
.vh-font-black { | ||
color: govuk-colour('black'); | ||
} |
59 changes: 59 additions & 0 deletions
59
...inWebsite/ClientApp/src/app/bookings-list/booking-status/booking-status.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,59 @@ | ||
import { BookingStatusComponent } from './booking-status.component'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MomentModule } from 'ngx-moment'; | ||
|
||
describe('BookingStatusComponent', () => { | ||
let component: BookingStatusComponent; | ||
let fixture: ComponentFixture<BookingStatusComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [BookingStatusComponent], | ||
imports: [MomentModule] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(BookingStatusComponent); | ||
component = fixture.componentInstance; | ||
component.bookingDetails = {} as any; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
describe('statusMessage', () => { | ||
it('should return Confirmed when status is Created', () => { | ||
component.bookingDetails = { Status: 'Created' } as any; | ||
expect(component.statusMessage).toBe('Confirmed'); | ||
}); | ||
it('should return Confirmed when status is ConfirmedWithoutJudge', () => { | ||
component.bookingDetails = { Status: 'ConfirmedWithoutJudge' } as any; | ||
expect(component.statusMessage).toBe('Confirmed'); | ||
}); | ||
it('should return Cancelled when status is Cancelled', () => { | ||
component.bookingDetails = { Status: 'Cancelled' } as any; | ||
expect(component.statusMessage).toBe('Cancelled'); | ||
}); | ||
it('should return Failed when status is Failed', () => { | ||
component.bookingDetails = { Status: 'Failed' } as any; | ||
expect(component.statusMessage).toBe('Failed'); | ||
}); | ||
it('should return null when status is anything else', () => { | ||
component.bookingDetails = { Status: 'anything else' } as any; | ||
expect(component.statusMessage).toBe(null); | ||
}); | ||
}); | ||
|
||
describe('hasNoJudge', () => { | ||
it('should return true when status is BookedWithoutJudge', () => { | ||
component.bookingDetails = { Status: 'BookedWithoutJudge' } as any; | ||
expect(component.hasNoJudge).toBe(true); | ||
}); | ||
|
||
it('should return false when status is ConfirmedWithoutJudge', () => { | ||
component.bookingDetails = { Status: 'ConfirmedWithoutJudge' } as any; | ||
expect(component.hasNoJudge).toBe(true); | ||
}); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
...e/AdminWebsite/ClientApp/src/app/bookings-list/booking-status/booking-status.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,29 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { BookingsDetailsModel } from '../../common/model/bookings-list.model'; | ||
@Component({ | ||
selector: 'app-booking-status', | ||
templateUrl: './booking-status.component.html', | ||
styleUrls: ['./booking-status.component.scss'] | ||
}) | ||
export class BookingStatusComponent { | ||
@Input() bookingDetails: BookingsDetailsModel; | ||
@Input() showTime = false; | ||
|
||
public get statusMessage(): string { | ||
switch (this.bookingDetails.Status) { | ||
case 'Created': | ||
case 'ConfirmedWithoutJudge': | ||
return 'Confirmed'; | ||
case 'Cancelled': | ||
return 'Cancelled'; | ||
case 'Failed': | ||
return 'Failed'; | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
public get hasNoJudge(): boolean { | ||
return this.bookingDetails.Status === 'BookedWithoutJudge' || this.bookingDetails.Status === 'ConfirmedWithoutJudge'; | ||
} | ||
} |
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
Oops, something went wrong.