12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 'use strict';
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['../../../lib/@waca/dashboard-common/dist/core/APIFactory', './api/QueryProviderAPI', 'underscore'], function (APIFactory, QueryProviderAPI, _) {
- var SummaryQueryProvider = function () {
- function SummaryQueryProvider(options) {
- _classCallCheck(this, SummaryQueryProvider);
- var features = options && options.features;
- if (features) {
- this._mainProvider = features.QueryProvider;
- }
- var queryExecution = features && features.DataQueryExecution;
- if (queryExecution) {
- queryExecution.registerQueryProvider(this.getAPI());
- }
- }
- SummaryQueryProvider.prototype.getAPI = function getAPI() {
- if (!this.api) {
- this.api = APIFactory.createAPI(this, [QueryProviderAPI]);
- }
- return this.api;
- };
- SummaryQueryProvider.prototype.getType = function getType() {
- return 'summary';
- };
- SummaryQueryProvider.prototype.getQuerySpecList = function getQuerySpecList() {
- var querySpecList = this._mainProvider && this._mainProvider.getQuerySpecList();
- return _.chain(querySpecList)
- // Get the main query (ie. filter out minmax query)
- .filter(function (entry) {
- return entry.type === 'main';
- })
- // update the query spec type
- .map(function (entry) {
- _.extend(entry.spec, {
- type: 'summary'
- });
- return entry;
- }).value();
- };
- return SummaryQueryProvider;
- }();
- return SummaryQueryProvider;
- });
- //# sourceMappingURL=SummaryQueryProvider.js.map
|