Sha256: b89729ef248c432955c92f1466cf63e1eaa0a39f1522c2ab79defae20ef75c21

Contents?: true

Size: 1.08 KB

Versions: 10

Compression:

Stored size: 1.08 KB

Contents

!(angular => {
  'use strict';

  class QueryHandler {
    constructor($location, AlertFlash, $q) {
      this._alertFlash = AlertFlash;
      this._$location = $location;
      this._$q = $q;
    }

    success(action, schedule, query) {
      let _action =  action || 'action';
      let _schedule = _.exists(schedule) ? schedule : false;

      this._alertFlash.emitSuccess('Query "' + query.title + '" ' + _action + 'd!', _schedule);
      return query;
    }

    handleReplExit(error) {
      if(error === 'QueryReplExit') {
        // consume the error
        this._alertFlash.emitInfo('Exited editing REPL without saving', false);
      } else {
        return this._$q.reject(error);
      }
    }

    navigateToLatestVersion(query) {
      this._$location.path('/queries/' + query.id + '/query_versions/' + query.version.id);
      return query;
    }

    navigateToIndex() {
      this._$location.path('/queries');
    }
  }

  QueryHandler.$inject = ['$location', 'AlertFlash', '$q'];
  angular.module('alephServices.queryHandler', []).service('QueryHandler', QueryHandler);
}(angular));

Version data entries

10 entries across 5 versions & 1 rubygems

Version Path
aleph_analytics-0.0.4 public/assets/angular/services/query/query_handler.js-d8cb3c66bcf6d16cd13bb5bcd0921496.es6
aleph_analytics-0.0.4 app/assets/javascripts/angular/services/query/query_handler.js.es6
aleph_analytics-0.0.3 app/assets/javascripts/angular/services/query/query_handler.js.es6
aleph_analytics-0.0.3 public/assets/angular/services/query/query_handler.js-d8cb3c66bcf6d16cd13bb5bcd0921496.es6
aleph_analytics-0.0.2 public/assets/angular/services/query/query_handler.js-d8cb3c66bcf6d16cd13bb5bcd0921496.es6
aleph_analytics-0.0.2 app/assets/javascripts/angular/services/query/query_handler.js.es6
aleph_analytics-0.0.1.alpha public/assets/angular/services/query/query_handler.js-d8cb3c66bcf6d16cd13bb5bcd0921496.es6
aleph_analytics-0.0.1.alpha app/assets/javascripts/angular/services/query/query_handler.js.es6
aleph_analytics-0.0.0.alpha app/assets/javascripts/angular/services/query/query_handler.js.es6
aleph_analytics-0.0.0.alpha public/assets/angular/services/query/query_handler.js-d8cb3c66bcf6d16cd13bb5bcd0921496.es6