-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pidp 1044 banner for server outage notification (#600)
Banner component added for server outage notification.
- Loading branch information
1 parent
4b2895b
commit c7434ba
Showing
13 changed files
with
230 additions
and
29 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
workspace/apps/pidp/src/app/features/auth/pages/login/banner-find.response.model.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,6 @@ | ||
export interface BannerFindResponse { | ||
component: string; | ||
status: string; | ||
header: string; | ||
body: string; | ||
} |
23 changes: 23 additions & 0 deletions
23
workspace/apps/pidp/src/app/features/auth/pages/login/login-resource.service.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,23 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { provideAutoSpy } from 'jest-auto-spies'; | ||
|
||
import { ApiHttpClient } from '@app/core/resources/api-http-client.service'; | ||
|
||
import { LoginResource } from './login-resource.service'; | ||
|
||
describe('LoginResource', () => { | ||
let service: LoginResource; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [provideAutoSpy(ApiHttpClient)], | ||
}); | ||
|
||
service = TestBed.inject(LoginResource); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
workspace/apps/pidp/src/app/features/auth/pages/login/login-resource.service.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,20 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
import { Observable } from 'rxjs'; | ||
|
||
import { ApiHttpClient } from '@app/core/resources/api-http-client.service'; | ||
|
||
import { BannerFindResponse } from './banner-find.response.model'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class LoginResource { | ||
public constructor(private apiResource: ApiHttpClient) {} | ||
|
||
public findBanners(component: string): Observable<BannerFindResponse[]> { | ||
return this.apiResource.get<BannerFindResponse[]>( | ||
`banners?component=${component}`, | ||
); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
workspace/apps/pidp/src/app/features/auth/pages/login/login.constants.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 @@ | ||
export const component = 'login'; |
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
15 changes: 15 additions & 0 deletions
15
workspace/apps/pidp/src/app/shared/components/banner/banner.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,15 @@ | ||
<div class="banner-container" uiPidpInjectViewportCss> | ||
<div class="banners-box"> | ||
<div *ngFor="let banner of banners"> | ||
<div class="card-styles card-header-icon banner-detail-box"> | ||
<h2> | ||
<img src="/assets/images/icons/icon-warning.svg" alt="banner-logo" /> | ||
<span>{{ banner.header }}</span> | ||
</h2> | ||
<div class="banner-detail-content"> | ||
{{ banner.body }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
43 changes: 43 additions & 0 deletions
43
workspace/apps/pidp/src/app/shared/components/banner/banner.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,43 @@ | ||
.viewport-all { | ||
& .banners-box { | ||
margin-top: 20%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
border: 2px solid rgba(255, 166, 0, 0.55); | ||
|
||
& .card-styles { | ||
background: rgba(255, 166, 0, 0.2); | ||
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
width: 27rem; | ||
padding: 0.75rem; | ||
|
||
h2 { | ||
color: #036; | ||
font-size: 1rem; | ||
font-weight: 700; | ||
padding-top: 0.25rem; | ||
margin-bottom: 0; | ||
span { | ||
padding-left: 10px; | ||
} | ||
} | ||
& .banner-detail-box { | ||
& .banner-detail-content { | ||
padding-left: 34px; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
.viewport-xsmall { | ||
& .banners-box { | ||
width: 18rem; | ||
margin-left: 15px; | ||
margin-right: 15px; | ||
& .card-styles { | ||
width: 17.9rem; | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
workspace/apps/pidp/src/app/shared/components/banner/banner.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,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { BannerComponent } from './banner.component'; | ||
|
||
describe('BannerComponent', () => { | ||
let component: BannerComponent; | ||
let fixture: ComponentFixture<BannerComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [BannerComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(BannerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
workspace/apps/pidp/src/app/shared/components/banner/banner.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,21 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { InjectViewportCssClassDirective } from '@bcgov/shared/ui'; | ||
|
||
@Component({ | ||
selector: 'app-banner', | ||
templateUrl: './banner.component.html', | ||
styleUrl: './banner.component.scss', | ||
standalone: true, | ||
imports: [CommonModule, InjectViewportCssClassDirective], | ||
}) | ||
export class BannerComponent { | ||
@Input() public banners: Array<{ | ||
header: string; | ||
body: string; | ||
status: string; | ||
}> = []; | ||
|
||
public constructor() {} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.