Browse Source

Revert "Vivek's changes"

This reverts commit 7d059e7dc184b3828e1f5f5dc291a9b064dfa5cd.
Vivek Ratnavel 10 years ago
parent
commit
b800592c4e
23 changed files with 3 additions and 7211 deletions
  1. 1 2
      contrib/views/hive/src/main/resources/ui/hive-web/.jshintrc
  2. 0 12
      contrib/views/hive/src/main/resources/ui/hive-web/Brocfile.js
  3. 0 34
      contrib/views/hive/src/main/resources/ui/hive-web/app/components/draggable-view.js
  4. 0 53
      contrib/views/hive/src/main/resources/ui/hive-web/app/components/droppable-view.js
  5. 0 149
      contrib/views/hive/src/main/resources/ui/hive-web/app/components/visualization-view.js
  6. 0 10
      contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
  7. 0 109
      contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
  8. 1 3
      contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
  9. 0 26
      contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/draggable.js
  10. 0 25
      contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/droppable.js
  11. 0 109
      contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drag-widget.js
  12. 0 111
      contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drop-widget.js
  13. 0 110
      contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-ui.js
  14. 0 1
      contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss
  15. 0 4
      contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss
  16. 0 103
      contrib/views/hive/src/main/resources/ui/hive-web/app/styles/visualization-view.scss
  17. 0 19
      contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/draggable-view.hbs
  18. 0 19
      contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/droppable-view.hbs
  19. 0 39
      contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/visualization-view.hbs
  20. 0 56
      contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs
  21. 0 37
      contrib/views/hive/src/main/resources/ui/hive-web/app/views/visualization-ui.js
  22. 1 4
      contrib/views/hive/src/main/resources/ui/hive-web/bower.json
  23. 0 6176
      contrib/views/hive/src/main/resources/ui/hive-web/vendor/vega-lite.js

+ 1 - 2
contrib/views/hive/src/main/resources/ui/hive-web/.jshintrc

@@ -2,8 +2,7 @@
   "predef": [
     "document",
     "window",
-    "-Promise",
-    "d3"
+    "-Promise"
   ],
   "browser" : true,
   "boss" : true,

+ 0 - 12
contrib/views/hive/src/main/resources/ui/hive-web/Brocfile.js

@@ -51,16 +51,4 @@ app.import('vendor/codemirror/codemirror.css');
 app.import('vendor/codemirror/show-hint.css');
 app.import('vendor/dagre.min.js');
 
-app.import('bower_components/d3/d3.js');
-app.import('bower_components/vega/vega.js');
-//app.import('bower_components/vega-lite/vega-lite.js');
-app.import('vendor/vega-lite.js');
-app.import('bower_components/eventEmitter/eventEmitter.js');
-app.import('bower_components/get-size/get-size.js');
-app.import('bower_components/eventie/eventie.js');
-app.import('bower_components/unipointer/unipointer.js');
-app.import('bower_components/unidragger/unidragger.js');
-app.import('bower_components/classie/classie.js');
-app.import('bower_components/get-style-property/get-style-property.js');
-app.import('bower_components/draggabilly/draggabilly.js');
 module.exports = app.toTree();

+ 0 - 34
contrib/views/hive/src/main/resources/ui/hive-web/app/components/draggable-view.js

@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import draggable from 'hive/mixins/draggable';
-
-export default Ember.Component.extend(draggable, {
-
-  classNames: ['btn', 'btn-custom', 'btn-sm', 'column-drag'],
-  helper_drag: 'clone',
-  revert_drag: 'invalid',
-
-  drag_drag : function(event, ui) {
-    console.log(this.get('name') + "dragged");
-  },
-  create_drag: function(event, ui) {
-    this.$().attr("data-name", this.get('name'));
-  }
-});

+ 0 - 53
contrib/views/hive/src/main/resources/ui/hive-web/app/components/droppable-view.js

@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import droppable from 'hive/mixins/droppable';
-
-export default Ember.Component.extend(droppable, {
-  classNames: ['drop-target'],
-  activeClass_drop: 'active',
-  hoverClass_drop: 'ui-state-hover',
-  self: this,
-
-  drop_drop: function(event, ui) {
-    var draggable_name = this.$(ui.draggable).attr('data-name');
-    console.log(draggable_name + " dropped");
-    console.log(ui);
-    console.log(this.$(ui.draggable).first());
-    this.$().html("");
-    this.$().addClass("disabled");
-    //this.$().append( this.$(ui.draggable).first().clone() );
-    var field_name =
-    this.$("<div/>")
-      .addClass( "pull-left btn-text truncate" )
-      .html(draggable_name);
-    var remove_field =
-    this.$("<div/>")
-      .addClass("pull-right no-padding close-container")
-      .html("<i class='fa fa-close field-remove pull-right'></i>");
-    this.$("<div/>")
-      .append(field_name)
-      .append(remove_field)
-      .css("padding", "3px 10px")
-      .appendTo( this.$() );
-
-    this.set('disabled_drop', true);
-  },
-
-});

+ 0 - 149
contrib/views/hive/src/main/resources/ui/hive-web/app/components/visualization-view.js

@@ -1,149 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Component.extend({
-  tagName: 'visualization-view',
-
-  initDragAndDrop: function() {
-    /*Ember.run.later(function(){
-      self.$('.column-drag').draggable({
-        helper: "clone",
-        revert: "invalid"
-      });
-      self.$(".droppable.active").droppable({
-        activeClass: "ui-state-default",
-        hoverClass: "ui-state-hover",
-        drop: function( event, ui ) {
-          self.$( this )
-            .addClass( "ui-state-highlight").html("Dropped");
-          console.log(event);
-          console.log(ui);
-
-        }
-      });
-    });*/
-  }.observes('json'),
-
-  testing: function () {
-    var self = this;
-
-    var draggable = this.$('.column-drag').draggabilly({});
-    draggable.on( 'dragEnd', function( event, pointer ) {
-      console.log("Drag ended");
-    });
-  },
-
-  initVisualization: function () {
-    var vled = {
-      version: 0.1,
-      spec: {}
-    };
-    var self = this;
-    vled.data = {
-      values: [
-        {"x":"A", "y":28}, {"x":"B", "y":55}, {"x":"C", "y":43},
-        {"x":"D", "y":91}, {"x":"E", "y":81}, {"x":"F", "y":53},
-        {"x":"G", "y":19}, {"x":"H", "y":87}, {"x":"I", "y":52}
-      ]
-      };
-    vled.format = function() {
-      var el = d3.select('#vlspec'),
-        spec = JSON.parse(el.property('value')),
-        text = JSON.stringify(spec, null, '  ', 60);
-      el.property('value', text);
-    };
-
-    vled.parse = function() {
-      var spec;
-      try {
-        spec = JSON.parse(d3.select('#vlspec').property('value'));
-      } catch (e) {
-        console.warn(e);
-        return;
-      }
-      var done = function() {
-        // only add url if data is not provided explicitly
-        var theme = (spec.data && spec.data.values) ? {} : {
-          data: {
-            "values": vled.data.values
-          }
-        };
-        vled.data.stats = vl.summary(vled.data.values).reduce(function(s, p) {
-          s[p.field] = p;
-          return s;
-        },{});
-        vled.loadSpec(spec, theme);
-      };
-
-      done();
-    };
-
-
-    vled.loadSpec = function(vlspec, theme) {
-
-      var spec = vl.compile(vlspec, vled.data.stats, theme);
-
-      self.$('textarea').trigger('autosize.resize');
-
-      vled.vis = null; // DEBUG
-      console.log("Inside loadSpec");
-      console.log(spec);
-      console.log(theme);
-      vg.parse.spec(spec, function(chart) {
-        vled.vis = chart({el:'#vis', renderer: 'svg'});
-        console.log("Inside Vega Parse");
-        vled.vis.update();
-        vled.vis.on('mouseover', function(ev, item) {
-          console.log(item);
-        });
-      });
-    };
-
-
-    vled.init = function() {
-
-      // Initialize application
-      d3.select('#btn_spec_parse').on('click', vled.parse);
-
-      console.log("Inside init()");
-      document.getElementById('vlspec').value = JSON.stringify({
-        "data": {
-          "values": [
-            {"x":"A", "y":28}, {"x":"B", "y":55}, {"x":"C", "y":43},
-            {"x":"D", "y":91}, {"x":"E", "y":81}, {"x":"F", "y":53},
-            {"x":"G", "y":19}, {"x":"H", "y":87}, {"x":"I", "y":52}
-          ]
-        },
-        "marktype": "bar",
-        "encoding": {
-          "y": {"type": "Q","name": "y"},
-          "x": {"type": "O","name": "x"}
-        }
-      });
-
-      vled.parse();
-      vled.format();
-    };
-
-    vled.init();
-    this.set('vled', vled);
-    //this.testing();
-  }.on('didInsertElement'),
-});

+ 0 - 10
contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js

@@ -70,16 +70,6 @@ export default Ember.Controller.extend({
       badgeProperty: 'count',
       onTabOpen: 'markMessagesAsSeen',
       tooltip: Ember.I18n.t('tooltips.notifications')
-    }),
-    Ember.Object.create({
-      iconClass: 'fa-area-chart',
-      id: 'visualization-icon',
-      action: 'toggleOverlay',
-      tooltip: Ember.I18n.t('tooltips.visualization'),
-      into: 'index',
-      outlet: 'overlay',
-      template: 'visualization-ui',
-      onTabOpen: 'onTabOpen'
     })
   ],
 

+ 0 - 109
contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js

@@ -1,109 +0,0 @@
-/**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-
-export default Ember.Controller.extend({
-
-  needs: [ constants.namingConventions.index,
-            constants.namingConventions.openQueries,
-            constants.namingConventions.jobResults
-          ],
-  index         : Ember.computed.alias('controllers.' + constants.namingConventions.index),
-  openQueries   : Ember.computed.alias('controllers.' + constants.namingConventions.openQueries),
-  results   : Ember.computed.alias('controllers.' + constants.namingConventions.jobResults),
-  jsonResults: 'Empty',
-  cachedObjects: [],
-  queryId: function () {
-      return this.get('index.model.queryId');
-  }.property('index.model.queryId'),
-  forcedContent: function () {
-    return this.get('index.model.forcedContent');
-  }.property('index.model.forcedContent'),
-  test: '',
-
-  actions: {
-    onTabOpen: function () {
-      var self = this;
-      this.set('test', 'Hello Query id: ' + this.get('queryId') + ' Query: ' + this.get('forcedContent'));
-      var tab;
-      var model = this.get('index.model');
-
-      if (model) {
-        console.log("Model present");
-        var oq = this.get('openQueries');
-
-        tab = oq.getTabForModel(model);
-
-        if (tab) {
-          console.log("Tab present");
-          this.set('test', 'Tab id: ' + tab.id + ' Tab type: ' + tab.type);
-        }
-        var query = oq.getQueryForModel(model);
-        query = this.get('index').buildQuery(query, false, false);
-        console.log("Query: " + query);
-        console.log("Title: " + model.get('title'));
-        console.log("Query: " + model.get('forcedContent'));
-        console.log("Model id: " + model.get('id'));
-        console.log("Status: " + model.status);
-        console.log("Model");
-        console.log(model);
-        console.log('Result Object: ');
-        console.log(this.get('results'));
-        console.log("Cached Results: ");
-        console.log(this.get('results').get('cachedResults'));
-        console.log("Formatted Results: ");
-        console.log(this.get('results').get('formattedResults'));
-
-        var existingJob = this.get('results').get('cachedResults').findBy('id', model.get('id'));
-        var url = this.container.lookup('adapter:application').buildURL();
-        url += '/' + constants.namingConventions.jobs + '/' + model.get('id') + '/results?first=true&count=1000';
-
-        if (existingJob) {
-          console.log("Job exists");
-          Ember.$.getJSON(url).then(function (results) {
-
-            var columns = results.schema;
-            var rows = results.rows;
-
-            if (!columns || !rows) {
-              return;
-            }
-
-            columns = columns.map(function (column) {
-              return {
-                name: column[0],
-                type: column[1],
-                index: column[2] - 1 //normalize index to 0 based
-              };
-            });
-
-            self.set('jsonResults', {columns: columns, rows: rows.slice(0,10)});
-
-          }, function (err) {
-            self.set('error', err.responseText);
-          });
-        } else {
-          this.set("error", "No visualization available. Please execute a query to visualize data.");
-        }
-      }
-    }
-  }
-
-});

+ 1 - 3
contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js

@@ -38,7 +38,6 @@ TRANSLATIONS = {
     settings: 'Settings',
     visualExplain: 'Visual Explain',
     tez: 'Tez',
-    visualization: 'Visualization',
     notifications: 'Notifications',
     expand: 'Expand query panel',
     makeSettingGlobal: 'Make setting global',
@@ -114,8 +113,7 @@ TRANSLATIONS = {
       visualExplain: 'Visual Explain',
       tez: 'TEZ',
       status: 'Status: ',
-      messages: 'Messages',
-      visualization: 'Visualization'
+      messages: 'Messages'
     },
     download: 'Save results...',
     tableSample: '{{tableName}} sample'

+ 0 - 26
contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/draggable.js

@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import dragWidget from 'hive/mixins/jquery-drag-widget'
-
-export default Ember.Mixin.create(dragWidget, {
-  uiDragOptions: ['disabled_drag', 'addClasses_drag', 'appendTo_drag', 'axis_drag', 'cancel_drag', 'connectToSortable_drag', 'containment_drag', 'cursor_drag',
-    'delay_drag', 'distance_drag', 'grid_drag', 'handle_drag', 'helper_drag', 'iframeFix_drag', 'opacity_drag', 'revert_drag', 'scope_drag', 'snap_drag', 'snapMode_drag', 'stack_drag'],
-  uiDragEvents: ['create_drag', 'start_drag', 'drag_drag', 'stop_drag'],
-});

+ 0 - 25
contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/droppable.js

@@ -1,25 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import dropWidget from 'hive/mixins/jquery-drop-widget'
-
-export default Ember.Mixin.create(dropWidget, {
-  uiDropOptions: ['accept_drop', 'activeClass_drop', 'addClasses_drop', 'disabled_drop', 'greedy_drop', 'hoverClass_drop', 'scope_drop', 'tolerance_drop'],
-  uiDropEvents: ['create_drop', 'activate_drop', 'deactivate_drop', 'over_drop', 'out_drop', 'drop_drop'],
-});

+ 0 - 109
contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drag-widget.js

@@ -1,109 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Mixin.create({
-
-  didInsertElement: function () {
-    this._super();
-    // Make jQuery UI options available as Ember properties
-    var options = this._gatherDragOptions();
-
-    // Make sure that jQuery UI events trigger methods on this view.
-    this._gatherDragEvents(options);
-
-    // Create a new instance of the jQuery UI widget based on its `uiType`
-    // and the current element.
-    var ui = jQuery.ui['draggable'](options, this.get('element'));
-
-    // Save off the instance of the jQuery UI widget as the `ui` property
-    // on this Ember view.
-    this.set('ui', ui);
-  },
-
-  willDestroyElement: function () {
-    var ui = this.get('ui');
-
-    if (ui) {
-      // Tear down any observers that were created to make jQuery UI
-      // options available as Ember properties.
-      var observers = this._observers;
-      for (var prop in observers) {
-        if (observers.hasOwnProperty(prop)) {
-          this.removeObserver(prop, observers[prop]);
-        }
-      }
-      ui._destroy();
-    }
-  },
-
-  // Each jQuery UI widget has a series of options that can be configured.
-  // For instance, to disable a button, you call
-  // `button.options('disabled', true)` in jQuery UI. To make this compatible
-  // with Ember bindings, any time the Ember property for a
-  // given jQuery UI option changes, we update the jQuery UI widget.
-  _gatherDragOptions: function () {
-    var uiDragOptions = this.get('uiDragOptions'), options = {};
-
-    // The view can specify a list of jQuery UI options that should be treated
-    // as Ember properties.
-    uiDragOptions.forEach(function (key) {
-      options[key.split('_')[0]] = this.get(key);
-
-      // Set up an observer on the Ember property. When it changes,
-      // call jQuery UI's `setOption` method to reflect the property onto
-      // the jQuery UI widget.
-      var observer = function () {
-        var value = this.get(key);
-        this.get('ui')._setOption(key.split('_')[0], value);
-      };
-
-      this.addObserver(key, observer);
-
-      // Insert the observer in a Hash so we can remove it later.
-      this._observers = this._observers || {};
-      this._observers[key] = observer;
-    }, this);
-
-    return options;
-  },
-
-  // Each jQuery UI widget has a number of custom events that they can
-  // trigger. For instance, the progressbar widget triggers a `complete`
-  // event when the progress bar finishes. Make these events behave like
-  // normal Ember events. For instance, a subclass of JQ.ProgressBar
-  // could implement the `complete` method to be notified when the jQuery
-  // UI widget triggered the event.
-  _gatherDragEvents: function (options) {
-    var uiDragEvents = this.get('uiDragEvents') || [], self = this;
-    console.log(uiDragEvents);
-    uiDragEvents.forEach(function (event) {
-      var callback = self[event];
-
-      if (callback) {
-        // You can register a handler for a jQuery UI event by passing
-        // it in along with the creation options. Update the options hash
-        // to include any event callbacks.
-        options[event.split('_')[0]] = function (event, ui) {
-          callback.call(self, event, ui);
-        };
-      }
-    });
-  }
-});

+ 0 - 111
contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drop-widget.js

@@ -1,111 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Mixin.create({
-
-  didInsertElement: function () {
-    this._super();
-    // Make jQuery UI options available as Ember properties
-    var options = this._gatherDropOptions();
-
-    // Make sure that jQuery UI events trigger methods on this view.
-    this._gatherDropEvents(options);
-
-    // Create a new instance of the jQuery UI widget based on its `uiType`
-    // and the current element.
-    var ui = jQuery.ui['droppable'](options, this.get('element'));
-    //var ui = jQuery(this.get('element'))['droppable']();
-
-    // Save off the instance of the jQuery UI widget as the `ui` property
-    // on this Ember view.
-    this.set('ui', ui);
-  },
-
-  willDestroyElement: function () {
-    var ui = this.get('ui');
-
-    if (ui) {
-      // Tear down any observers that were created to make jQuery UI
-      // options available as Ember properties.
-      var observers = this._observers;
-      for (var prop in observers) {
-        if (observers.hasOwnProperty(prop)) {
-          this.removeObserver(prop, observers[prop]);
-        }
-      }
-      ui._destroy();
-    }
-  },
-
-  // Each jQuery UI widget has a series of options that can be configured.
-  // For instance, to disable a button, you call
-  // `button.options('disabled', true)` in jQuery UI. To make this compatible
-  // with Ember bindings, any time the Ember property for a
-  // given jQuery UI option changes, we update the jQuery UI widget.
-  _gatherDropOptions: function () {
-    var uiDropOptions = this.get('uiDropOptions'), options = {};
-
-    // The view can specify a list of jQuery UI options that should be treated
-    // as Ember properties.
-    uiDropOptions.forEach(function (key) {
-      options[key.split('_')[0]] = this.get(key);
-
-      // Set up an observer on the Ember property. When it changes,
-      // call jQuery UI's `setOption` method to reflect the property onto
-      // the jQuery UI widget.
-      var observer = function () {
-        var value = this.get(key);
-        this.get('ui')._setOption(key.split('_')[0], value);
-      };
-
-      this.addObserver(key, observer);
-
-      // Insert the observer in a Hash so we can remove it later.
-      this._observers = this._observers || {};
-      this._observers[key] = observer;
-    }, this);
-
-    return options;
-  },
-
-  // Each jQuery UI widget has a number of custom events that they can
-  // trigger. For instance, the progressbar widget triggers a `complete`
-  // event when the progress bar finishes. Make these events behave like
-  // normal Ember events. For instance, a subclass of JQ.ProgressBar
-  // could implement the `complete` method to be notified when the jQuery
-  // UI widget triggered the event.
-  _gatherDropEvents: function (options) {
-    var uiDropEvents = this.get('uiDropEvents') || [], self = this;
-    console.log(uiDropEvents);
-    uiDropEvents.forEach(function (event) {
-      var callback = self[event];
-
-      if (callback) {
-        // You can register a handler for a jQuery UI event by passing
-        // it in along with the creation options. Update the options hash
-        // to include any event callbacks.
-        options[event.split('_')[0]] = function (event, ui) {
-          callback.call(self, event, ui);
-        };
-      }
-    });
-  }
-});
-

+ 0 - 110
contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-ui.js

@@ -1,110 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Mixin.create({
-
-  didInsertElement: function () {
-    // Make jQuery UI options available as Ember properties
-    var options = this._gatherOptions();
-
-    // Make sure that jQuery UI events trigger methods on this view.
-    this._gatherEvents(options);
-
-    // Create a new instance of the jQuery UI widget based on its `uiType`
-    // and the current element.
-    var ui = jQuery.ui[this.get('uiType')](options, this.get('element'));
-
-    // Save off the instance of the jQuery UI widget as the `ui` property
-    // on this Ember view.
-    this.set('ui', ui);
-  },
-
-  willDestroyElement: function () {
-    var ui = this.get('ui');
-
-    if (ui) {
-      // Tear down any observers that were created to make jQuery UI
-      // options available as Ember properties.
-      var observers = this._observers;
-      for (var prop in observers) {
-        if (observers.hasOwnProperty(prop)) {
-          this.removeObserver(prop, observers[prop]);
-        }
-      }
-      ui._destroy();
-    }
-  },
-
-  // Each jQuery UI widget has a series of options that can be configured.
-  // For instance, to disable a button, you call
-  // `button.options('disabled', true)` in jQuery UI. To make this compatible
-  // with Ember bindings, any time the Ember property for a
-  // given jQuery UI option changes, we update the jQuery UI widget.
-  _gatherOptions: function () {
-    var uiOptions = this.get('uiOptions'), options = {};
-
-    // The view can specify a list of jQuery UI options that should be treated
-    // as Ember properties.
-    uiOptions.forEach(function (key) {
-      options[key] = this.get(key);
-
-      // Set up an observer on the Ember property. When it changes,
-      // call jQuery UI's `setOption` method to reflect the property onto
-      // the jQuery UI widget.
-      var observer = function () {
-        var value = this.get(key);
-        this.get('ui')._setOption(key, value);
-      };
-
-      this.addObserver(key, observer);
-
-      // Insert the observer in a Hash so we can remove it later.
-      this._observers = this._observers || {};
-      this._observers[key] = observer;
-    }, this);
-
-    return options;
-  },
-
-  // Each jQuery UI widget has a number of custom events that they can
-  // trigger. For instance, the progressbar widget triggers a `complete`
-  // event when the progress bar finishes. Make these events behave like
-  // normal Ember events. For instance, a subclass of JQ.ProgressBar
-  // could implement the `complete` method to be notified when the jQuery
-  // UI widget triggered the event.
-  _gatherEvents: function (options) {
-    var uiEvents = this.get('uiEvents') || [], self = this;
-    console.log(uiEvents);
-    uiEvents.forEach(function (event) {
-      var callback = self[event];
-
-      if (callback) {
-        // You can register a handler for a jQuery UI event by passing
-        // it in along with the creation options. Update the options hash
-        // to include any event callbacks.
-        options[event] = function (event, ui) {
-          callback.call(self, event, ui);
-        };
-      }
-    });
-  }
-});
-
-

+ 0 - 1
contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss

@@ -21,7 +21,6 @@
 @import 'mixins';
 @import 'notifications';
 @import 'query-tabs';
-@import 'visualization-view';
 
 a {
   word-wrap: break-word;

+ 0 - 4
contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss

@@ -19,7 +19,3 @@
 $panel-background: #f5f5f5;
 $placeholder-color: #aaa;
 $border-color: #ddd;
-$btn-custom-background: #F2F2F2;
-$btn-custom-color: #333;
-$green-border: #4EB350;
-$unica-one: #5E9FA3;

+ 0 - 103
contrib/views/hive/src/main/resources/ui/hive-web/app/styles/visualization-view.scss

@@ -1,103 +0,0 @@
-/**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-.column-drag {
-  width: 180px;
-  margin: 3px 8px;
-  cursor: move !important;
-}
-
-#columns-container {
-  width: 200px;
-}
-
-.btn-custom {
-  color: $btn-custom-color;
-  border-color: $border-color;
-  background-color: $btn-custom-background;
-  text-overflow: ellipsis;
-  overflow: hidden;
-  text-align: left;
-}
-
-.drop-target {
-  display: inline-block;
-  float: left;
-  margin: -5px 10px;
-  width: 200px;
-  height: 30px;
-  color: #DDDDDD;
-  border-radius: 5px;
-  border: 1px dashed $border-color;
-}
-
-.drop-target.active {
-  border: 2px dashed $green-border;
-  background-color: #B2D3B2;
-  color: #343434;
-}
-
-.drop-target.disabled {
-  background-color: $btn-custom-background;
-}
-
-.inline-block {
-  display: inline-block;
-  float: left;
-}
-
-.droppable-text {
-  margin: 4px 10px;
-}
-
-.full-width {
-  width: 100%;
-}
-
-.field-remove {
-  color: #808080;
-  margin-top: 2px;
-  &:hover {
-    color: #564C4C;
-    //font-size: 1.1em;
-  }
-}
-
-.no-padding {
-  padding: 0px !important;
-}
-
-.no-margin {
-  margin: 0px !important;
-}
-
-.truncate {
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  -o-text-overflow: ellipsis;
-}
-
-.btn-text {
-  color: $btn-custom-color;
-  width: 91.66%;
-}
-
-.close-container {
-  width: 8.34%;
-}

+ 0 - 19
contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/draggable-view.hbs

@@ -1,19 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-{{name}}

+ 0 - 19
contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/droppable-view.hbs

@@ -1,19 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div class="droppable-text">Drag & drop a column...</div>

+ 0 - 39
contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/visualization-view.hbs

@@ -1,39 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div id="visualization_container">
-    <div class="panel panel-info">
-        <div class="panel-body">
-            <div style="clear:both;">
-              <div class="inline-block" style="margin-right:10px;"><strong>Positional</strong></div>
-                <div class="inline-block"> X: </div> {{droppable-view}}
-                <div class="inline-block"> Y: </div> {{droppable-view}}
-                <div class="inline-block"> Col: </div> {{droppable-view}}
-                <div class="inline-block"> Row: </div> {{droppable-view}}
-              <div style="clear:both;"></div>
-            </div>
-        </div>
-    </div>
-    <div id="columns-container">
-      {{yield}}
-    </div>
-  {{textarea id="vlspec" rows="15" cols="20"}}
-    <br/><button type="button" class="btn btn-success" id="btn_spec_parse">Parse</button>
-    <br/><br/>
-    <div id="vis"></div>
-</div>

+ 0 - 56
contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs

@@ -1,56 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div id="visualization" class="index-overlay">
-  {{#panel-widget headingTranslation="titles.query.visualization"}}
-    {{#if error}}
-      <div class="alert alert-danger" role="alert"><strong>{{error}}</strong></div>
-    {{else}}
-      <div>
-          <h3>Visualization</h3>
-          {{#visualization-view json=jsonResults}}
-            {{#each column in jsonResults.columns}}
-              {{draggable-view name=column.name}}
-            {{/each}}
-          {{/visualization-view}}
-      </div>
-      <div><h3>JSON Result: </h3><br/>
-        <div id="query-results">
-          <table class="table table-expandable">
-              <thead>
-              <tr>
-                {{#each column in jsonResults.columns}}
-                    <th> {{column.name}} </th>
-                {{/each}}
-              </tr>
-              </thead>
-              <tbody>
-              {{#each row in jsonResults.rows}}
-                  <tr>
-                    {{#each item in row}}
-                        <td>{{item}}</td>
-                    {{/each}}
-                  </tr>
-              {{/each}}
-              </tbody>
-          </table>
-        </div>
-      </div>
-    {{/if}}
-  {{/panel-widget}}
-</div>

+ 0 - 37
contrib/views/hive/src/main/resources/ui/hive-web/app/views/visualization-ui.js

@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.View.extend({
-  didInsertElement: function () {
-    var target = this.$('#visualization');
-    var panel = this.$('#visualization .panel-body').first();
-
-    panel.css('min-height', $('.main-content').height());
-    target.animate({ width: $('.main-content').width() }, 'fast');
-  },
-
-  willDestroyElement: function () {
-    var target = this.$('#visualization');
-    var panel = this.$('#visualization .panel-body');
-
-    panel.css('min-height', 0);
-    target.css('width', 0);
-  }
-});

+ 1 - 4
contrib/views/hive/src/main/resources/ui/hive-web/bower.json

@@ -17,10 +17,7 @@
     "blanket": "~1.1.5",
     "jquery-ui": "~1.11.2",
     "selectize": "~0.12.0",
-    "pretender": "0.1.0",
-    "vega": "~1.5.0",
-    "vega-lite": "https://github.com/vivekratnavel/vega-lite.git",
-    "draggabilly": "~1.2.4"
+    "pretender": "0.1.0"
   },
   "resolutions": {
     "ember": "1.10.0"

File diff suppressed because it is too large
+ 0 - 6176
contrib/views/hive/src/main/resources/ui/hive-web/vendor/vega-lite.js


Some files were not shown because too many files changed in this diff