diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2019-05-21 20:12:12 +0530 |
---|---|---|
committer | Nirvan Ramjuttun <nirvan.ramjuttun@amdocs.com> | 2019-05-28 14:57:11 -0400 |
commit | 31d2c64ad5be592ded39e5cd19c364e13ebe2345 (patch) | |
tree | fd2b2e1747501ca03b6dd52b1d57db867949a53c /cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts | |
parent | 7679f2d1b19d8192e7a88e9b66687f7960315353 (diff) |
Fixed defect CCSDK-1339
Fixed defect ccsdk-1339
Issue-ID: CCSDK-1339
Change-Id: Iabf12c0c7430cda9a259d1917f344d58c432bd05
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts')
-rw-r--r-- | cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts index 2327a5839..609aacae7 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts @@ -23,13 +23,12 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { Observable } from 'rxjs'; import { Store } from '@ngrx/store'; -import { A11yModule } from '@angular/cdk/a11y'; import { IAppState } from '../../../../common/core/store/state/app.state'; import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model'; import { IBlueprint } from 'src/app/common/core/store/models/blueprint.model'; import { IMetaData } from '../../../../common/core/store/models/metadata.model'; -import { LoadBlueprintSuccess } from 'src/app/common/core/store/actions/blueprint.action'; +import { SetBlueprintState } from 'src/app/common/core/store/actions/blueprint.action'; @Component({ selector: 'app-metadata', @@ -41,6 +40,13 @@ export class MetadataComponent implements OnInit { metadata: IMetaData; bpState: Observable<IBlueprintState>; blueprint: IBlueprint; + filesTree: any = []; + filesData: any = []; + selectedFile: string; + zipFolder: any; + blueprintName: string; + uploadedFileName: string; + entryDefinition: string; constructor(private formBuilder: FormBuilder, private store: Store<IAppState>) { this.bpState = this.store.select('blueprint'); @@ -58,6 +64,16 @@ export class MetadataComponent implements OnInit { this.bpState.subscribe( blueprintdata => { var blueprintState: IBlueprintState = { blueprint: blueprintdata.blueprint, isLoadSuccess: blueprintdata.isLoadSuccess, isSaveSuccess: blueprintdata.isSaveSuccess, isUpdateSuccess: blueprintdata.isUpdateSuccess }; + this.blueprint = blueprintState.blueprint; + this.filesTree = blueprintdata.files; + this.filesData = blueprintdata.filesData; + this.blueprintName = blueprintdata.name; + this.uploadedFileName = blueprintdata.uploadedFileName; + this.entryDefinition = blueprintdata.entryDefinition; + + + + var blueprintState: IBlueprintState = { blueprint: blueprintdata.blueprint, isLoadSuccess: blueprintdata.isLoadSuccess, isSaveSuccess: blueprintdata.isSaveSuccess, isUpdateSuccess: blueprintdata.isUpdateSuccess }; this.metadata = blueprintState.blueprint.metadata; this.blueprint = blueprintState.blueprint; let metadatavalues = []; @@ -82,7 +98,21 @@ export class MetadataComponent implements OnInit { UploadMetadata() { this.metadata = Object.assign({}, this.CBAMetadataForm.value); this.blueprint.metadata = this.metadata; - this.store.dispatch(new LoadBlueprintSuccess(this.blueprint)); + + this.filesData.forEach((fileNode) => { + if (fileNode.name.includes(this.blueprintName) && fileNode.name == this.entryDefinition) { + fileNode.data = JSON.stringify(this.blueprint, null, "\t"); + } + }); + let blueprintState = { + blueprint: this.blueprint, + name: this.blueprintName, + files: this.filesTree, + filesData: this.filesData, + uploadedFileName: this.uploadedFileName, + entryDefinition: this.entryDefinition + } + this.store.dispatch(new SetBlueprintState(blueprintState)); } }
\ No newline at end of file |