From 18ae6cc59d9c2be78088903010e22706e3a5e44b Mon Sep 17 00:00:00 2001 From: Swapnali Shadanan Pode Date: Fri, 29 Mar 2019 16:01:02 +0530 Subject: Resources metadata changes Change-Id: Ifddeb90d0e28ccc6023b5f7efe8568b41db08f84 Issue-ID: CCSDK-804 Signed-off-by: sp00501638 --- .../resource-metadata.component.html | 6 ++++- .../resource-metadata.component.scss | 7 +++++ .../resource-metadata.component.ts | 30 +++++++++++++++------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html index 0bbc0b7c1..3b35a9929 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */--> -
+ @@ -42,4 +42,8 @@ +
+
+ +
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.scss index d10ad488f..aa8ca61b5 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.scss +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.scss @@ -19,6 +19,13 @@ */ +.matStepNextBtn{ + color:white; + background:#3f51b5; + margin-top: 10px; + position: absolute; + border-radius: 1em; +} .meta-form { width: 100%; } diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts index 536be26cd..29244f0fb 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, EventEmitter, Output } from '@angular/core'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import { IResources } from 'src/app/common/core/store/models/resources.model'; import { IResourcesState } from 'src/app/common/core/store/models/resourcesState.model'; @@ -45,7 +45,8 @@ export class ResourceMetadataComponent implements OnInit { resources: IResources; propertyValues = []; property = []; - + @Output() resourcesData = new EventEmitter(); + constructor(private formBuilder: FormBuilder, private store: Store) { this.rdState = this.store.select('resources'); this.ResourceMetadata = this.formBuilder.group({ @@ -68,16 +69,27 @@ export class ResourceMetadataComponent implements OnInit { this.properties= resourcesState.resources.property; this.propertyValues= this.checkNested(this.properties); this.ResourceMetadata = this.formBuilder.group({ - Resource_Name: [this.resource_name, Validators.required], - _tags: [this.tags, Validators.required], - _description : [ this.propertyValues[0], Validators.required], - _type: [ this.propertyValues[1], Validators.required], - required: [ this.propertyValues[2], Validators.required], - entry_schema: [this.propertyValues[3]] + Resource_Name: [this.resource_name, Validators.required], + _tags: [this.tags, Validators.required], + _description : [ this.propertyValues[0], Validators.required], + _type: [ this.propertyValues[1], Validators.required], + required: [ JSON.stringify(this.propertyValues[2]), Validators.required], + entry_schema: [this.propertyValues[3]] }); }) } - + + UploadMetadata() { + + this.resources.name = this.ResourceMetadata.value.Resource_Name; + this.resources.tags = this.ResourceMetadata.value._tags; + this.resources.property.description = this.ResourceMetadata.value._description; + this.resources.property.type = this.ResourceMetadata.value._type; + this.resources.property.required = this.ResourceMetadata.value.required; + this.resources.property.entry_schema = this.ResourceMetadata.value.entry_schema; + this.resourcesData.emit(this.resources); + } + checkNested(obj) { for (let key in obj) { if (obj.hasOwnProperty(key)) { -- cgit 1.2.3-korg