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

HUE-5724 [assist] Show the view SQL in the context popover

Johan Ahlen 8 жил өмнө
parent
commit
ee64271

+ 11 - 0
desktop/core/src/desktop/templates/sql_context_popover.mako

@@ -193,6 +193,10 @@ from metadata.conf import has_navigator
         </span>
         </span>
       </div>
       </div>
       <!-- /ko -->
       <!-- /ko -->
+      <!-- ko if: typeof viewSql !== 'undefined' -->
+      <div style="margin: 10px; font-size: 15px; font-weight: 300;">${ _("View SQL") }</div>
+      <div style="margin-left: 15px;" data-bind="text: viewSql"></div>
+      <!-- /ko -->
       <!-- ko if: typeof comment !== 'undefined' && comment !== '' && comment !== null -->
       <!-- ko if: typeof comment !== 'undefined' && comment !== '' && comment !== null -->
       <div style="margin: 10px; font-size: 15px; font-weight: 300;">${ _("Comment") }</div>
       <div style="margin: 10px; font-size: 15px; font-weight: 300;">${ _("Comment") }</div>
       <div style="margin-left: 15px; font-style: italic;" data-bind="text: comment"></div>
       <div style="margin-left: 15px; font-style: italic;" data-bind="text: comment"></div>
@@ -500,6 +504,13 @@ from metadata.conf import has_navigator
                 }
                 }
               });
               });
             }
             }
+            if (typeof data.properties !== 'undefined') {
+              data.properties.forEach(function (property) {
+                if (property.col_name.toLowerCase() === 'view original text:') {
+                  data.viewSql = property.data_type;
+                }
+              })
+            }
             self.fetchedData(data);
             self.fetchedData(data);
             self.loading(false);
             self.loading(false);
             if (typeof callback === 'function') {
             if (typeof callback === 'function') {