From 2ea838f5725dea9329f05bd9fc08af2c28f7adc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 7 Oct 2021 23:11:08 +0300 Subject: [PATCH] Toast component --- apps/red-ui/src/app/app.module.ts | 5 ++-- .../app/components/toast/toast.component.html | 20 --------------- .../app/components/toast/toast.component.scss | 0 .../app/components/toast/toast.component.ts | 25 ------------------- libs/common-ui | 2 +- 5 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 apps/red-ui/src/app/components/toast/toast.component.html delete mode 100644 apps/red-ui/src/app/components/toast/toast.component.scss delete mode 100644 apps/red-ui/src/app/components/toast/toast.component.ts diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 0da640424..cb4138914 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -15,7 +15,6 @@ import { ServiceWorkerModule } from '@angular/service-worker'; import { environment } from '@environments/environment'; import { AuthModule } from './modules/auth/auth.module'; import { AuthErrorComponent } from '@components/auth-error/auth-error.component'; -import { ToastComponent } from '@components/toast/toast.component'; import { HttpCacheInterceptor } from '@redaction/red-cache'; import { NotificationsComponent } from '@components/notifications/notifications.component'; import { DownloadsListScreenComponent } from '@components/downloads-list-screen/downloads-list-screen.component'; @@ -35,7 +34,7 @@ import { SpotlightSearchComponent } from '@components/spotlight-search/spotlight import { PruningTranslationLoader } from '@utils/pruning-translation-loader'; import { DatePipe } from '@shared/pipes/date.pipe'; import * as links from '../assets/help-mode/links.json'; -import { HELP_DOCS, IqserHelpModeModule, MAX_RETRIES_ON_SERVER_ERROR, ServerErrorInterceptor } from '@iqser/common-ui'; +import { HELP_DOCS, IqserHelpModeModule, MAX_RETRIES_ON_SERVER_ERROR, ServerErrorInterceptor, ToastComponent } from '@iqser/common-ui'; import { KeycloakService } from 'keycloak-angular'; export function httpLoaderFactory(httpClient: HttpClient): PruningTranslationLoader { @@ -54,7 +53,7 @@ function cleanupBaseUrl(baseUrl: string) { const screens = [BaseScreenComponent, DownloadsListScreenComponent, UserProfileScreenComponent]; -const components = [AppComponent, AuthErrorComponent, ToastComponent, NotificationsComponent, SpotlightSearchComponent, ...screens]; +const components = [AppComponent, AuthErrorComponent, NotificationsComponent, SpotlightSearchComponent, ...screens]; @NgModule({ declarations: [...components], diff --git a/apps/red-ui/src/app/components/toast/toast.component.html b/apps/red-ui/src/app/components/toast/toast.component.html deleted file mode 100644 index 3006bdf3c..000000000 --- a/apps/red-ui/src/app/components/toast/toast.component.html +++ /dev/null @@ -1,20 +0,0 @@ -
-
- {{ title }} -
-
-
- {{ message }} -
- - -
-
- - - -
diff --git a/apps/red-ui/src/app/components/toast/toast.component.scss b/apps/red-ui/src/app/components/toast/toast.component.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/red-ui/src/app/components/toast/toast.component.ts b/apps/red-ui/src/app/components/toast/toast.component.ts deleted file mode 100644 index d420009f7..000000000 --- a/apps/red-ui/src/app/components/toast/toast.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component } from '@angular/core'; -import { Toast, ToastPackage, ToastrService } from 'ngx-toastr'; -import { ToasterOptions } from '@iqser/common-ui'; - -@Component({ - templateUrl: './toast.component.html', - styleUrls: ['./toast.component.scss'], -}) -export class ToastComponent extends Toast { - constructor(protected readonly _toastrService: ToastrService, readonly toastPackage: ToastPackage) { - super(_toastrService, toastPackage); - } - - get actions() { - return (this.options as ToasterOptions)?.actions; - } - - callAction($event: MouseEvent, action: () => void) { - $event.stopPropagation(); - if (action) { - action(); - } - this.remove(); - } -} diff --git a/libs/common-ui b/libs/common-ui index feaaa5d8d..cba1a476d 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit feaaa5d8dc9ebc1075e03a6e7b92f3ccec893fc3 +Subproject commit cba1a476d3c78d49d7aa8d0f816ff92b2d073400