Sha256: 38f462951a389fc787922dc011e24dfe36319194072fb5ba916dff5e6cd13ceb

Contents?: true

Size: 1.2 KB

Versions: 32

Compression:

Stored size: 1.2 KB

Contents

!(angular => {
  'use strict';

  function AlertModelImports(AlertResource, StandardModel, PollService) {

    return class Alert extends StandardModel {

      constructor() {
        super(
          'alert',
          AlertResource,
          {
            email: '',
            query_title: '',
            target: NaN,
            comparator: '',
            status: '',
            description: ''
          },
          [
            'email',
            'comparator',
            'target',
            'description',
            'query_title'
          ]
         );
        this._pollItemKey = 'alertItem_' + new Date().getTime();
      }

      save() {
        if (this.item.status !== 'Paused') {
          this.item.status = 'Pending';
        }

        return super.save().then(this._pollItem.bind(this));
      }

      //private methods

      _pollItem(item) {
        PollService.unPoll(this._pollItemKey);
        PollService.poll(item, this._pollItemKey, () => item.status !== 'Pending');
        return item;
      }
    };
  }

  AlertModelImports.$inject = ['AlertResource', 'StandardModel', 'PollService'];
  angular.module('alephServices.alert', []).service('Alert', AlertModelImports);
}(angular));

Version data entries

32 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.4.9.pre.dev app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.4.8 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.4.8 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.4.7 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.4.7 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.4.4 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.4.4 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.4.2 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.4.2 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.4.1 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.4.1 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.3.0 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.3.0 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.2.0 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.2.0 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.1.0 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.1.0 app/assets/javascripts/angular/services/alert/alert.js.es6
aleph_analytics-0.0.6 public/assets/angular/services/alert/alert.js-a76ea96e948de324fcc00f3ef3ecae4e.es6
aleph_analytics-0.0.6 app/assets/javascripts/angular/services/alert/alert.js.es6