From 460863587941adebd657e88e827f28a77094d9f7 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 11 May 2022 18:46:51 +0300 Subject: [PATCH] Claims: add alert when add or remove from the basket --- claims/claim-utils/claimResults.component.ts | 25 +++++++++++++++++-- .../selected/selectedResults.component.ts | 7 +++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/claims/claim-utils/claimResults.component.ts b/claims/claim-utils/claimResults.component.ts index 631f6a3f..71170a35 100644 --- a/claims/claim-utils/claimResults.component.ts +++ b/claims/claim-utils/claimResults.component.ts @@ -28,11 +28,11 @@ declare var UIkit: any; height="1"> - + - + @@ -78,6 +78,27 @@ export class ClaimResultsComponent { if (this.selectedResults != null) { localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.selectedResults)); } + UIkit.notification(item.type + ' added in your basket!', { + status: 'success', + timeout: 4000, + pos: 'bottom-right' + }); } } + + remove(item: any) { + const index: number = this.selectedResults.indexOf(item); + if (index > -1) { + this.selectedResults.splice(index, 1); + if (this.selectedResults != null) { + localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.selectedResults)); + } + UIkit.notification(item.type + ' removed from your basket!', { + status: 'warning', + timeout: 4000, + pos: 'bottom-right' + }); + } + + } } diff --git a/claims/linking/selected/selectedResults.component.ts b/claims/linking/selected/selectedResults.component.ts index add80f71..6119e1e1 100644 --- a/claims/linking/selected/selectedResults.component.ts +++ b/claims/linking/selected/selectedResults.component.ts @@ -1,6 +1,6 @@ import {Component, Input} from '@angular/core'; import {ClaimEntity} from '../../claim-utils/claimHelper.class'; - +declare var UIkit: any; @Component({ selector: 'claim-selected-results', templateUrl: 'selectedResults.component.html' @@ -24,6 +24,11 @@ export class ClaimSelectedResultsComponent { if (this.results != null) { localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.results)); } + UIkit.notification(item.type + ' removed from your basket!', { + status: 'warning', + timeout: 4000, + pos: 'bottom-right' + }); } }