diff --git a/client/app/services/query.js b/client/app/services/query.js index 13fea386..ef6418e7 100644 --- a/client/app/services/query.js +++ b/client/app/services/query.js @@ -19,32 +19,6 @@ function collectParams(parts) { return parameters; } -class QueryResultError { - constructor(errorMessage) { - this.errorMessage = errorMessage; - } - - getError() { - return this.errorMessage; - } - - static getStatus() { - return 'failed'; - } - - static getData() { - return null; - } - - static getLog() { - return null; - } - - static getChartData() { - return null; - } -} - class Parameter { constructor(parameter) { this.title = parameter.title; @@ -170,6 +144,36 @@ class Parameters { } function QueryResource($resource, $http, $q, $location, currentUser, QueryResult) { + class QueryResultError { + constructor(errorMessage) { + this.errorMessage = errorMessage; + } + + getError() { + return this.errorMessage; + } + + toPromise() { + return $q.reject(this.getError()); + } + + static getStatus() { + return 'failed'; + } + + static getData() { + return null; + } + + static getLog() { + return null; + } + + static getChartData() { + return null; + } + } + const Query = $resource( 'api/queries/:id', { id: '@id' }, diff --git a/client/app/visualizations/chart/plotly/utils.js b/client/app/visualizations/chart/plotly/utils.js index b3290593..c118f49f 100644 --- a/client/app/visualizations/chart/plotly/utils.js +++ b/client/app/visualizations/chart/plotly/utils.js @@ -1,6 +1,6 @@ import { isArray, isNumber, isString, isUndefined, includes, min, max, has, find, -each, values, sortBy, identity, filter, map, extend, reduce, + each, values, sortBy, identity, filter, map, extend, reduce, } from 'lodash'; import moment from 'moment'; import { createFormatter, formatSimpleTemplate } from '@/lib/value-format';