mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-03 12:47:13 -06:00
Merge branch 'master' into sda-2947
This commit is contained in:
commit
bce80e940c
@ -1,7 +1,8 @@
|
|||||||
export interface IAnalyticsData {
|
export interface IAnalyticsData {
|
||||||
element: AnalyticsElements;
|
element: AnalyticsElements;
|
||||||
action_type?: MenuActionTypes | ScreenSnippetActionTypes;
|
action_type?: MenuActionTypes | ScreenSnippetActionTypes | ToastNotificationActionTypes;
|
||||||
action_result?: AnalyticsActions;
|
action_result?: AnalyticsActions;
|
||||||
|
extra_data?: object;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ICrashData extends IAnalyticsData {
|
export interface ICrashData extends IAnalyticsData {
|
||||||
@ -29,6 +30,10 @@ export enum ScreenSnippetActionTypes {
|
|||||||
ANNOTATE_ERASED = 'annotate_erased',
|
ANNOTATE_ERASED = 'annotate_erased',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum ToastNotificationActionTypes {
|
||||||
|
TOAST_CLOSED = 'toast_closed',
|
||||||
|
}
|
||||||
|
|
||||||
export enum AnalyticsActions {
|
export enum AnalyticsActions {
|
||||||
ENABLED = 'ON',
|
ENABLED = 'ON',
|
||||||
DISABLED = 'OFF',
|
DISABLED = 'OFF',
|
||||||
@ -37,6 +42,7 @@ export enum AnalyticsActions {
|
|||||||
export enum AnalyticsElements {
|
export enum AnalyticsElements {
|
||||||
MENU = 'Menu',
|
MENU = 'Menu',
|
||||||
SCREEN_CAPTURE_ANNOTATE = 'screen_capture_annotate',
|
SCREEN_CAPTURE_ANNOTATE = 'screen_capture_annotate',
|
||||||
|
TOAST_NOTIFICATION = 'toast_notification',
|
||||||
SDA_CRASH = 'sda_crash',
|
SDA_CRASH = 'sda_crash',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
import { app, BrowserWindow, ipcMain } from 'electron';
|
import { app, BrowserWindow, ipcMain } from 'electron';
|
||||||
|
|
||||||
|
import {
|
||||||
|
analytics,
|
||||||
|
AnalyticsElements,
|
||||||
|
ToastNotificationActionTypes,
|
||||||
|
} from '../app/analytics-handler';
|
||||||
import { config } from '../app/config-handler';
|
import { config } from '../app/config-handler';
|
||||||
import { createComponentWindow, windowExists } from '../app/window-utils';
|
import { createComponentWindow, windowExists } from '../app/window-utils';
|
||||||
import { AnimationQueue } from '../common/animation-queue';
|
import { AnimationQueue } from '../common/animation-queue';
|
||||||
@ -73,6 +78,19 @@ class Notification extends NotificationHandler {
|
|||||||
constructor(opts) {
|
constructor(opts) {
|
||||||
super(opts);
|
super(opts);
|
||||||
ipcMain.on('close-notification', (_event, windowId) => {
|
ipcMain.on('close-notification', (_event, windowId) => {
|
||||||
|
const browserWindow = this.getNotificationWindow(windowId);
|
||||||
|
if (
|
||||||
|
browserWindow &&
|
||||||
|
windowExists(browserWindow) &&
|
||||||
|
browserWindow.notificationData
|
||||||
|
) {
|
||||||
|
const notificationData = (browserWindow.notificationData as any).data;
|
||||||
|
analytics.track({
|
||||||
|
element: AnalyticsElements.TOAST_NOTIFICATION,
|
||||||
|
action_type: ToastNotificationActionTypes.TOAST_CLOSED,
|
||||||
|
extra_data: notificationData || {},
|
||||||
|
});
|
||||||
|
}
|
||||||
// removes the event listeners on the client side
|
// removes the event listeners on the client side
|
||||||
this.notificationClosed(windowId);
|
this.notificationClosed(windowId);
|
||||||
this.hideNotification(windowId);
|
this.hideNotification(windowId);
|
||||||
|
Loading…
Reference in New Issue
Block a user