summaryrefslogtreecommitdiffstats
path: root/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts
diff options
context:
space:
mode:
authorSwapnali Shadanan Pode <sp00501638@techmahindra.com>2019-11-19 12:49:14 +0530
committerSwapnali Shadanan Pode <sp00501638@techmahindra.com>2019-11-19 12:49:14 +0530
commit54fb88cc8abe54300c45f9feec6ceafebc2a9349 (patch)
treec7bb4f2e1f96f1438dc332f54d510d0146f24919 /cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts
parent31c2f7de56c5dd90de17ec3026510e5cc660ae67 (diff)
Adding changes for catalog edit and create
Adding changes for catalog edit and create Change-Id: Ib9567e2e483b3abf56f61a77d5c82d4234ee97dc Issue-ID: CCSDK-810 Signed-off-by: Swapnali Shadanan Pode <sp00501638@techmahindra.com>
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts')
-rw-r--r--cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts28
1 files changed, 17 insertions, 11 deletions
diff --git a/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts b/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts
index 91c6f2835..3b8294db9 100644
--- a/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts
+++ b/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.ts
@@ -41,21 +41,21 @@ export class CreateCatalogComponent implements OnInit {
@ViewChild(JsonEditorComponent) editor: JsonEditorComponent;
options = new JsonEditorOptions();
data:any;
- derivedFrom: any[] = [{derivedFrom: 'tosca.nodes.Component'},{derivedFrom:'tosca.nodes.VNF'},{derivedFrom:'tosca.nodes.Artifact'},{derivedFrom:'tosca.nodes.ResourceSource'}, {derivedFrom:'tosca.nodes.Workflow'},{derivedFrom:'tosca.nodes.Root'}];
- definitionType: any[] = [{definitionType: 'node_type'}];
+ derivedFrom: any[] = ['tosca.nodes.Component','tosca.nodes.VNF','tosca.nodes.Artifact','tosca.nodes.ResourceSource','tosca.nodes.Workflow','tosca.nodes.Root'];
+ definitionType: any[] = ['node_type'];
ccState: Observable<ICatalogState>;
catalog: ICatalog;
constructor(private formBuilder: FormBuilder, private store: Store<IAppState>, private catalogCreateService: CreateCatalogService, private alertService: NotificationHandlerService) {
this.ccState = this.store.select('catalog');
this.CatalogFormData = this.formBuilder.group({
- Model_Name: ['', Validators.required],
- User_id: ['', Validators.required],
- _tags: ['', Validators.required],
- _type: ['', Validators.required],
- Derived_From: ['', Validators.required],
- _description : ['', Validators.required]
- });
+ modelName: ['', Validators.required],
+ updatedBy: ['', Validators.required],
+ tags: ['', Validators.required],
+ definitionType: ['', Validators.required],
+ derivedFrom: ['', Validators.required],
+ description : ['', Validators.required]
+ });
}
ngOnInit() {
this.options.mode = 'text';
@@ -90,8 +90,14 @@ export class CreateCatalogComponent implements OnInit {
// })
}
CreateCatalog(){
- this.catalog = Object.assign({}, this.CatalogFormData.value);
- this.catalog.definition=this.data;
+ this.catalog.modelName=this.CatalogFormData.controls['modelName'].value;
+ this.catalog.updatedBy=this.CatalogFormData.controls['updatedBy'].value
+ this.catalog.tags=this.CatalogFormData.controls['tags'].value
+ this.catalog.definitionType=this.CatalogFormData.controls['definitionType'].value
+ this.catalog.derivedFrom=this.CatalogFormData.controls['derivedFrom'].value
+ this.catalog.description=this.CatalogFormData.controls['description'].value
+ this.catalog.definition=this.data;
+ console.log(this.catalog);
let catalogState = {
catalog: this.catalog
}