From 73bb2c3bce83d9d87413c28c8fd3b21b97038898 Mon Sep 17 00:00:00 2001 From: William Nolin Date: Fri, 10 Sep 2021 07:55:24 -0400 Subject: [PATCH] #14 Add messages in the color list --- .../modules/colors/pages/list/list.component.html | 12 +++++++++--- .../modules/colors/pages/list/list.component.ts | 8 ++++++-- .../modules/shared/components/alerts/alerts.html | 3 +++ .../shared/components/alerts/alerts.module.ts | 14 ++++++++++++++ src/app/modules/shared/components/alerts/alerts.ts | 9 +++++++++ .../shared/components/subscribing.component.ts | 4 ++++ src/app/modules/shared/shared.module.ts | 4 +++- 7 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 src/app/modules/shared/components/alerts/alerts.html create mode 100644 src/app/modules/shared/components/alerts/alerts.module.ts create mode 100644 src/app/modules/shared/components/alerts/alerts.ts diff --git a/src/app/modules/colors/pages/list/list.component.html b/src/app/modules/colors/pages/list/list.component.html index 7b938d7..d06df5d 100644 --- a/src/app/modules/colors/pages/list/list.component.html +++ b/src/app/modules/colors/pages/list/list.component.html @@ -20,9 +20,15 @@ -
-

Il n'y a actuellement aucune recette enregistrée dans le système.

-

Vous pouvez en créer une ici.

+
+ +

Il n'y a actuellement aucune bannière enregistrée dans le système.

+

Vous pouvez en créer une ici.

+
+ +

Il n'y a actuellement aucune recette enregistrée dans le système.

+

Vous pouvez en créer une ici.

+
+ +
diff --git a/src/app/modules/shared/components/alerts/alerts.module.ts b/src/app/modules/shared/components/alerts/alerts.module.ts new file mode 100644 index 0000000..110fde4 --- /dev/null +++ b/src/app/modules/shared/components/alerts/alerts.module.ts @@ -0,0 +1,14 @@ +import {NgModule} from '@angular/core'; +import {WarningAlert} from './alerts'; + +@NgModule({ + declarations: [ + WarningAlert + ], + exports: [ + WarningAlert + ], + imports: [] +}) +export class CreAlertsModule { +} diff --git a/src/app/modules/shared/components/alerts/alerts.ts b/src/app/modules/shared/components/alerts/alerts.ts new file mode 100644 index 0000000..e150819 --- /dev/null +++ b/src/app/modules/shared/components/alerts/alerts.ts @@ -0,0 +1,9 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'cre-warning-alert', + templateUrl: 'alerts.html' +}) +export class WarningAlert { + +} diff --git a/src/app/modules/shared/components/subscribing.component.ts b/src/app/modules/shared/components/subscribing.component.ts index a31dcd4..d003d0a 100644 --- a/src/app/modules/shared/components/subscribing.component.ts +++ b/src/app/modules/shared/components/subscribing.component.ts @@ -11,6 +11,8 @@ export abstract class SubscribingComponent implements OnInit, OnDestroy { protected subscribers$ = [] protected destroy$ = new Subject() + loading = false + protected constructor( protected errorService: ErrorService, protected activatedRoute: ActivatedRoute, @@ -74,12 +76,14 @@ export abstract class SubscribingComponent implements OnInit, OnDestroy { protected showLoadingWheel(shouldShowWheel) { if (shouldShowWheel) { + this.loading = true globalLoadingWheel.show() } } protected hideLoadingWheel(shouldShowWheel) { if (shouldShowWheel) { + this.loading = false globalLoadingWheel.hide() } } diff --git a/src/app/modules/shared/shared.module.ts b/src/app/modules/shared/shared.module.ts index 05aaf24..d30b0b4 100644 --- a/src/app/modules/shared/shared.module.ts +++ b/src/app/modules/shared/shared.module.ts @@ -37,6 +37,7 @@ import {CreFormsModule} from './components/forms/forms.module' import {VarDirective} from './directives/var.directive' import {CreColorPreview} from './components/color-preview/color-preview' import {CreDialogsModule} from './components/dialogs/dialogs.module' +import {CreAlertsModule} from './components/alerts/alerts.module'; @NgModule({ declarations: [VarDirective, HeaderComponent, UserMenuComponent, LabeledIconComponent, ConfirmBoxComponent, PermissionsListComponent, PermissionsFieldComponent, NavComponent, EntityListComponent, EntityAddComponent, EntityEditComponent, FileButtonComponent, GlobalAlertHandlerComponent, SliderFieldComponent, LoadingWheelComponent, CreColorPreview], @@ -73,7 +74,8 @@ import {CreDialogsModule} from './components/dialogs/dialogs.module' CreFormsModule, VarDirective, CreColorPreview, - CreDialogsModule + CreDialogsModule, + CreAlertsModule ], imports: [ MatTabsModule,