diff options
7 files changed, 22 insertions, 6 deletions
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java index b81e46bf4..81e30cf43 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java @@ -60,6 +60,7 @@ public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { private static void generatePayload(JsonObject childObject, Service serviceModel) { generatePayloadPerResource(childObject, "VF", serviceModel); generatePayloadPerResource(childObject, "PNF", serviceModel); + addToJsonArray(childObject, "anyOf", createBlankEntry()); } private static void generateOperation(JsonObject childObject, Service serviceModel) { @@ -113,6 +114,15 @@ public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { addToJsonArray(childObject, "anyOf", schemaAnyOf); } + private static JsonArray createBlankEntry() { + JsonArray result = new JsonArray(); + JsonObject blankObject = new JsonObject(); + blankObject.addProperty("title", "User defined"); + blankObject.add("properties", new JsonObject()); + result.add(blankObject); + return result; + } + private static JsonObject createPayloadProperty(JsonObject workFlow, JsonObject controllerProperties) { JsonObject payloadResult = new JsonObject(); diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java index e1d493a35..9721e33d9 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java @@ -259,6 +259,7 @@ public class ToscaConverterToJsonSchema { JsonObject componentAsItem = child.getJsonSchemaOfToscaElement(nameComponent); if (currentPropertyJsonTemplate.hasFields("properties")) { propertiesInJson.add("items", componentAsItem); + propertiesInJson.addProperty("format", "tabs-top"); } break; } @@ -271,6 +272,7 @@ public class ToscaConverterToJsonSchema { this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema"); itemContainer.addProperty("type", valueInEntrySchema); propertiesInJson.add("items", itemContainer); + propertiesInJson.addProperty("format", "tabs-top"); } // MAP Case, for now nothing diff --git a/src/test/resources/tosca/new-converter/tca-with-metadata.json b/src/test/resources/tosca/new-converter/tca-with-metadata.json index 1b95f8c95..3a700c8ee 100644 --- a/src/test/resources/tosca/new-converter/tca-with-metadata.json +++ b/src/test/resources/tosca/new-converter/tca-with-metadata.json @@ -170,7 +170,8 @@ "description": "Version number associated with the threshold" } } - } + }, + "format": "tabs-top" }, "context": { "type": "string", @@ -212,7 +213,8 @@ } } } - } + }, + "format": "tabs-top" } } } diff --git a/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json index 4cb5bd8c1..58dff236e 100644 --- a/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json +++ b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json @@ -292,6 +292,10 @@ } } } + }, + { + "title": "User defined", + "properties": {} } ] }, @@ -588,7 +592,8 @@ "default": "final_success" } } - } + }, + "format": "tabs-top" }, "trigger": { "type": "string", diff --git a/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.test.js b/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.test.js index 4363da923..3a45153e9 100644 --- a/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.test.js +++ b/ui-react/src/components/dialogs/ManageDictionaries/ManageDictionaries.test.js @@ -78,7 +78,6 @@ describe('Verify ManageDictionaries', () => { }), 100 ); - new Promise(resolve => setTimeout(resolve, 200)); const component = shallow(<ManageDictionaries />); expect(myMockFunc.mock.calls.length).toBe(1); }); diff --git a/ui-react/src/components/dialogs/Tosca/ViewLoopTemplatesModal.test.js b/ui-react/src/components/dialogs/Tosca/ViewLoopTemplatesModal.test.js index ddfb2a70c..e11d86f53 100644 --- a/ui-react/src/components/dialogs/Tosca/ViewLoopTemplatesModal.test.js +++ b/ui-react/src/components/dialogs/Tosca/ViewLoopTemplatesModal.test.js @@ -77,7 +77,6 @@ describe('Verify ViewLoopTemplatesModal', () => { }), 100 ); - new Promise(resolve => setTimeout(resolve, 200)); const component = shallow(<ViewLoopTemplatesModal/>); expect(myMockFunc.mock.calls.length).toBe(1); }); diff --git a/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js b/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js index 952e88867..29127ed55 100644 --- a/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js +++ b/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js @@ -82,7 +82,6 @@ describe('Verify ViewToscaPolicyModal', () => { }), 100 ); - new Promise(resolve => setTimeout(resolve, 200)); const component = shallow(<ViewToscaPolicyModal/>); expect(myMockFunc.mock.calls.length).toBe(1); }); |