This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new f35b4715 add buttons for setting dsl/code on list and map items
f35b4715 is described below

commit f35b471582f67e5409e98815f062b4762e078eee
Author: Alex Heneveld <[email protected]>
AuthorDate: Fri Dec 16 11:00:45 2022 +0000

    add buttons for setting dsl/code on list and map items
    
    also tweak colours, and support locally-specified parameters of type `list`
---
 .../app/components/spec-editor/spec-editor.directive.js       |  3 ++-
 .../app/components/spec-editor/spec-editor.less               | 11 +++++++++--
 .../app/components/spec-editor/spec-editor.template.html      |  8 ++++++++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
index adc97e2e..b954ce8c 100644
--- 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
+++ 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
@@ -575,7 +575,8 @@ export function specEditorDirective($rootScope, 
$templateCache, $injector, $sani
             if (type === 'java.lang.String') type = 'string';
             else if (type === 'java.lang.Boolean') type = 'boolean';
             else if (type === 'java.util.Map') type = 'map';
-            else if (type === 'java.util.Set' || type === 'java.util.List' || 
type === 'java.util.Collection') type = 'array';
+            else if (type === 'java.util.Set' || type === 'java.util.List' || 
type === 'java.util.Collection'
+                || type==='list' || type==='set') type = 'array';
             else if (type === 'java.lang.Object') type = 'object';
 
             if (specEditor.defined(val)) {
diff --git 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.less 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.less
index 3e0bc268..c4cfd252 100644
--- a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.less
+++ b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.less
@@ -32,7 +32,7 @@ spec-editor {
   color: @gray;
 
   .toolbar-button-affordance() {
-    color: mix(@gray, @gray-lighter);
+    color: @label-gray;
     cursor: pointer;
     transition: 0.1s ease all;
     &:hover {
@@ -341,7 +341,7 @@ spec-editor {
         margin-right: 1ex;
         text-align: center;
         .fa-info-circle {
-          color: @gray-lightish;
+          color: @label-gray;
           transition: color 0.3s ease;
           &:hover {
             color: @brand-primary;
@@ -941,6 +941,13 @@ spec-editor {
       color: @gray;
     }
   }
+
+  .no-entries-buttons {
+    i {
+      .toolbar-button-affordance();
+    }
+    padding-left: 1ex;
+  }
 }
 
 .version-selection {
diff --git 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html
 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html
index cdc5a811..ca138cf2 100644
--- 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html
+++ 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html
@@ -481,6 +481,10 @@
                                         'one': '{} entry',
                                         'other': '{} 
entries'}"></ng-pluralize>)
                                 </span>
+                                <span 
ng-if="getObjectSize(config[item.name])==0" class="no-entries-buttons">
+                                    <i class="fa fa-fw fa-code" 
ng-click="codeModeClick(item)" aria-hidden="true" 
title="{{getJsonModeTitle(item.name)}} [{{item.name}}]"></i>
+                                    <a 
ui-sref="main.graphical.edit.dsl({entityId: model._id, for: item.name})" 
title="Open in DSL editor"><i class="fa fa-bolt"></i></a>
+                                </span>
                             </p>
                             <ul class="collection-map" 
                                     ng-class="{'default-collapse': 
expandMode=='default', 'collapse': expandMode=='closed'}">
@@ -533,6 +537,10 @@
                                         'one': '{} entry',
                                         'other': '{} 
entries'}"></ng-pluralize>)
                                 </span>
+                                <span ng-if="(config[item.name] || 
[]).length==0" class="no-entries-buttons">
+                                    <i class="fa fa-fw fa-code" 
ng-click="codeModeClick(item)" aria-hidden="true" 
title="{{getJsonModeTitle(item.name)}} [{{item.name}}]"></i>
+                                    <a 
ui-sref="main.graphical.edit.dsl({entityId: model._id, for: item.name})" 
title="Open in DSL editor"><i class="fa fa-bolt"></i></a>
+                                </span>
                             </p>
                             <ul class="collection-list"
                                     ng-class="{'default-collapse': 
expandMode=='default', 'collapse': expandMode=='closed'}">

Reply via email to