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 47008e1f show reconfigurable config even if unset; restore 
blurring-secrets behaviour
47008e1f is described below

commit 47008e1f21b3bedc109ac79f0da30399b8ee2bbb
Author: Alex Heneveld <[email protected]>
AuthorDate: Mon Aug 29 13:47:34 2022 +0100

    show reconfigurable config even if unset; restore blurring-secrets behaviour
    
    tidy how blurring is done, update text of message to align with API changes 
which might suppress the values;
    note blurring was removed when multi-line formatting was introduced in PR 
302
---
 .../config-sensor-table.directive.js               | 19 +++++--
 .../config-sensor-table.style.less                 | 60 +++++++++++++++++++---
 .../config-sensor-table.template.html              | 16 +++---
 .../main/inspect/summary/summary.controller.js     |  6 +--
 .../utils/sensitive-field/sensitive-field.less     | 13 ++---
 5 files changed, 83 insertions(+), 31 deletions(-)

diff --git 
a/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.directive.js
 
b/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.directive.js
index 40e23b7e..c43d9812 100644
--- 
a/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.directive.js
+++ 
b/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.directive.js
@@ -47,14 +47,22 @@ export function configSensorTableDirective(brSnackbar) {
     function link(scope) {
         scope.items = [];
         scope.mapInfo = {};
-        scope.WARNING_TEXT = 'This value is identified as potentially 
sensitive based on the name and so is ' +
-            'blurred here by default. However it is supplied in the blueprint 
as plaintext which is not secure. An ' +
-            'external provider should be used to store this value with a DSL 
expression supplied in the blueprint to ' +
-            'retrieve the value.';
+        scope.WARNING_TEXT = 'This value is identified as potentially 
sensitive based and so is masked here. ' +
+            'The value should be supplied as a DSL expression not as plain 
text. ' +
+            'Note that the unmasked value still might not reveal the actual 
value, ' +
+            'if sensitive values are blocked by the API or if DSL resolution 
is skipped.';
 
         scope.$watchGroup(['data'], (changes)=> {
             if (angular.isObject(scope.data)) {
-                scope.items = Object.entries(scope.data)
+                const dataPlusReconfigurable = Object.assign({}, scope.data);
+                if (scope.info) {
+                    scope.info.forEach(info => {
+                        if (info.reconfigurable && 
!dataPlusReconfigurable.hasOwnProperty(info.name)) {
+                            dataPlusReconfigurable[info.name] = undefined;
+                        }
+                    });
+                }
+                scope.items = Object.entries(dataPlusReconfigurable)
                     .map(([key, value]) => ({
                         key,
                         value,
@@ -90,6 +98,7 @@ export function configSensorTableDirective(brSnackbar) {
             }
             brSnackbar.create(message);
         };
+        scope.isNullish = (x) => x===null || typeof x === 'undefined';
     }
 }
 
diff --git 
a/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.style.less
 
b/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.style.less
index bf57d6c0..78d5ba26 100644
--- 
a/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.style.less
+++ 
b/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.style.less
@@ -45,9 +45,11 @@
 
   .grid-editable:not(.edit-disabled):after {
     font-family: "myriad-pro-1", Helvetica, Arial, sans-serif, FontAwesome;
-    content: '\f040 Edit';
-    opacity: 0.2;
+    content: '\f040';
+    opacity: 0.3;
+    width: 1.1em;
     color: @primary-50;
+    text-shadow: none;
   }
 
   .grid-editable {
@@ -55,7 +57,7 @@
     display: flex;
     justify-content: space-between;
     width: 100%;
-    padding: 8px;
+    //padding: 8px;
 
     &:hover {
       background: fade(@primary-50, 10%);
@@ -68,7 +70,6 @@
 }
 
 
-
 .config-sensor-table {
   table {
 //    table-layout: fixed;
@@ -77,17 +78,22 @@
 .config-value {
  > .content-row {
   display: flex;
+  margin-top: -3px;
+  margin-bottom: -3px;
   > .content {
     flex: 1 1 auto;
     max-height: 120pt;
     overflow: auto;
+    align-self: center;
   }
   > .extras {
     flex: 0 0 auto;
+    margin-left: 0.5ex;
+    margin-right: -0.6ex;
     button {
-      // don't make a huge button, it just makes the table less expressive
-      margin-bottom: -3px;
-      margin-top: -3px;
+      // don't make a huge button, it just makes the table too sparse
+      margin-bottom: 0;
+      margin-top: 0;
       padding: 3px 6px;
     }
   }
@@ -95,6 +101,10 @@
   .copy-btn {
     visibility: hidden;
   }
+  .warning-icon {
+    position: relative;
+    bottom: -2px;
+  }
 
   &:hover .copy-btn {
     visibility: visible !important;
@@ -106,5 +116,41 @@
     .monospace();
   }
  }
+ .editable-click, a.editable-click {
+   color: inherit;
+ }
+ .editable-empty, .editable-empty:hover, .editable-empty:focus, 
a.editable-empty, a.editable-empty:hover, a.editable-empty:focus {
+   color: @gray-light;
+ }
+ .editable-wrap {
+   display: flex;
+   flex: 1 0 auto;
+   .editable-controls {
+     display: flex;
+     flex: 1 0 auto;
+     margin-right: 1ex;
+     input {
+       height: inherit;
+       flex: 1 0 auto;
+       padding: 2px 6px;
+     }
+     .btn {
+       padding: 2px 6px;
+     }
+   }
+ }
 }
 
+.sensitive-field {
+  > .content {
+    transition: none;
+    text-shadow: rgba(0, 0, 0, 0.95) 10px 0px 10px;
+
+  }
+  &.sensitive-field-show {
+    > .content {
+      transition: text-shadow 800ms ease-in-out;
+      text-shadow: rgba(0, 0, 0, 0.95) 10px 0px 0px;
+    }
+  }
+}
diff --git 
a/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.template.html
 
b/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.template.html
index af4a8580..ceca5f34 100644
--- 
a/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.template.html
+++ 
b/ui-modules/app-inspector/app/components/config-sensor-table/config-sensor-table.template.html
@@ -34,20 +34,20 @@
                        uib-popover="{{mapInfo[item.key].description}}" 
popover-trigger="'mouseenter'" popover-title="Description" 
popover-animation="true"></i>
     </div>
     <div class="col2 config-value" ng-class="{ 'grid-even': $index%2 }" 
ng-repeat-end>
-              <div class="content-row">
+              <div class="content-row" sensitive-field 
field-name="{{item.key}}">
                 <span class="content">
-                    <div ng-show= "mapInfo[item.key].reconfigurable" 
ng-class="{'grid-editable': mapInfo[item.key].reconfigurable}" 
editable-text="item.value"
+                    <div ng-show="mapInfo[item.key].reconfigurable" 
ng-class="{'grid-editable': mapInfo[item.key].reconfigurable}" 
editable-text="item.value"
                          edit-disabled="!mapInfo[item.key].reconfigurable" 
onbeforesave="reconfigureCallback(item.key,$data)" buttons="right" 
e-disabled-submit-on-enter>
-                            <span ng-if="item.value === null"><i>value not 
set</i></span>
-                            <span ng-if="item.value !== null" 
ng-bind-html="item.value | brLinky:mapInfo[item.key]" 
class="literal-lines"></span>
+                            <span ng-if="isNullish(item.value)"><i>value not 
set</i></span>
+                            <span ng-if="!isNullish(item.value)" 
ng-bind-html="item.value | brLinky:mapInfo[item.key]" 
class="literal-lines"></span>
                     </div>
                     <div ng-show="!mapInfo[item.key].reconfigurable">
-                            <span ng-if="item.value === null"><i>value not 
set</i></span>
-                            <span ng-if="item.value !== null" 
ng-bind-html="item.value | brLinky:mapInfo[item.key]" 
class="literal-lines"></span>
+                            <span ng-if="isNullish(item.value)"><i>value not 
set</i></span>
+                            <span ng-if="!isNullish(item.value)" 
ng-bind-html="item.value | brLinky:mapInfo[item.key]" 
class="literal-lines"></span>
                     </div>
                 </span>
-                <span class="extras">
-                    <i class="fa fa-exclamation-triangle warning-icon" 
ng-class="{invisible: !item.isPlaintextSensitiveValue}"
+                <span class="extras" onclick="event.stopPropagation();">
+                    <i class="fa fa-exclamation-triangle warning-icon" 
ng-if="item.isPlaintextSensitiveValue"
                        uib-popover={{WARNING_TEXT}} 
popover-trigger="'mouseenter'" popover-animation="true"
                        popover-placement="left"
                     ></i>
diff --git 
a/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js 
b/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
index 299e1292..1eb69a26 100644
--- 
a/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
+++ 
b/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
@@ -52,7 +52,7 @@ export function summaryController($scope, $state, 
$stateParams, $q, $http, $http
     // the eventual entries to share with the sensor table component
     vm.configItems = null;
     vm.configItemsUnsafeMap = null;
-    vm.configItemsInfo = null;
+    vm.configInfo = null;
 
     let observers = [];
 
@@ -123,7 +123,7 @@ export function summaryController($scope, $state, 
$stateParams, $q, $http, $http
         const handleError = (message) => {
             vm.error.configItems = message;
             vm.configItems = null;
-            vm.configItemsInfo = null;
+            vm.configInfo = null;
         }
 
         const successHandler = (key) => (response) => {
@@ -146,7 +146,7 @@ export function summaryController($scope, $state, 
$stateParams, $q, $http, $http
                     handleError(`Could not load resolved configuration 
information for entity with ID: ${entityId}`);
                 } else { // all 200-OK case
                     vm.error.configItems = undefined; // clearing error flag
-                    // set configItems && configItemsInfo
+                    // set config && configInfo
 
                     const configHandler = successHandler('config');
                     const configResolvedHandler = 
successHandler('configResolved');
diff --git a/ui-modules/utils/sensitive-field/sensitive-field.less 
b/ui-modules/utils/sensitive-field/sensitive-field.less
index 14138961..008fbea8 100644
--- a/ui-modules/utils/sensitive-field/sensitive-field.less
+++ b/ui-modules/utils/sensitive-field/sensitive-field.less
@@ -18,7 +18,7 @@
  */
 .sensitive-field {
   > .content {
-    transition: text-shadow 1s linear;
+    transition: text-shadow 1s ease-in-out;
     cursor: help;
     color: transparent;
     text-shadow: rgba(0, 0, 0, 0.95) 0px 0px 20px;
@@ -30,12 +30,9 @@
     }
   }
 
-  > .extras {
-
-    > .warning-icon {
-      //display: inline-block !important;
-      color: #ffcd00;
-      text-shadow: 0 0 3px #000;
-    }
+  .warning-icon {
+    color: #ddaa00;
+    //text-shadow: 0 0 3px #000;
   }
+
 }

Reply via email to