From 9eb3c7a2fa4f6cace52d49a84123f370babaf57f Mon Sep 17 00:00:00 2001 From: xg353y Date: Mon, 18 Feb 2019 13:09:04 +0100 Subject: 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 --- .../org/onap/clamp/clds/service/CldsService.java | 5 +- .../portfolios/PolicyWindow_properties.html | 265 ++++++--------------- .../designer/scripts/GlobalPropertiesCtrl.js | 11 - .../resources/designer/scripts/ToscaModelCtrl.js | 21 +- .../META-INF/resources/designer/scripts/aOnBoot.js | 4 +- 5 files changed, 76 insertions(+), 230 deletions(-) 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 42e9cf713..e3a379b36 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 331ab5cd1..182dab8d5 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 @@