diff options
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog')
2 files changed, 25 insertions, 19 deletions
diff --git a/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.html b/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.html index 8c71edfa7..ba32a2ede 100644 --- a/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.html +++ b/cds-ui/client/src/app/feature-modules/controller-catalog/create-catalog/create-catalog.component.html @@ -23,26 +23,26 @@ <mat-card-content> <form [formGroup]="CatalogFormData" (ngSubmit)="CreateCatalog()"> <mat-form-field class="form-field"> - <input matInput placeholder="Model Name" formControlName="Model_Name"> + <input matInput placeholder="Model Name" formControlName="modelName"> </mat-form-field> <mat-form-field class="form-field" > - <input matInput placeholder="User Id" formControlName="User_id"> + <input matInput placeholder="User Id" formControlName="updatedBy"> </mat-form-field> <mat-form-field class="form-field"> - <input matInput placeholder="Tags" formControlName="_tags"> + <input matInput placeholder="Tags" formControlName="tags"> </mat-form-field> <mat-form-field class="form-field"> - <mat-select matInput placeholder="Definition Type" formControlName="_type"> - <mat-option [value]="item" *ngFor="let item of definitionType">{{item.definitionType}}</mat-option> + <mat-select matInput placeholder="Definition Type" formControlName="definitionType"> + <mat-option [value]="item" *ngFor="let item of definitionType">{{item}}</mat-option> </mat-select> </mat-form-field> <mat-form-field class="form-field" > - <mat-select matInput placeholder="Derived From" formControlName="Derived_From"> - <mat-option [value]="item" *ngFor="let item of derivedFrom">{{item.derivedFrom}}</mat-option> + <mat-select matInput placeholder="Derived From" formControlName="derivedFrom"> + <mat-option [value]="item" *ngFor="let item of derivedFrom">{{item}}</mat-option> </mat-select> </mat-form-field> <mat-form-field class="form-field" > - <textarea matInput placeholder="Description" formControlName="_description"></textarea> + <textarea matInput placeholder="Description" formControlName="description"></textarea> </mat-form-field> <br> <div > 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 } |