Sfoglia il codice sorgente

AMBARI-20127. Hive 2: "insert udf" opens empty drop down (pallavkul)

pallavkul 8 anni fa
parent
commit
b24585f62f

+ 16 - 0
contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js

@@ -54,6 +54,22 @@ export default Ember.Route.extend(UILoggerMixin, {
       this.controller.set('fileResourceList', fileResourceList);
     });
 
+    this.store.findAll('udf').then((data) => {
+      let allUDFList = [];
+      data.forEach(x => {
+        let localUDF = {'id': x.get('id'),
+          'name': x.get('name'),
+          'classname': x.get('classname'),
+          'fileResource': x.get('fileResource'),
+          'owner': x.get('owner')
+        };
+        allUDFList.push(localUDF);
+      });
+      this.controller.set('allUDFList', allUDFList);
+    });
+
+
+
     this.store.findAll('setting').then((data) => {
       let localStr = '';
       data.forEach(x => {

+ 1 - 3
contrib/views/hive20/src/main/resources/ui/app/templates/queries/query.hbs

@@ -32,10 +32,8 @@
 
         <button class="btn btn-default" {{action "openWorksheetModal" }}>{{fa-icon "save"}} Save As</button>
         <div class="btn-group">
-          <button class="btn btn-default" type="button" data-toggle="dropdown">Insert UDF
+          <button class="btn btn-default" type="button" data-toggle="dropdown" disabled={{ not allUDFList.length }}>Insert UDF
             <span class="caret"></span></button>
-
-
             <ul class="dropdown-menu">
               {{#each fileResourceList as |fileResource|}}
                 {{fileresource-item fileResource=fileResource createQuery='createQuery'}}