aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui
diff options
context:
space:
mode:
authorShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-10-25 09:33:06 +0200
committerShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-10-25 09:33:06 +0200
commit2ff6fb3cea9fb67e4c337d3a8a293e05dfcbed9d (patch)
tree5523708c1e6e32da196ad13f6630634b40ff7e98 /cds-ui
parenta6b53aac7ee7c2b201689dc7d0755d9dc3c01083 (diff)
designer view from packages dashboard
-delete package with id Issue-ID: CCSDK-2483 Issue-ID: CCSDK-2942 Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com> Change-Id: I517fb265b991a522a987bbfb628ec877cbb53db7
Diffstat (limited to 'cds-ui')
-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);
+ });
+
+ }
}