- <div class="container-fluid body-container">
+ <div class="container-fluid body-container">
<div class="container">
<!-- <div class="creat-action-container">
<div class="package-name-container">
<div class="row">
<div class="col-12 package-name deployed">
- Package Name
+ {{viewedPackage.artifactName}}
<span>.vLB.CDS</span>
<i class="icon-deploy"></i>
</div>
<div class="col-12 package-description">
- Last modified Oct 4, 2019 03:48 PM By Ahmed Abbas
+ Last modified {{ viewedPackage.createdDate | date:'short' }} By {{viewedPackage.updatedBy}}
</div>
</div>
</div>
</div>
<div class="col-4 package-view-button">
- <button class="btn btn-sm btn-outline-secondary"><i class="fa fa-play-circle"></i> Deploy</button>
+ <button class="btn btn-sm btn-outline-secondary" (click)="deployCurrentPackage()"><i class="fa fa-play-circle"></i> Deploy</button>
+ <button class="btn btn-sm btn-outline-secondary" (click)="downloadPackage(viewedPackage.artifactName,viewedPackage.artifactVersion)"><i class="fa"></i> Download</button>
+
<button class="btn btn-sm btn-primary">Designer Mode</button>
</div>
</div>
import {PackageCreationUtils} from '../package-creation/package-creation.utils';
import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes';
import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder';
-
+import {saveAs} from 'file-saver';
@Component({
selector: 'app-configuration-dashboard',
private filesData: any = [];
private folder: FolderNodeElement = new FolderNodeElement();
+ private currentBlob = new Blob();
+
constructor(private route: ActivatedRoute, private configurationDashboardService: ConfigurationDashboardService,
private packageCreationStore: PackageCreationStore,
private packageCreationUtils: PackageCreationUtils,
this.configurationDashboardService.getPagedPackages(id).subscribe(
(bluePrintDetailModels) => {
if (bluePrintDetailModels) {
+ this.viewedPackage = bluePrintDetailModels[0];
this.downloadCBAPackage(bluePrintDetailModels);
}
});
this.configurationDashboardService.downloadResource(
bluePrintDetailModels[0].artifactName + '/' + bluePrintDetailModels[0].artifactVersion).subscribe(response => {
const blob = new Blob([response], {type: 'application/octet-stream'});
+ this.currentBlob = blob;
this.zipFile.loadAsync(blob).then((zip) => {
Object.keys(zip.files).forEach((filename) => {
console.log(filename);
goBacktoDashboard() {
this.router.navigate(['/packages']);
}
+
+ downloadPackage(artifactName: string, artifactVersion: string) {
+ this.configurationDashboardService.downloadResource(artifactName + '/' + artifactVersion).subscribe(response => {
+ const blob = new Blob([response], {type: 'application/octet-stream'});
+ saveAs(blob, artifactName + '-' + artifactVersion + '-CBA.zip');
+ });
+ }
+
+ deployCurrentPackage() {
+ console.log('happened');
+ /* this.zipFile.generateAsync({type: 'blob'})
+ .then(blob => {
+ const formData = new FormData();
+ formData.append('file', this.currentBlob);
+ this.configurationDashboardService.deployPost(formData)
+ .subscribe(data => {
+ }, error => {
+ });
+ this.router.navigate(['/packages']);
+ });
+ */
+ this.router.navigate(['/packages']);
+ }
+
}
private getBluePrintModel(id: string): Observable<BluePrintDetailModel> {
return this.api.getOne(BlueprintURLs.getOneBlueprint + '/' + id);
}
+
getPagedPackages(id: string) {
return this.getBluePrintModel(id);
}
return this.api.getCustomized(BlueprintURLs.download + path, {responseType: 'blob'});
}
+ deployPost(body: any | null): Observable<any> {
+ return this.api.post(BlueprintURLs.deploy, body, {responseType: 'text'});
+ }
}
+++ /dev/null
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2019 Orange. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import {Injectable} from '@angular/core';
-import {Store} from '../../../../common/core/stores/Store';
-import {ConfigurationDashboardService} from './configuration-dashboard.service';
-import {PackageDashboardState} from '../model/package-dashboard.state';
-import {BlueprintURLs} from '../../../../common/constants/app-constants';
-import * as JSZip from 'jszip';
-
-@Injectable({
- providedIn: 'root'
-})
-export class PackageStore extends Store<PackageDashboardState> {
-
- private zipFile: JSZip = new JSZip();
-
- constructor(private configurationDashboardService: ConfigurationDashboardService) {
- super(new PackageDashboardState());
- }
-
- /* getPagedPackages(id: string) {
- return this.configurationDashboardService.getBluePrintModel(id);
- }
-
- public downloadResource(path: string) {
- return this.configurationDashboardService.downloadResource(BlueprintURLs.download + path);
- }*/
-
-
-}
import {PackageCreationService} from '../package-creation.service';
import {MetaDataTabModel} from '../mapping-models/metadata/MetaDataTab.model';
import {PackageCreationStore} from '../package-creation.store';
-import {PackageStore} from '../../configuration-dashboard/package.store';
import {ActivatedRoute} from '@angular/router';
constructor(private route: ActivatedRoute,
private packageCreationService: PackageCreationService,
- private packageCreationStore: PackageCreationStore,
- private packageStore: PackageStore) {
+ private packageCreationStore: PackageCreationStore
+ ) {
}
-import { Component, OnInit } from '@angular/core';
-import { FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop';
-import { PackageCreationStore } from '../package-creation.store';
-import { PackageCreationUtils } from '../package-creation.utils';
+import {Component, OnInit} from '@angular/core';
+import {FileSystemFileEntry, NgxFileDropEntry} from 'ngx-file-drop';
+import {PackageCreationStore} from '../package-creation.store';
import 'ace-builds/src-noconflict/ace';
import 'ace-builds/webpack-resolver';
-import { PackageStore } from '../../configuration-dashboard/package.store';
@Component({
selector: 'app-scripts-tab',
constructor(
private packageCreationStore: PackageCreationStore,
- private packageCreationUtils: PackageCreationUtils,
- private packageStore: PackageStore
) {
}
}
});
- this.packageStore.state$.subscribe(res => {
- // this.scriptsFiles =
- console.log('from scripts');
- console.log(res.scripts);
- this.scriptsFiles = res.scripts.files;
- });
+ /* this.packageStore.state$.subscribe(res => {
+ // this.scriptsFiles =
+ console.log('from scripts');
+ console.log(res.scripts);
+ this.scriptsFiles = res.scripts.files;
+ });*/
}
public dropped(files: NgxFileDropEntry[]) {