From: xg353y Date: Mon, 18 Feb 2019 12:09:04 +0000 (+0100) Subject: Allow only 1 Operational Policy X-Git-Tag: 4.0.0~96^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F78645%2F2;p=clamp.git Allow only 1 Operational Policy Rework the operational policy UI, only allow to create 1 operational policy and fix some bugs. Issue-ID: CLAMP-294 Change-Id: Iec09451d9437b299028bf63304f90c893ecc1d3e Signed-off-by: xg353y --- diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java index 42e9cf71..e3a379b3 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsService.java +++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java @@ -394,11 +394,14 @@ public class CldsService extends SecureServiceBase { errorMessage = e.getMessage(); } - if (!errorMessage.isEmpty()) { + if (null == errorMessage || (null != errorMessage && !errorMessage.isEmpty())) { CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), actionCd, CldsEvent.ACTION_STATE_ERROR, null); // Need a refresh as new events have been inserted model = CldsModel.retrieve(cldsDao, modelName, false); + if (null == errorMessage) { + errorMessage = "No response from Policy"; + } model.setErrorMessageForUi(errorMessage); util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "putModelAndProcessAction failed", Level.INFO, ONAPLogConstants.ResponseStatus.ERROR); diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html index 331ab5cd..182dab8d 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html @@ -23,20 +23,10 @@