aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
diff options
context:
space:
mode:
authorShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-09-13 14:16:23 +0200
committerShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-09-13 14:16:23 +0200
commit3ccdf7e6e266578b98063e898b4acca0f1d15eda (patch)
tree0e0d562eea0b7d96990ca6e1c9b704dcd670a901 /cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
parent8de37f9d3035b4a41e696b967f2222806c250925 (diff)
keeping package changes safe
give user chance to discard changes or save changes Issue-ID: CCSDK-2336 Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com> Change-Id: If1e1c94ef65822428f25cca071103c9022add144
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
index 71afa155d..968d4e16a 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
@@ -16,13 +16,14 @@ import {DesignerStore} from '../designer/designer.store';
import {ToastrService} from 'ngx-toastr';
import {NgxFileDropEntry} from 'ngx-file-drop';
import {PackageCreationService} from '../package-creation/package-creation.service';
+import {ComponentCanDeactivate} from '../../../../common/core/canDactivate/ComponentCanDeactivate';
@Component({
selector: 'app-configuration-dashboard',
templateUrl: './configuration-dashboard.component.html',
styleUrls: ['./configuration-dashboard.component.css'],
})
-export class ConfigurationDashboardComponent implements OnInit {
+export class ConfigurationDashboardComponent extends ComponentCanDeactivate implements OnInit {
viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();
@ViewChild(MetadataTabComponent, {static: false})
metadataTabComponent: MetadataTabComponent;
@@ -55,6 +56,7 @@ export class ConfigurationDashboardComponent implements OnInit {
private designerStore: DesignerStore,
private toastService: ToastrService
) {
+ super();
this.packageCreationStore.state$.subscribe(
cbaPackage => {
this.cbaPackage = cbaPackage;
@@ -329,4 +331,9 @@ export class ConfigurationDashboardComponent implements OnInit {
clickEvent() {
this.isSaveEnabled = true;
}
+
+ canDeactivate(): boolean {
+ return this.isSaveEnabled;
+ }
+
}