1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 'use strict';
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: BI Dashboard
- *| (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(['dashboard-analytics/visualizations/interactions/FilterAction', 'jquery', 'underscore'], function (FilterAction, $, _) {
- var TimelineHighlightAction = FilterAction.extend({
- // TODO: Investigate the removal of pageContextAPI and services
- init: function init(visualization, slot, index, pageContextAPI, services, logger, highlightAct) {
- this.visualization = visualization;
- this.slot = slot;
- this.dataItem = slot.getDataItemList()[index];
- this.mapIndex = index;
- this.pageContextAPI = pageContextAPI;
- this.services = services;
- this.logger = logger;
- this.itemContext = {
- uniqueId: this.dataItem.getId(),
- itemId: this.dataItem.getColumnId(),
- itemName: this.dataItem.getLabel(),
- dataType: this.dataItem.getDataType(),
- sourceId: this.visualization.getDataSource().getId()
- };
- this.renderModule = this.getEditorModuleName();
- this.highlightAct = highlightAct;
- },
- removeFilter: function removeFilter(columnId) {
- var payload = $.extend(true, [], this.highlightAct.get('payload'));
- _.find(this.highlightAct.payload, function (column, index) {
- if (column.columnId === columnId) {
- // no need to set model if the column includes all already
- if (!column.operator) {
- return true;
- }
- var includeAll = {
- columnId: payload[index].columnId,
- columnLabel: payload[index].columnLabel,
- id: payload[index].columnId,
- values: []
- };
- if (payload[index].aggregationType) {
- includeAll.aggregationType = payload[index].aggregationType;
- }
- payload[index] = includeAll;
- this.highlightAct.set({
- payload: payload
- });
- return true;
- }
- }.bind(this));
- },
- /**
- * @override
- */
- getEditorModuleName: function getEditorModuleName() {
- return 'storytelling/views/highlight/TimelineHighlightEditWrapperView';
- }
- });
- return TimelineHighlightAction;
- });
- //# sourceMappingURL=TimelineHighlightAction.js.map
|