Pārlūkot izejas kodu

AMBARI-11668. Default widgets marked invisible in widgets.json are not created. (Ivan via Jaimin)

Jaimin Jetly 10 gadi atpakaļ
vecāks
revīzija
a4b215884e

+ 5 - 0
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java

@@ -4098,6 +4098,11 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
       LOG.debug("Creating cluster widget with: name = " +
         layoutInfo.getWidgetName() + ", type = " + layoutInfo.getType() + ", " +
         "cluster = " + clusterEntity.getClusterName());
+      // Persisting not visible widgets
+      // visible one will be cascaded on creation of layout
+      if (!layoutInfo.isVisible()) {
+        widgetDAO.create(widgetEntity);
+      }
       return widgetEntity;
     } else {
       LOG.warn("Skip creating widget from stack artifact since one or more " +