'use strict'; /* *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| IBM Cognos Products: Content Explorer *| (C) Copyright IBM Corp. 2016, 2018 *| *| US Government Users Restricted Rights - Use, duplication or disclosure *| restricted by GSA ADP Schedule Contract with IBM Corp. *+------------------------------------------------------------------------+ */ define(['../../lib/@waca/core-client/js/core-client/ui/core/Class', '../../DynamicFileLoader'], function (Class, DynamicFileLoader) { 'use strict'; var Action = Class.extend({ /** * if necessary set visibility on condition, * extra options parameter can be passed in */ isItemVisible: function isItemVisible() { return true; }, /** * Callback when select a context menu item * * @param context {object} * */ onSelectItem: function onSelectItem(context) { var oTarget = context.target; var result = void 0; switch (oTarget.itemId) { case 'com.ibm.bi.dashboard.dataSources.relinkDataSource': var oActiveObject = oTarget.activeObject; if (oActiveObject) { result = DynamicFileLoader.load([oActiveObject.dialogModule]).then(function (modules) { var openDialog = new modules[0]({ 'dashboardApi': context.glassContext.appController.getCurrentContentView().getDashboardApi(), 'dataSource': oActiveObject.dataSource, 'dataSourceName': oActiveObject.dataSourceName }); openDialog.open(); return openDialog; }); } break; default: //Default behavior } return result; } }); return Action; }); //# sourceMappingURL=DSContextMenuActionHandler.js.map