Update designer configuraiton file 47/28547/2
authorIdan Amit <ia096e@intl.att.com>
Thu, 18 Jan 2018 17:07:38 +0000 (19:07 +0200)
committerIdan Amit <ia096e@intl.att.com>
Sun, 21 Jan 2018 06:52:00 +0000 (06:52 +0000)
Updated the designer configuration file to support the new display options
Made sure that the old code still works

Change-Id: Ia63cb89b0f8cb92fc86e0804afe7e2c2caea0541
Issue-ID: SDC-938
Signed-off-by: Idan Amit <ia096e@intl.att.com>
catalog-fe/src/main/resources/config/designers-configuration.yaml
catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/DesignerStatusBLTest.java
catalog-ui/src/app/models/designers-config.ts
catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts
common-app-api/src/main/java/org/openecomp/sdc/fe/config/DesignersConfiguration.java
sdc-os-chef/environments/Template.json
sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/recipes/FE_2_setup_configuration.rb
sdc-os-chef/sdc-frontend/chef-repo/cookbooks/sdc-catalog-fe/templates/default/FE-designers-configuration.yaml.erb

index 7064619..abdf9ea 100644 (file)
@@ -1,17 +1,22 @@
 designersList:
-   - displayName: DCAE
-     designerHost: 192.168.50.5
+   - designerId: DCAE
+     designerHost: localhost
      designerPort: 8080
      designerPath: "/dcae"
      designerStateUrl: "dcae"
      designerProtocol: http
-     buttonLocation: ["top", "tab"]
-     tabPresentation: ["VF", "SERVICE"]
-   - displayName: WORKFLOW
-     designerHost: 192.168.50.5
+     designerDisplayOptions:
+        tab:
+            displayName: "monitor"
+            validResourceTypes: ["VF", "SERVICE"]
+        top:
+            displayName: "DCAE"
+   - designerId: WORKFLOW
+     designerHost: localhost
      designerPort: 9527
      designerPath: "/"
      designerStateUrl: "workflowDesigner"
      designerProtocol: http
-     buttonLocation: ["top"]
-     tabPresentation: []
\ No newline at end of file
+     designerDisplayOptions:
+        top:
+            displayName: "Workflow Designer"
\ No newline at end of file
index 00c2d20..0b5b9cd 100644 (file)
@@ -54,7 +54,7 @@ public class DesignerStatusBLTest {
                ConfigurationManager.setTestInstance(configurationManager);
                when(configurationManager.getDesignersConfiguration()).thenReturn(designersConfiguration);
                
-               offlineDesigner.setDisplayName(offlineDesignerDisplayName);
+               offlineDesigner.setDesignerId(offlineDesignerDisplayName);
                offlineDesigner.setDesignerHost(offlineDesignerHost);
                offlineDesigner.setDesignerPort(offlineDesignerPort);
                offlineDesigner.setDesignerPath(offlineDesignerPath);
@@ -64,7 +64,7 @@ public class DesignerStatusBLTest {
                offlineRequestString.append(offlineDesignerProtocol).append("://").append(onlineDesignerHost).append(":")
                                .append(offlineDesignerPort).append(offlineDesignerPath);
 
-               onlineDesigner.setDisplayName(onlineDesignerDisplayName);
+               onlineDesigner.setDesignerId(onlineDesignerDisplayName);
                onlineDesigner.setDesignerHost(onlineDesignerHost);
                onlineDesigner.setDesignerPort(onlineDesignerPort);
                onlineDesigner.setDesignerPath(onlineDesignerPath);
index c784be2..c218c89 100644 (file)
@@ -1,13 +1,17 @@
 
 export class Designer {
-    displayName: string;
+    designerId: string;
     designerHost: string;
     designerPort: number;
     designerPath: string;
     designerStateUrl: string;
     designerProtocol: string;
-    designerButtonLocation: Array<string>;
-    designerTabPresentation: Array<string>;
+    designerDisplayOptions: Map<string, DesignerDisplayOptions>;
+}
+
+export class DesignerDisplayOptions {
+    displayName: string;
+    validResourceTypes: Array<string>;
 }
 
 export type Designers = Array<Designer>;
index 846b84c..632b2be 100644 (file)
@@ -122,7 +122,9 @@ export class TopNavComponent {
                 });
 
                 _.each(DesignersConfiguration.designers, (designer: Designer) => {
-                    tmpArray.push(new MenuItem(designer.displayName, null, "designers", "goToState", {path: designer.designerStateUrl}, null));
+                    if (designer.designerDisplayOptions["top"]) {
+                        tmpArray.push(new MenuItem(designer.designerDisplayOptions["top"].displayName, null, "designers", "goToState", {path: designer.designerStateUrl}, null));
+                    }
                 })
             }
 
index 6803120..1b44d72 100644 (file)
@@ -2,6 +2,7 @@ package org.openecomp.sdc.fe.config;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import org.openecomp.sdc.common.api.BasicConfiguration;
 
@@ -23,29 +24,20 @@ public class DesignersConfiguration extends BasicConfiguration {
 
     public static class Designer {
 
-        private String displayName;
+        private String designerId;
         private String designerHost;
         private Integer designerPort;
         private String designerPath;
         private String designerStateUrl;
         private String designerProtocol;
-        private List<String> designerButtonLocation;
-        private List<String> designerTabPresentation;
-
-        public List<String> getDesignerButtonLocation() {
-            return designerButtonLocation;
-        }
+        private Map<String, DesignerDisplayOptions> designerDisplayOptions;
 
-        public void setDesignerButtonLocation(List<String> designerButtonLocation) {
-            this.designerButtonLocation = designerButtonLocation;
+        public Map<String, DesignerDisplayOptions> getDesignerDisplayOptions() {
+            return designerDisplayOptions;
         }
 
-        public List<String> getDesignerTabPresentation() {
-            return designerTabPresentation;
-        }
-
-        public void setDesignerTabPresentation(List<String> designerTabPresentation) {
-            this.designerTabPresentation = designerTabPresentation;
+        public void setDesignerDisplayOptions(Map<String, DesignerDisplayOptions> designerDisplayOptions) {
+            this.designerDisplayOptions = designerDisplayOptions;
         }
 
         public String getDesignerStateUrl() {
@@ -64,12 +56,12 @@ public class DesignersConfiguration extends BasicConfiguration {
             this.designerProtocol = designerProtocol;
         }
 
-        public String getDisplayName() {
-            return displayName;
+        public String getDesignerId() {
+            return designerId;
         }
 
-        public void setDisplayName(String displayName) {
-            this.displayName = displayName;
+        public void setDesignerId(String designerId) {
+            this.designerId = designerId;
         }
 
         public String getDesignerHost() {
@@ -98,6 +90,28 @@ public class DesignersConfiguration extends BasicConfiguration {
 
     }
 
+    public static class DesignerDisplayOptions {
+
+        private String displayName;
+        private List<String> validResourceTypes;
+
+        public String getDisplayName() {
+            return displayName;
+        }
+
+        public void setDisplayName(String displayName) {
+            this.displayName = displayName;
+        }
+
+        public List<String> getValidResourceTypes() {
+            return validResourceTypes;
+        }
+
+        public void setValidResourceTypes(List<String> validResourceTypes) {
+            this.validResourceTypes = validResourceTypes;
+        }
+    }
+
 }
 
 
index d39eba3..5d11261 100644 (file)
         },
         "Designers": {
             "DCAE": {
-                "dcae_host": "yyy",
-                "dcae_port": "yyy",
-                "dcae_path": "yyy",
-                "dcae_state_url": "yyy",
                 "dcae_protocol": "yyy",
-                "dcae_button_position": ["xxx", "yyy"],
-                "dcae_tab_presentation": ["xxx", "yyy"]
+                "dcae_host": "yyy",
+                "dcae_port": "yyy"
             },
             "WORKFLOW": {
-                "workflow_host": "yyy",
-                "workflow_port": "yyy",
-                "workflow_path": "yyy",
-                "workflow_state_url": "yyy",
                 "workflow_protocol": "yyy",
-                "workflow_button_position": ["xxx", "yyy"],
-                "workflow_tab_presentation": ["xxx", "yyy"]
+                "workflow_host": "yyy",
+                "workflow_port": "yyy"
             }
         }
     },
index 0d12e3b..8612b5f 100644 (file)
@@ -23,20 +23,12 @@ template "designers-fe-config" do
    group "jetty"
    mode "0755"
    variables({
+      :dcae_protocol             => node['Designers']['DCAE']['dcae_protocol'],
       :dcae_host                 => node['Designers']['DCAE']['dcae_host'],
       :dcae_port                 => node['Designers']['DCAE']['dcae_port'],
-      :dcae_path                 => node['Designers']['DCAE']['dcae_path'],
-      :dcae_state_url            => node['Designers']['DCAE']['dcae_state_url'],
-      :dcae_protocol             => node['Designers']['DCAE']['dcae_protocol'],
-      :dcae_button_location      => node['Designers']['DCAE']['dcae_button_location'],
-      :dcae_tab_presentation     => node['Designers']['DCAE']['dcae_tab_presentation'],
+      :workflow_protocol         => node['Designers']['WORKFLOW']['workflow_protocol'],
       :workflow_host             => node['Designers']['WORKFLOW']['workflow_host'],
       :workflow_port             => node['Designers']['WORKFLOW']['workflow_port'],
-      :workflow_path             => node['Designers']['WORKFLOW']['workflow_path'],
-      :workflow_state_url        => node['Designers']['WORKFLOW']['workflow_state_url'],
-      :workflow_protocol         => node['Designers']['WORKFLOW']['workflow_protocol'],
-      :workflow_button_location  => node['Designers']['WORKFLOW']['workflow_button_location'],
-      :workflow_tab_presentation => node['Designers']['WORKFLOW']['workflow_tab_presentation']
    })
 end
 
index f8a7999..fd8a81b 100644 (file)
@@ -1,17 +1,22 @@
 designersList:
-   - displayName: DCAE
+   - designerId: DCAE
+     designerProtocol: <%= @dcae_protocol %>
      designerHost: <%= @dcae_host %>
      designerPort: <%= @dcae_port %>
-     designerPath: <%= @dcae_path %>
-     designerStateUrl: <%= @dcae_state_url %>
-     designerProtocol: <%= @dcae_protocol %>
-     designerButtonLocation: <%= @dcae_button_location %>
-     designerTabPresentation: <%= @dcae_tab_presentation %>
-   - displayName: WORKFLOW
+     designerPath: "/dace"
+     designerStateUrl: "dcae"
+     designerDisplayOptions:
+        tab:
+            displayName: "monitor"
+            validResourceTypes: ["VF", "SERVICE"]
+        top:
+            displayName: "DCAE"
+   - designerId: WORKFLOW
+     designerProtocol: <%= @workflow_protocol %>
      designerHost: <%= @workflow_host %>
      designerPort: <%= @workflow_port %>
-     designerPath: <%= @workflow_path %>
-     designerStateUrl: <%= @workflow_state_url %>
-     designerProtocol: <%= @workflow_protocol %>
-     designerButtonLocation: <%= @workflow_button_location %>
-     designerTabPresentation: <%= @workflow_tab_presentation %>
\ No newline at end of file
+     designerPath: "/"
+     designerStateUrl: "workflowDesigner"
+     designerDisplayOptions:
+        top:
+            displayName: "Workflow Designer"
\ No newline at end of file