diff options
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata')
3 files changed, 59 insertions, 28 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============================================ --> -<!-- <form [formGroup]="CBAMetadata"> --> - <mat-form-field class="form-field"> - <input matInput placeholder="CBA File Name" formControlName="CBA_File_Name"> - </mat-form-field> - <mat-form-field class="form-field"> - <input matInput placeholder="CBA Version" formControlName="CBA_Version"> - </mat-form-field> - <mat-form-field class="form-field"> - <input matInput placeholder="CSAR Version" formControlName="CSAR_Version"> - </mat-form-field> - <mat-form-field class="form-field"> - <input matInput placeholder="Entry Definition" formControlName="entry_Definition"> - </mat-form-field> - <mat-form-field class="form-field"> - <input matInput placeholder="Author" formControlName="author"> - </mat-form-field> - <!-- </form> --> +<form [formGroup]="CBAMetadataForm" (ngSubmit)="UploadMetadata()"> + <div class="formDisplay"> + <mat-form-field class="form-field"> + <input matInput placeholder="Template Author" id="CBA_File_Name" formControlName="template_author"> + </mat-form-field> + <mat-form-field class="form-field"> + <input matInput placeholder="Author Email" id="author_email" formControlName="author_email"> + </mat-form-field> + <mat-form-field class="form-field"> + <input matInput placeholder="User Groups" id="user_groups" formControlName="user_groups"> + </mat-form-field> + </div> + <div class="formDisplay"> + <mat-form-field class="form-field"> + <input matInput placeholder="Template Name" id="template_name" formControlName="template_name"> + </mat-form-field> + <mat-form-field class="form-field"> + <input matInput placeholder="Template Version" id="template_version" formControlName="template_version"> + </mat-form-field> + <mat-form-field class="form-field"> + <input matInput placeholder="Template Tags" id="template_tags" formControlName="template_tags"> + </mat-form-field> + </div> + <button mat-button class="matBtn" type="submit" [disabled]="!CBAMetadataForm.valid">Save Metadata</button> +</form>
\ 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<IMetaData>(); - 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 |