diff options
author | imamSidero <imam.hussain@est.tech> | 2023-01-24 16:03:54 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-01-27 18:22:19 +0000 |
commit | 43ffce5d0d30872446c51afaf786d5cfad4378be (patch) | |
tree | c5ccdb92091586525b0b567f591c402ee642aecf /catalog-be/src | |
parent | e3a17890903ee443d0b5d0ee872e316e4369318d (diff) |
Provide add/edit constraints capability to inputs in properties page
Providing the capability to add or edit constraints to inputs in properies of a service
Issue-ID: SDC-4346
Signed-off-by: Imam hussain <imam.hussain@est.tech>
Change-Id: I56261441022751a191fe057aafa4c681c8db96c5
Diffstat (limited to 'catalog-be/src')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java | 3 | ||||
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java index 21327ea29d..44fecb311b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java @@ -308,6 +308,9 @@ public class InputsBusinessLogic extends BaseBusinessLogic { currInput.setDefaultValue(updateInputObjectValue); currInput.setOwnerId(userId); currInput.setMetadata(newInput.getMetadata()); + if (newInput.getConstraints() != null) { + currInput.setConstraints(newInput.getConstraints()); + } if (newInput.isRequired() != null) { currInput.setRequired(newInput.isRequired()); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java index 2cccc31ded..f5db6be6bd 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java @@ -2113,7 +2113,8 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { } Service service = serviceResultEither.left().value(); if (dataParamsToReturn.contains(ComponentFieldsEnum.INPUTS.getValue())) { - ListUtils.emptyIfNull(service.getInputs()).forEach(input -> input.setConstraints(setInputConstraint(input))); + ListUtils.emptyIfNull(service.getInputs()).stream().filter(input -> CollectionUtils.isEmpty(input.getConstraints())) + .forEach(input -> input.setConstraints(setInputConstraint(input))); } UiComponentDataTransfer dataTransfer = uiComponentDataConverter.getUiDataTransferFromServiceByParams(service, dataParamsToReturn); return Either.left(dataTransfer); |