@adaptabletools/adaptable-plugin-openfin 12.0.0-canary.3 → 12.0.0-canary.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-plugin-openfin",
3
- "version": "12.0.0-canary.3",
3
+ "version": "12.0.0-canary.6",
4
4
  "description": "",
5
5
  "homepage": "http://www.adaptabletools.com/",
6
6
  "author": {
@@ -20,6 +20,6 @@
20
20
  "redux": "4.0.5",
21
21
  "styled-components": "^4.4.1",
22
22
  "tslib": "^2.0.0",
23
- "@adaptabletools/adaptable": "12.0.0-canary.3"
23
+ "@adaptabletools/adaptable": "12.0.0-canary.6"
24
24
  }
25
25
  }
@@ -7,6 +7,7 @@ const ModuleConstants = tslib_1.__importStar(require("@adaptabletools/adaptable/
7
7
  const OpenFinRedux = tslib_1.__importStar(require("./Redux/ActionReducers/OpenFinRedux"));
8
8
  const openfin_notifications_1 = require("openfin-notifications");
9
9
  const isRunningInOpenfin_1 = require("./Utilities/isRunningInOpenfin");
10
+ const AdaptableIconComponent_1 = require("@adaptabletools/adaptable/src/components/AdaptableIconComponent");
10
11
  // needed because otherwise openfin-notifications is not initialized properly
11
12
  // as it assumes it's running before DOMContentLoaded, but nextjs and other bundlers
12
13
  // might inject it after DOMContentLoaded is fired - so we fire it programatically
@@ -114,13 +115,14 @@ class OpenFinApiImpl extends ApiBase_1.ApiBase {
114
115
  }
115
116
  const showIcon = this.options.showAppIconInNotifications;
116
117
  const appIcon = (_a = this.adaptable.api.internalApi.getAdaptableOptions().userInterfaceOptions) === null || _a === void 0 ? void 0 : _a.applicationIcon;
117
- if (!notification.icon && appIcon && showIcon) {
118
+ if (!notification.icon && showIcon && AdaptableIconComponent_1.isAdaptableExternalIcon(appIcon)) {
118
119
  notification.icon = appIcon.src;
119
120
  }
120
121
  const fn = this.options.onShowNotification;
121
122
  if (fn && fn(notification, alert) === false) {
122
123
  return;
123
124
  }
125
+ // see https://developers.openfin.co/of-docs/docs/customize-notifications
124
126
  openfin_notifications_1.create(notification);
125
127
  }
126
128
  getOpenFinState() {
@@ -16,7 +16,7 @@ export declare function OnWorkbookSaved(): IEvent<any, {
16
16
  }>;
17
17
  export declare function isRunningInOpenfin(): boolean;
18
18
  export declare function isExcelOpenfinLoaded(): boolean;
19
- export declare function pushData(workBookName: string, data: any[]): Promise<any>;
19
+ export declare function pushData(workBookName: string, data: any[]): Promise<void>;
20
20
  /**
21
21
  * @deprecated not used anymore
22
22
  */
@@ -3,30 +3,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OpenFinReducer = exports.initialOpenFinState = exports.OpenFinSetCurrentReportName = exports.OpenFinLiveReportClear = exports.OpenFinLiveReportSet = exports.OpenFinStopLiveData = exports.OpenFinStartLiveData = void 0;
4
4
  const PluginsRedux_1 = require("@adaptabletools/adaptable/src/Redux/ActionsReducers/PluginsRedux");
5
5
  const GeneralConstants_1 = require("@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants");
6
- exports.OpenFinStartLiveData = (openFinReport) => ({
6
+ const OpenFinStartLiveData = (openFinReport) => ({
7
7
  type: PluginsRedux_1.OPENFIN_START_LIVE_DATA,
8
8
  openFinReport: openFinReport,
9
9
  });
10
- exports.OpenFinStopLiveData = (openFinReport) => ({
10
+ exports.OpenFinStartLiveData = OpenFinStartLiveData;
11
+ const OpenFinStopLiveData = (openFinReport) => ({
11
12
  type: PluginsRedux_1.OPENFIN_STOP_LIVE_DATA,
12
13
  openFinReport: openFinReport,
13
14
  });
14
- exports.OpenFinLiveReportSet = (openFinReport) => ({
15
+ exports.OpenFinStopLiveData = OpenFinStopLiveData;
16
+ const OpenFinLiveReportSet = (openFinReport) => ({
15
17
  type: PluginsRedux_1.OPENFIN_LIVE_REPORT_SET,
16
18
  openFinReport: openFinReport,
17
19
  });
18
- exports.OpenFinLiveReportClear = () => ({
20
+ exports.OpenFinLiveReportSet = OpenFinLiveReportSet;
21
+ const OpenFinLiveReportClear = () => ({
19
22
  type: PluginsRedux_1.OPENFIN_LIVE_REPORT_CLEAR,
20
23
  });
21
- exports.OpenFinSetCurrentReportName = (reportName) => ({
24
+ exports.OpenFinLiveReportClear = OpenFinLiveReportClear;
25
+ const OpenFinSetCurrentReportName = (reportName) => ({
22
26
  type: PluginsRedux_1.OPENFIN_SET_CURRENT_REPORTNAME,
23
27
  reportName,
24
28
  });
29
+ exports.OpenFinSetCurrentReportName = OpenFinSetCurrentReportName;
25
30
  exports.initialOpenFinState = {
26
31
  CurrentLiveOpenFinReport: undefined,
27
32
  OpenFinCurrentReportName: GeneralConstants_1.EMPTY_STRING,
28
33
  };
29
- exports.OpenFinReducer = (
34
+ const OpenFinReducer = (
30
35
  // initial state is handled in the plugin rootReducer
31
36
  state, action) => {
32
37
  switch (action.type) {
@@ -48,3 +53,4 @@ state, action) => {
48
53
  return state;
49
54
  }
50
55
  };
56
+ exports.OpenFinReducer = OpenFinReducer;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setup = void 0;
4
4
  const logger_1 = require("../../logger");
5
- exports.setup = async () => {
5
+ const setup = async () => {
6
6
  const excelAssetAlias = 'excel-api-addin';
7
7
  const excelServiceUuid = '886834D1-4651-4872-996C-7B2578E953B9';
8
8
  const installFolder = '%localappdata%\\OpenFin\\shared\\assets\\excel-api-addin';
@@ -106,3 +106,4 @@ exports.setup = async () => {
106
106
  });
107
107
  }
108
108
  };
109
+ exports.setup = setup;
package/src/index.js CHANGED
@@ -105,7 +105,8 @@ class OpenFinPlugin extends types_1.AdaptablePlugin {
105
105
  this.OpenFinService = new OpenFinService_1.OpenFinService(adaptable, this.options);
106
106
  adaptable.api.eventApi.on('AlertFired', (alertFiredInfo) => {
107
107
  var _a, _b;
108
- if (this.options.showAdaptableAlertsAsNotifications && ((_b = (_a = alertFiredInfo.alert) === null || _a === void 0 ? void 0 : _a.alertDefinition.AlertProperties) === null || _b === void 0 ? void 0 : _b.DisplayNotification)) {
108
+ if (this.options.showAdaptableAlertsAsNotifications &&
109
+ ((_b = (_a = alertFiredInfo.alert) === null || _a === void 0 ? void 0 : _a.alertDefinition.AlertProperties) === null || _b === void 0 ? void 0 : _b.DisplayNotification)) {
109
110
  if (!alertFiredInfo.alert.alertDefinition.AlertForm ||
110
111
  typeof alertFiredInfo.alert.alertDefinition.AlertForm === 'string') {
111
112
  // bail out early for no forms or for more dynamic forms