summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/designer-client/src/app/modules')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html5
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts36
2 files changed, 29 insertions, 12 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html
index 0bb4f1f41..0b03f4dde 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html
@@ -63,7 +63,7 @@
</a>
</li>
<li class="action-delete">
- <a href="#">
+ <a (click)="deletePackage(bluePrint.id)">
<i class="icon-delete-sm" aria-hidden="true"></i>
Delete
</a>
@@ -111,7 +111,7 @@
class="icon-btn-card-config" aria-hidden="true"></i>Configuration</button>
</div>
<div class="col">
- <button type="button" class="btn btn-card-topology"><i class="icon-btn-card-topology"
+ <button type="button" (click)="viewDesigner(bluePrint.id)" class="btn btn-card-topology"><i class="icon-btn-card-topology"
aria-hidden="true"></i>Designer Mode
</button>
</div>
@@ -125,3 +125,4 @@
<app-import-package></app-import-package>
+
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts
index 4d0e108cf..44c4a7168 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts
@@ -1,11 +1,12 @@
-import { Component, OnInit } from '@angular/core';
-import { BlueprintModel } from '../../model/BluePrint.model';
-import { PackagesStore } from '../../packages.store';
-import { Router } from '@angular/router';
-import { ConfigurationDashboardService } from '../../configuration-dashboard/configuration-dashboard.service';
-import { saveAs } from 'file-saver';
-import { NgxUiLoaderService } from 'ngx-ui-loader';
-import { TourService } from 'ngx-tour-md-menu';
+import {Component, OnInit} from '@angular/core';
+import {BlueprintModel} from '../../model/BluePrint.model';
+import {PackagesStore} from '../../packages.store';
+import {Router} from '@angular/router';
+import {ConfigurationDashboardService} from '../../configuration-dashboard/configuration-dashboard.service';
+import {saveAs} from 'file-saver';
+import {NgxUiLoaderService} from 'ngx-ui-loader';
+import {TourService} from 'ngx-tour-md-menu';
+import {ToastrService} from 'ngx-toastr';
@Component({
selector: 'app-packages-list',
@@ -23,11 +24,11 @@ export class PackageListComponent implements OnInit {
private configurationDashboardService: ConfigurationDashboardService,
private ngxLoader: NgxUiLoaderService,
private tourService: TourService,
+ private toastService: ToastrService
) {
console.log('PackageListComponent');
-
this.packagesStore.state$.subscribe(state => {
console.log(state);
if (state.filteredPackages) {
@@ -51,8 +52,23 @@ export class PackageListComponent implements OnInit {
downloadPackage(artifactName: string, artifactVersion: string) {
this.configurationDashboardService.downloadResource(artifactName + '/' + artifactVersion).subscribe(response => {
- const blob = new Blob([response], { type: 'application/octet-stream' });
+ const blob = new Blob([response], {type: 'application/octet-stream'});
saveAs(blob, artifactName + '-' + artifactVersion + '-CBA.zip');
});
}
+
+ viewDesigner(id: string) {
+ this.router.navigate(['/packages/designer', id]);
+ }
+
+ deletePackage(id: string) {
+ this.configurationDashboardService.deletePackage(id).subscribe(res => {
+ this.toastService.info('package deleted successfully ');
+ this.router.navigate(['/packages']);
+ this.packagesStore.getAll();
+ }, err => {
+ this.toastService.error('error deleting package' + err.message);
+ });
+
+ }
}