diff options
author | 2019-11-19 12:49:14 +0530 | |
---|---|---|
committer | 2019-11-19 12:49:14 +0530 | |
commit | 54fb88cc8abe54300c45f9feec6ceafebc2a9349 (patch) | |
tree | c7bb4f2e1f96f1438dc332f54d510d0146f24919 /cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog | |
parent | 31c2f7de56c5dd90de17ec3026510e5cc660ae67 (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/search-catalog')
4 files changed, 39 insertions, 34 deletions
diff --git a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.html b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.html index ca4a679ed..34502bc95 100644 --- a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.html +++ b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.html @@ -21,27 +21,30 @@ <div> <h1 mat-dialog-title>Details</h1> <mat-dialog-content [formGroup]="CatalogFormData"> - <mat-form-field class="form-field"> - <input matInput placeholder="Model Name" formControlName="Model_Name"> - </mat-form-field> - <mat-form-field class="form-field" > - <input matInput placeholder="User Id" formControlName="User_id"> - </mat-form-field> - <mat-form-field class="form-field"> - <input matInput placeholder="Tags" formControlName="_tags"> - </mat-form-field> - <mat-form-field class="form-field"> + <mat-form-field class="form-field"> + <input matInput placeholder="Model Name" formControlName="modelName"> + </mat-form-field> + <mat-form-field class="form-field" > + <input matInput placeholder="User Id" formControlName="updatedBy"> + </mat-form-field> + <mat-form-field class="form-field"> + <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> --> - <input matInput placeholder="Definition Type" formControlName="_type"> - </mat-form-field> - <mat-form-field class="form-field" > + <input matInput placeholder="Definition Type" formControlName="definitionType"> + </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> --> - <input matInput placeholder="Derived From" formControlName="Derived_From"> - </mat-form-field> + <input matInput placeholder="Derived From" formControlName="derivedFrom"> + </mat-form-field> + <mat-form-field class="form-field" > + <textarea matInput placeholder="Definition" formControlName="definition"></textarea> + </mat-form-field> <br> </mat-dialog-content> <mat-dialog-actions *ngIf="!isDisabled"> diff --git a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.ts b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.ts index 215f311e9..b2748d871 100644 --- a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.ts +++ b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/catalog-data-dialog/catalog-data-dialog.component.ts @@ -62,12 +62,13 @@ export class CatalogDataDialogComponent implements OnInit{ this.ccState = this.store.select('catalog'); this.CatalogFormData = this.formBuilder.group({ - Model_Name: [{value:this.property[0], disabled: this.isDisabled}, Validators.required], - User_id: [{value:this.property[8], disabled: this.isDisabled}, Validators.required], - _tags: [{value:this.property[6], disabled: this.isDisabled}, Validators.required], - _type: [{value:this.property[2], disabled: this.isDisabled}, Validators.required], - Derived_From: [{value:this.property[1], disabled: this.isDisabled}, Validators.required], - }); + modelName: [{value:this.property[0], disabled: this.isDisabled}, Validators.required], + derivedFrom: [{value:this.property[1], disabled: this.isDisabled}, Validators.required], + definitionType: [{value:this.property[2], disabled: this.isDisabled}, Validators.required], + definition: [{value:JSON.stringify(this.property[3]), disabled: this.isDisabled}, Validators.required], + tags: [{value:this.property[6], disabled: this.isDisabled}, Validators.required], + updatedBy: [{value:this.property[8], disabled: this.isDisabled}, Validators.required], + }); } ngOnInit(){ diff --git a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.html b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.html index c8452e2ff..5262f1744 100644 --- a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.html +++ b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.html @@ -19,7 +19,7 @@ */--> <form class="search-form" [formGroup]="myControl"> <mat-form-field class="search-full-width"> - <input matInput type="text" [(ngModel)]="searchText" placeholder="Search Catalog" formControlName="search_input"> + <input matInput type="text" placeholder="Search Catalog" formControlName="search_input" #searchText> <button matSuffix mat-icon-button (click)="fetchCatalogByName()"> <mat-icon>search</mat-icon> </button> diff --git a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.ts b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.ts index 717e1088f..3fb4530e6 100644 --- a/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.ts +++ b/cds-ui/client/src/app/feature-modules/controller-catalog/search-catalog/search-catalog.component.ts @@ -109,19 +109,20 @@ export class SearchCatalogComponent implements OnInit { if(result == undefined || result == null){ console.log("dialogbox is closed"); }else{ - this.catalog.Model_Name=result['Model_Name']; - this.catalog.User_id=result['User_id']; - this.catalog._tags=result['_tags']; - this.catalog._type=result['_type']; - this.catalog.Derived_From=result['Derived_From']; - console.log(this.catalog); - this.catalogCreateService.saveCatalog(this.catalog) - .subscribe(response=>{ + this.catalog.modelName=result['modelName']; + this.catalog.derivedFrom=result['derivedFrom']; + this.catalog.definitionType=result['definitionType']; + this.catalog.definition=result['definition']; + this.catalog.tags=result['tags']; + this.catalog.updatedBy=result['updatedBy']; + console.log(this.catalog); + this.catalogCreateService.saveCatalog(this.catalog) + .subscribe(response=>{ this.alertService.success("save success"+ response) - }, - error=>{ - this.alertService.error('Error saving resources'); - }) + }, + error=>{ + this.alertService.error('Error saving resources'); + }) } }); } |