Sha256: fd661f1a7edf7d806873a8116ef299fe2399c7d1e5b336998640863127190a59

Contents?: true

Size: 1.3 KB

Versions: 18

Compression:

Stored size: 1.3 KB

Contents

!(angular => {
  'use strict';

  function QueryModelImports(QueryResource, ParameterMethods, StandardModel, $q) {

    return class Query extends StandardModel {

      constructor() {
        super(
          'query',
          QueryResource,
          {
            title: '',
            tags: [],
            version: {
              body: '',
              parameters: []
            }
          },
          [
            'title',
            'version.body',
            'roles',
            'tags'
          ]
        );
      }

      initItem(queryId, queryVersionId) {
        if (queryId && queryVersionId) {
          return super.fetch({
            id: queryId,
            version_id: queryVersionId
          });
        } else {
          this.item = this._newItem();
          return $q.when(this.item);
        }
      }

      detectParameters() {
        ParameterMethods.detectParameters(this.item.version.body, this.item.version.parameters);
      }

      addParameter(name) {
        let parameter = ParameterMethods.constructParameter(name);
        this.item.version.parameters.push(parameter);
      }
    };
  }

  QueryModelImports.$inject = ['QueryResource', 'ParameterMethods', 'StandardModel', '$q'];
  angular.module('alephServices.query', []).service('Query', QueryModelImports);

}(angular));

Version data entries

18 entries across 9 versions & 1 rubygems

Version Path
aleph_analytics-0.2.0 app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.2.0 public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.1.0 app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.1.0 public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.6 public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.6 app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.0.5 app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.0.5 public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.4 public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.4 app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.0.3 public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.3 app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.0.2 public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.2 app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.0.1.alpha app/assets/javascripts/angular/services/query/query.js.es6
aleph_analytics-0.0.1.alpha public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.0.alpha public/assets/angular/services/query/query.js-7b6228d0a5c1a6ea76242f4aa49aafd0.es6
aleph_analytics-0.0.0.alpha app/assets/javascripts/angular/services/query/query.js.es6