From b8615b2844cf4141aa449898b16c2c1f57902217 Mon Sep 17 00:00:00 2001 From: Ezhilarasi Date: Thu, 14 Feb 2019 19:27:31 +0530 Subject: Update state of blueprint Change-Id: I11da8bc3ac64f88b47691575ea34ad0b25ef0e6d Issue-ID: CCSDK-703 Signed-off-by: Ezhilarasi --- .../metadata/metadata.component.html | 42 +++++++++++++--------- .../metadata/metadata.component.scss | 15 +++++++- .../select-template/metadata/metadata.component.ts | 30 ++++++++++------ .../select-template/select-template.component.ts | 35 +++++++++++++----- .../select-template/select-template.module.ts | 4 +++ 5 files changed, 90 insertions(+), 36 deletions(-) diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.html b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.html index 75d9462bd..cdfea2529 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.html +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.html @@ -19,20 +19,28 @@ limitations under the License. ============LICENSE_END============================================ --> - - - - - - - - - - - - - - - - - +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+ +
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss index fa7f2bf83..88ce560c0 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss @@ -18,7 +18,20 @@ See the License for the specific language governing permissions and limitations under the License. ============LICENSE_END============================================ */ -.form-field{ + +.form-field { width: 50%; margin: 10px; +} + +.formDisplay { + display: flex; + flex-direction: row; +} + +.matBtn { + color: white; + background: gray; + margin-top: 10px; + position: absolute; } \ No newline at end of file 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 b8f57cb5f..176cc55a7 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 @@ -19,8 +19,10 @@ limitations under the License. ============LICENSE_END============================================ */ -import { Component, OnInit} from '@angular/core'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import { Component, OnInit, EventEmitter, Output } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { IMetaData } from '../../../../common/core/store/models/metadata.model'; +import { A11yModule } from '@angular/cdk/a11y'; @Component({ selector: 'app-metadata', @@ -28,18 +30,26 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms'; styleUrls: ['./metadata.component.scss'] }) export class MetadataComponent implements OnInit { - CBAMetadata: FormGroup; + CBAMetadataForm: FormGroup; + metadata: IMetaData; + @Output() metadataform = new EventEmitter(); - constructor(private _formBuilder: FormBuilder) { } + constructor(private formBuilder: FormBuilder) { } ngOnInit() { - this.CBAMetadata = this._formBuilder.group({ - CBA_File_Name: ['', Validators.required], - CBA_Version: ['', Validators.required], - CSAR_Version: ['', Validators.required], - entry_Definition: ['', Validators.required], - author: ['', Validators.required] + this.CBAMetadataForm = this.formBuilder.group({ + template_author: ['', Validators.required], + author_email: ['', Validators.required], + user_groups: ['', Validators.required], + template_name: ['', Validators.required], + template_version: ['', Validators.required], + template_tags: ['', Validators.required] }); } + UploadMetadata() { + this.metadata = Object.assign({}, this.CBAMetadataForm.value); + console.log(this.metadata.template_author); + this.metadataform.emit(this.metadata); + } } \ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.ts index b4356a601..091dd35b2 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.ts +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.ts @@ -21,6 +21,11 @@ limitations under the License. import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { Store } from '@ngrx/store'; +import { IBlueprint } from 'src/app/common/core/store/models/blueprint.model'; +import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model'; +import { IMetaData } from 'src/app/common/core/store/models/metadata.model'; +import { IImportModel } from 'src/app/common/core/store/models/imports.model'; +import { ITopologyTemplate } from 'src/app/common/core/store/models/itopologytemplate.model'; @Component({ selector: 'app-select-template', @@ -28,19 +33,33 @@ import { Store } from '@ngrx/store'; styleUrls: ['./select-template.component.scss'] }) export class SelectTemplateComponent implements OnInit { - blueprint: any - myFile: File; /* property of File type */ + blueprint: IBlueprint; + topologyTemplate: ITopologyTemplate; + metaData: IMetaData; + blueprintState: IBlueprintState; + importModel: IImportModel; - constructor() { + constructor(private store: Store) { + this.importModel.file = ''; } - ngOnInit() { + ngOnInit() { } - fileChange(files: any) { - console.log(files); - this.myFile = files[0].nativeElement; + fileChange(topologyTemp: ITopologyTemplate) { + this.topologyTemplate = topologyTemp; + console.log(topologyTemp); } - upload(){ + metaDataDetail(data: IMetaData) { + this.metaData = data; + console.log("parent" + this.metaData.author_email); + } + upload() { + + } + saveBlueprintModel(){ + this.blueprint.toplogyTemplates=this.topologyTemplate; + this.blueprint.metadata= this.metaData; + // this.store.dispatch(new CreateBlueprint(this.blueprint)); } } diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.module.ts index 7458601fc..f586246d2 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.module.ts +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.module.ts @@ -20,11 +20,13 @@ limitations under the License. */ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { ReactiveFormsModule } from '@angular/forms'; import { TemplateOptionsComponent } from './template-options/template-options.component'; import { SearchTemplateComponent } from './search-template/search-template.component'; import { MetadataComponent } from './metadata/metadata.component'; import { SelectTemplateComponent } from './select-template.component'; import { SelectTemplateRoutingModule } from './select-template-routing.module'; +import { AppMaterialModule } from 'src/app/common/modules/app-material.module'; import { MatToolbarModule, MatButtonModule, MatSidenavModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule} from '@angular/material'; import { MatIconModule } from '@angular/material/icon'; @@ -45,6 +47,7 @@ import { MatIconModule } from '@angular/material/icon'; imports: [ CommonModule, SelectTemplateRoutingModule, + ReactiveFormsModule, MatToolbarModule, MatButtonModule, MatSidenavModule, @@ -61,6 +64,7 @@ import { MatIconModule } from '@angular/material/icon'; MatRadioModule, MatFormFieldModule, MatStepperModule, + AppMaterialModule ] }) export class SelectTemplateModule { } -- cgit 1.2.3-korg