Эх сурвалжийг харах

HUE-3345 [editor] Display info message when a query was redacted

Enrico Berti 9 жил өмнө
parent
commit
1c7d16f447

+ 3 - 2
desktop/libs/notebook/src/notebook/static/notebook/css/notebook.css

@@ -710,7 +710,7 @@ table.airy tr td {
   position: relative;
 }
 
-.results.alert-error {
+.results.alert-error, .alert-error-gradient {
   border: none;
   margin-top: -3px;
   background: -moz-linear-gradient(left, rgba(242, 222, 222, 1) 0%, rgba(255, 255, 255, 0) 100%);
@@ -721,13 +721,14 @@ table.airy tr td {
   filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f2dede', endColorstr='#00ffffff', GradientType=1)
 }
 
+
 .results-images {
   border-left: 5px solid #DDD;
   background-color: #f5f5f5;
   padding: 5px;
 }
 
-.alert-notebook {
+.alert-notebook, .alert-gradient {
   border: none;
   margin-top: -3px;
   background: -moz-linear-gradient(left, rgba(252, 248, 227, 1) 0%, rgba(255, 255, 255, 0) 100%);

+ 2 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -399,6 +399,8 @@
       return self.resultsKlass() + " alert alert-error";
     });
 
+    self.is_redacted = ko.observable(typeof snippet.is_redacted != "undefined" && snippet.is_redacted != null ? snippet.is_redacted : false);
+
     self.chartType = ko.observable(typeof snippet.chartType != "undefined" && snippet.chartType != null ? snippet.chartType : ko.HUE_CHARTS.TYPES.BARCHART);
     self.chartSorting = ko.observable(typeof snippet.chartSorting != "undefined" && snippet.chartSorting != null ? snippet.chartSorting : "none");
     self.chartScatterGroup = ko.observable(typeof snippet.chartScatterGroup != "undefined" && snippet.chartScatterGroup != null ? snippet.chartScatterGroup : null);

+ 4 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -654,6 +654,9 @@ ${ require.config() }
 </script>
 
 <script type="text/html" id="code-editor-snippet-body">
+  <div class="alert alert-gradient" data-bind="visible: is_redacted">
+    ${ _('The current query has been redacted to hide sensitive information.') }
+  </div>
   <div class="row-fluid" style="margin-bottom: 5px">
     <div class="editor span12" data-bind="css: {'single-snippet-editor ace-container-resizable' : $root.editorMode }, clickForAceFocus: ace">
       <div class="ace-editor" data-bind="css: {'single-snippet-editor ace-editor-resizable' : $root.editorMode, 'active-editor': inFocus }, attr: { id: id() }, delayedOverflow, aceEditor: {
@@ -924,7 +927,7 @@ ${ require.config() }
         <div class="bar" data-bind="style: {'width': (errors().length > 0 ? 100 : progress()) + '%'}"></div>
       </div>
     </div>
-    <div class="snippet-error-container alert alert-error" data-bind="visible: errors().length > 0">
+    <div class="snippet-error-container alert alert-error alert-error-gradient" data-bind="visible: errors().length > 0">
       <ul class="unstyled" data-bind="foreach: errors">
         <li data-bind="text: message"></li>
       </ul>