12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- '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. 2019
- * 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', './api/QueryModifierAPI', 'underscore'], function (APIFactory, QueryProviderAPI, QueryModifierAPI, _) {
- var DetailQueryProvider = function () {
- function DetailQueryProvider(options) {
- _classCallCheck(this, DetailQueryProvider);
- var features = options && options.features;
- if (features) {
- this._mainProvider = features.QueryProvider;
- this._mainModifier = features.QueryModifier;
- }
- var queryExecution = features && features.DataQueryExecution;
- if (queryExecution) {
- queryExecution.registerQueryProvider(this.getAPI());
- queryExecution.registerQueryModifier(this.getAPI());
- }
- }
- DetailQueryProvider.prototype.getAPI = function getAPI() {
- if (!this.api) {
- this.api = APIFactory.createAPI(this, [QueryProviderAPI, QueryModifierAPI]);
- }
- return this.api;
- };
- DetailQueryProvider.prototype.getType = function getType() {
- return 'detail';
- };
- DetailQueryProvider.prototype.getQuerySpecList = function getQuerySpecList() {
- var querySpecList = this._mainProvider && this._mainProvider.getQuerySpecList();
- return _.chain(querySpecList)
- // apply details of the main query (ie. filter out minmax query)
- .filter(function (entry) {
- return entry.type === 'main';
- })
- // update the query spec type in order to request disaggregated detail result
- .map(function (entry) {
- _.extend(entry.spec, {
- type: 'detail'
- });
- return entry;
- }).value();
- };
- DetailQueryProvider.prototype.modifyQuerySpecList = function modifyQuerySpecList(specList) {
- return this._mainModifier && this._mainModifier.modifyQuerySpecList(specList);
- };
- return DetailQueryProvider;
- }();
- return DetailQueryProvider;
- });
- //# sourceMappingURL=DetailQueryProvider.js.map
|