diff options
author | 2020-09-29 20:45:58 +0200 | |
---|---|---|
committer | 2020-09-29 20:45:58 +0200 | |
commit | db9eee076faac066ff337193a9211d28cd206711 (patch) | |
tree | 3af9079ce73ec7cf8509eb780eb23b7c74d75406 /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer | |
parent | 30d59d2339aed659540c7af63e0de7644df2c3e6 (diff) |
Improve Manual Enrichment phase2.
Issue-ID: CCSDK-2542
Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com>
Change-Id: I4fba6371146761cc584f0b183955c021aa14a7bf
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer')
2 files changed, 32 insertions, 26 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts index 099d96615..19d000f8f 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts @@ -25,32 +25,32 @@ limitations under the License. import dagre from 'dagre'; import graphlib from 'graphlib'; -import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; +import {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core'; import * as joint from 'jointjs'; import './jointjs/elements/palette.function.element'; import './jointjs/elements/action.element'; import './jointjs/elements/board.function.element'; -import { DesignerStore } from './designer.store'; -import { ActionElementTypeName } from 'src/app/common/constants/app-constants'; -import { GraphUtil } from './graph.util'; -import { GraphGenerator } from './graph.generator.util'; -import { FunctionsStore } from './functions.store'; -import { Subject } from 'rxjs'; -import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; -import { BluePrintDetailModel } from '../model/BluePrint.detail.model'; -import { ActivatedRoute, Router } from '@angular/router'; -import { DesignerService } from './designer.service'; -import { FilesContent, FolderNodeElement } from '../package-creation/mapping-models/metadata/MetaDataTab.model'; -import { PackageCreationModes } from '../package-creation/creationModes/PackageCreationModes'; -import { PackageCreationBuilder } from '../package-creation/creationModes/PackageCreationBuilder'; -import { PackageCreationStore } from '../package-creation/package-creation.store'; -import { PackageCreationService } from '../package-creation/package-creation.service'; -import { PackageCreationUtils } from '../package-creation/package-creation.utils'; +import {DesignerStore} from './designer.store'; +import {ActionElementTypeName} from 'src/app/common/constants/app-constants'; +import {GraphUtil} from './graph.util'; +import {GraphGenerator} from './graph.generator.util'; +import {FunctionsStore} from './functions.store'; +import {Subject} from 'rxjs'; +import {distinctUntilChanged, takeUntil} from 'rxjs/operators'; +import {BluePrintDetailModel} from '../model/BluePrint.detail.model'; +import {ActivatedRoute, Router} from '@angular/router'; +import {DesignerService} from './designer.service'; +import {FilesContent, FolderNodeElement} from '../package-creation/mapping-models/metadata/MetaDataTab.model'; +import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes'; +import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder'; +import {PackageCreationStore} from '../package-creation/package-creation.store'; +import {PackageCreationService} from '../package-creation/package-creation.service'; +import {PackageCreationUtils} from '../package-creation/package-creation.utils'; import * as JSZip from 'jszip'; -import { PackageCreationExtractionService } from '../package-creation/package-creation-extraction.service'; -import { CBAPackage } from '../package-creation/mapping-models/CBAPacakge.model'; -import { TopologyTemplate } from './model/designer.topologyTemplate.model'; -import { ToastrService } from 'ngx-toastr'; +import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service'; +import {CBAPackage} from '../package-creation/mapping-models/CBAPacakge.model'; +import {TopologyTemplate} from './model/designer.topologyTemplate.model'; +import {ToastrService} from 'ngx-toastr'; @Component({ selector: 'app-designer', @@ -74,7 +74,7 @@ export class DesignerComponent implements OnInit, OnDestroy { paletteGraph: joint.dia.Graph; palettePaper: joint.dia.Paper; ngUnsubscribe = new Subject(); - opt = { tx: 100, ty: 100 }; + opt = {tx: 100, ty: 100}; filesData: any = []; folder: FolderNodeElement = new FolderNodeElement(); zipFile: JSZip = new JSZip(); @@ -117,7 +117,7 @@ export class DesignerComponent implements OnInit, OnDestroy { publishBluePrint() { this.create(); - this.zipFile.generateAsync({ type: 'blob' }) + this.zipFile.generateAsync({type: 'blob'}) .then(blob => { const formData = new FormData(); formData.append('file', blob); @@ -164,7 +164,7 @@ export class DesignerComponent implements OnInit, OnDestroy { this.packageCreationService.downloadPackage(this.viewedPackage.artifactName + '/' + this.viewedPackage.artifactVersion) .subscribe(response => { - const blob = new Blob([response], { type: 'application/octet-stream' }); + const blob = new Blob([response], {type: 'application/octet-stream'}); this.packageCreationExtractionService.extractBlobToStore(blob); }); } @@ -226,9 +226,10 @@ export class DesignerComponent implements OnInit, OnDestroy { setLinkVertices: false, marginX: 10, marginY: 10, - clusterPadding: { top: 100, left: 30, right: 10, bottom: 100 }, + clusterPadding: {top: 100, left: 30, right: 10, bottom: 100}, rankDir: 'TB' }); + this.actions = []; for (const workflowsKey in topologtTemplate.workflows) { if (workflowsKey && !this.actions.includes(workflowsKey)) { this.actions.push(workflowsKey); @@ -455,7 +456,7 @@ export class DesignerComponent implements OnInit, OnDestroy { saveBluePrintToDataBase() { this.create(); - this.zipFile.generateAsync({ type: 'blob' }) + this.zipFile.generateAsync({type: 'blob'}) .then(blob => { this.packageCreationService.savePackage(blob).subscribe( bluePrintDetailModels => { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts index 0d20f9662..e07fbb94d 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts @@ -144,4 +144,9 @@ export class DesignerStore extends Store<DesignerDashboardState> { } }); } + + clear() { + this.setState(new DesignerDashboardState()); + } + } |