123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Watson Analytics (C) Copyright IBM Corp. 2017, 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/ui/WidgetBase'], function (BaseWidget) {
- 'use strict';
- /**
- * Base widget for any analytics relatee widget. (e.g. liveWidget, fitlerWidget)
- *
- */
- var AnalyticsBaseWidget = BaseWidget.extend({
- init: function init() {
- AnalyticsBaseWidget.inherited('init', this, arguments);
- var internalDashboardFeature = this.dashboardApi.getFeature('internal');
- if (internalDashboardFeature) {
- this.boardModel = internalDashboardFeature.getBoardModel();
- if (this.boardModel.pageContext) {
- this.pageContextAPI = this.boardModel.pageContext.getAPI();
- }
- }
- },
- getDashboardApi: function getDashboardApi() {
- return this.dashboardApi;
- },
- _updateEventGroupIdInPageContext: function _updateEventGroupIdInPageContext(newChannelId, options) {
- if (this.pageContextAPI) {
- this.pageContextAPI.updateEventGroupId(this.id, this.getContainerPageId(), newChannelId, options);
- }
- },
- onRemoveCurrentEventRouter: function onRemoveCurrentEventRouter(options) {
- this._updateEventGroupIdInPageContext(null, options);
- },
- onNewEventRouter: function onNewEventRouter(options) {
- this._updateEventGroupIdInPageContext(this.eventRouter.channelId, options);
- }
- });
- return AnalyticsBaseWidget;
- });
- //# sourceMappingURL=AnalyticsBaseWidget.js.map
|