aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui
diff options
context:
space:
mode:
authorSwapnali Shadanan Pode <sp00501638@techmahindra.com>2019-02-27 18:59:01 +0530
committerSwapnali Shadanan Pode <sp00501638@techmahindra.com>2019-02-27 18:59:01 +0530
commitda0513b20439ea36c3a424334b95c4bbcba519b5 (patch)
treedd0de2f24806e7a952217c63f485d89b8c8de833 /cds-ui
parent0995b06fc7e10dd8607ed4fbcb53a15418a8b2f3 (diff)
Adding metadata changes and json file
Change-Id: I3498d5ec8239bfcfcc4b2630ccd65637c1b0801a Issue-ID: CCSDK-804 Signed-off-by: sp00501638 <sp00501638@techmahindra.com>
Diffstat (limited to 'cds-ui')
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html8
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts22
-rw-r--r--cds-ui/client/src/assets/sample-licenses.json29
3 files changed, 54 insertions, 5 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 015fd7dfa..2ee660fbd 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
@@ -25,9 +25,15 @@
<input matInput placeholder="Tags" formControlName="_tags">
</mat-form-field>
<mat-form-field class="form-field">
- <input matInput placeholder="Type" formControlName="_type">
+ <input matInput placeholder="Data Type" formControlName="_type">
</mat-form-field>
<mat-form-field class="form-field" >
<textarea matInput placeholder="Description" formControlName="_description"></textarea>
</mat-form-field>
+ <mat-form-field class="form-field" >
+ <input matInput placeholder="required" formControlName="_required">
+ </mat-form-field>
+ <mat-form-field class="form-field" >
+ <input matInput placeholder="entry_schema" formControlName="entry_schema">
+ </mat-form-field>
</form> \ 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.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts
index 119b7a80e..bc309f4f8 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
@@ -20,6 +20,7 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
+import sample_licenses from '../../../../../assets/sample-licenses.json';
@Component({
selector: 'app-resource-metadata',
@@ -29,15 +30,28 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms';
export class ResourceMetadataComponent implements OnInit {
ResourceMetadata: FormGroup;
-
- constructor(private _formBuilder: FormBuilder) { }
-
- ngOnInit() {
+ data=sample_licenses;
+
+ constructor(private _formBuilder: FormBuilder) {
this.ResourceMetadata = this._formBuilder.group({
Resource_Name: ['', Validators.required],
_tags: ['', Validators.required],
_description : ['', Validators.required],
_type: ['', Validators.required],
+ _required: ['', Validators.required],
+ entry_schema: ['', Validators.required]
});
+ }
+
+ ngOnInit() {
+ this.ResourceMetadata = this._formBuilder.group({
+ Resource_Name: [this.data["name"], Validators.required],
+ _tags: [this.data["tags"], Validators.required],
+ _required : [this.data["property"]["required"], Validators.required],
+ _description : [this.data["property"]["description"], Validators.required],
+ _type: [this.data["property"]["type"], Validators.required],
+ entry_schema: [this.data["property"]["entry_schema"]["type"], Validators.required]
+ });
+
}
}
diff --git a/cds-ui/client/src/assets/sample-licenses.json b/cds-ui/client/src/assets/sample-licenses.json
new file mode 100644
index 000000000..c0f78ac55
--- /dev/null
+++ b/cds-ui/client/src/assets/sample-licenses.json
@@ -0,0 +1,29 @@
+{
+ "tags": "sample-licenses",
+ "name": "sample-licenses",
+ "property": {
+ "description" : " Sample Data for licences",
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "dt-license-key"
+ }
+ },
+ "updated-by": "brindasanth@onap.com",
+ "sources": {
+ "primary-config-data": {
+ "type": "source-rest",
+ "properties": {
+ "type": "JSON",
+ "url-path": "config/L3VNF-API:services/service-list/",
+ "path": "/licenses",
+ "input-key-mapping": {
+ },
+ "output-key-mapping": {
+ "licenses": "licenses"
+ },
+ "key-dependencies": []
+ }
+ }
+ }
+} \ No newline at end of file