diff options
author | shaaban Altanany <shaaban.eltanany.ext@orange.com> | 2020-02-27 16:35:57 +0200 |
---|---|---|
committer | shaaban Altanany <shaaban.eltanany.ext@orange.com> | 2020-02-27 17:33:43 +0200 |
commit | b2b847587d7c06db5737a06820d1809b9aeb73e1 (patch) | |
tree | c927c31a70e9232554dd8bc4d5bc681a0a92b52d /cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/package.store.ts | |
parent | 71f6d98f1003dc9acc212e4132f03bb21c0b73c8 (diff) |
Adding view and edit feature
Issue-ID: CCSDK-2123
Signed-off-by: shaaban Altanany <shaaban.eltanany.ext@orange.com>
Change-Id: I6fa4469a982a3c6f76002909813480c9ac4d0e65
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/package.store.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/package.store.ts | 56 |
1 files changed, 8 insertions, 48 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/package.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/package.store.ts index 4669ef12d..49de59e62 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/package.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/package.store.ts @@ -19,11 +19,11 @@ 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 {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({ @@ -37,53 +37,13 @@ export class PackageStore extends Store<PackageDashboardState> { super(new PackageDashboardState()); } - getPagedPackages(id: string) { + /* getPagedPackages(id: string) { return this.configurationDashboardService.getBluePrintModel(id); } public downloadResource(path: string) { - console.log('download resource xx'); - this.configurationDashboardService.downloadResource(BlueprintURLs.download + path).subscribe(response => { - console.log('try to download '); - const blob = new Blob([response], { type: 'application/octet-stream' }); - this.zipFile.loadAsync(blob).then((zip) => { - Object.keys(zip.files).forEach((filename) => { - console.log(filename); - zip.files[filename].async('string').then((fileData) => { - if (fileData) { - if (filename.includes('Scripts/')) { - this.setScripts(filename, fileData); - } else if (filename.includes('templates/')) { - this.setTemplates(filename, fileData); - } else if (filename.includes('definitions/')) { - this.setImports(filename, fileData); - } - } - }); - }); - }); - }); - } - - setConfiguration(bluePrintDetailModels) { - this.setState({ - ...this.state, - configuration: bluePrintDetailModels[0] - }); - } - - private setScripts(filename: string, fileData: any) { - this.setState({ - ...this.state, - scripts: this.state.scripts.setScripts(filename, fileData) - }); - } + return this.configurationDashboardService.downloadResource(BlueprintURLs.download + path); + }*/ - private setImports(filename: string, fileData: any) { - } - - private setTemplates(filename: string, fileData: any) { - - } } |