-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace error page navigation with alerts Move alert feature into `client-shared` library Remove duplicate material styles Fix http response errors being displayed as empty text Fix alert icons getting smaller on long error messages Fix lint errors
- Loading branch information
Showing
28 changed files
with
496 additions
and
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
<asset-sg-app-bar> | ||
<ng-template *ngIf="!router.url.includes('/error')" [cdkPortalOutlet]="appPortalService.appBarPortalContent$ | push"></ng-template> | ||
<ng-template [cdkPortalOutlet]="appPortalService.appBarPortalContent$ | push"></ng-template> | ||
</asset-sg-app-bar> | ||
<asset-sg-menu-bar *ngIf="!router.url.includes('/error')"/> | ||
<asset-sg-menu-bar /> | ||
<div class="router-outlet"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
<div class="drawer-portal" *ngIf="!router.url.includes('/error')"> | ||
<div class="drawer-portal"> | ||
<ng-template [cdkPortalOutlet]="appPortalService.drawerPortalContent$ | push"></ng-template> | ||
</div> | ||
<div class="alerts"> | ||
<ul app-alert-list></ul> | ||
</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
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
6 changes: 0 additions & 6 deletions
6
apps/client-asset-sg/src/app/components/error/error.component.html
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
apps/client-asset-sg/src/app/components/error/error.component.scss
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
apps/client-asset-sg/src/app/components/error/error.component.ts
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@use 'app/styles/variables'; | ||
@use 'app/styles/mixins' as mixins; | ||
@use '@angular/material' as mat; | ||
@use 'sass:map'; | ||
|
||
$asset-sg-palette: map.set(mat.$indigo-palette, 500, variables.$cyan-03); | ||
|
||
$asset-sg-primary: mat.define-palette($asset-sg-palette); | ||
$asset-sg-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400); | ||
$asset-sg-warn: mat.define-palette(mat.$red-palette); | ||
|
||
$asset-sg-theme: mat.define-light-theme( | ||
( | ||
color: ( | ||
primary: $asset-sg-primary, | ||
accent: $asset-sg-accent, | ||
warn: $asset-sg-warn, | ||
), | ||
) | ||
); | ||
|
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
7 changes: 7 additions & 0 deletions
7
libs/client-shared/src/lib/features/alert/alert-list/alert-list.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,7 @@ | ||
<ng-container *ngFor="let entry of alerts$ | async; trackBy: getAlertId"> | ||
<li | ||
app-alert | ||
[alert]="entry.alert" | ||
[metadata]="entry.metadata" | ||
></li> | ||
</ng-container> |
9 changes: 9 additions & 0 deletions
9
libs/client-shared/src/lib/features/alert/alert-list/alert-list.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,9 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
|
||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} |
18 changes: 18 additions & 0 deletions
18
libs/client-shared/src/lib/features/alert/alert-list/alert-list.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,18 @@ | ||
import { Component, inject } from '@angular/core'; | ||
import { Store } from '@ngrx/store'; | ||
|
||
import { AlertId } from '../alert.model'; | ||
import { AlertEntry, AlertState } from '../alert.reducer'; | ||
import { selectAlerts } from '../alert.selectors'; | ||
|
||
@Component({ | ||
selector: 'ul[app-alert-list]', | ||
templateUrl: './alert-list.component.html', | ||
styleUrls: ['./alert-list.component.scss'], | ||
}) | ||
export class AlertListComponent { | ||
private readonly store = inject(Store<AlertState>); | ||
readonly alerts$ = this.store.select(selectAlerts); | ||
|
||
getAlertId = (_index: number, entry: AlertEntry): AlertId => entry.alert.id; | ||
} |
10 changes: 10 additions & 0 deletions
10
libs/client-shared/src/lib/features/alert/alert.actions.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,10 @@ | ||
import { createAction, props } from '@ngrx/store'; | ||
|
||
import { Alert, AlertId } from './alert.model'; | ||
|
||
export const showAlert = createAction('[Alert] Create Alert', props<{ alert: Alert }>()); | ||
export const hideAlert = createAction('[Alert] Remove Alert', props<{ id: AlertId }>()); | ||
|
||
export type AlertAction = | ||
| typeof showAlert | ||
| typeof hideAlert |
Oops, something went wrong.