12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- '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/DataPointActionsAPI', 'underscore'], function (APIFactory, DataPointActionsAPI, _) {
- var DataPointActions = function () {
- function DataPointActions() {
- _classCallCheck(this, DataPointActions);
- this.api = APIFactory.createAPI(this, [DataPointActionsAPI]);
- this.providers = {};
- }
- DataPointActions.prototype.registerProvider = function registerProvider(name, provider) {
- this.providers[name] = provider;
- };
- DataPointActions.prototype.getDataPointActionList = function getDataPointActionList(selections, options) {
- var actions = [];
- for (var actionName in this.providers) {
- var provider = this.providers[actionName];
- if (provider.getDataPointActionList) {
- var dataPointAction = null;
- try {
- dataPointAction = provider.getDataPointActionList(selections, options);
- } catch (e) {
- console.log(e);
- }
- if (!_.isEmpty(dataPointAction)) {
- actions.push.apply(actions, dataPointAction);
- }
- }
- }
- return actions;
- };
- DataPointActions.prototype.getAPI = function getAPI() {
- return this.api;
- };
- return DataPointActions;
- }();
- return DataPointActions;
- });
- //# sourceMappingURL=DataPointActions.js.map
|