adjust enum names for added browser types

This commit is contained in:
Kyle Spearrin 2018-07-09 09:04:47 -04:00
parent 8ac3450d9e
commit 621a6d1524
4 changed files with 39 additions and 26 deletions

View File

@ -31,14 +31,14 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
if (!this.deviceCache) {
switch (process.platform) {
case 'win32':
this.deviceCache = DeviceType.Windows;
this.deviceCache = DeviceType.WindowsDesktop;
break;
case 'darwin':
this.deviceCache = DeviceType.MacOs;
this.deviceCache = DeviceType.MacOsDesktop;
break;
case 'linux':
default:
this.deviceCache = DeviceType.Linux;
this.deviceCache = DeviceType.LinuxDesktop;
break;
}
}

View File

@ -1,12 +1,23 @@
export enum DeviceType {
Chrome = 2,
Firefox = 3,
Opera = 4,
Edge = 5,
Windows = 6,
MacOs = 7,
Linux = 8,
Vivaldi = 19,
Safari = 20,
Web = 21,
Android = 0,
iOS = 1,
ChromeExtension = 2,
FirefoxExtension = 3,
OperaExtension = 4,
EdgeExtension = 5,
WindowsDesktop = 6,
MacOsDesktop = 7,
LinuxDesktop = 8,
ChromeBrowser = 9,
FirefoxBrowser = 10,
OperaBrowser = 11,
EdgeBrowser = 12,
IEBrowser = 13,
UnknownBrowser = 14,
AndroidAmazon = 15,
UWP = 16,
SafariBrowser = 17,
VivaldiBrowser = 18,
VivaldiExtension = 19,
SafariExtension = 20,
}

View File

@ -9,16 +9,15 @@ import { DeviceType } from '../enums/deviceType';
const GaObj = 'ga';
export const AnalyticsIds = {
[DeviceType.Chrome]: 'UA-81915606-6',
[DeviceType.Firefox]: 'UA-81915606-7',
[DeviceType.Opera]: 'UA-81915606-8',
[DeviceType.Edge]: 'UA-81915606-9',
[DeviceType.Vivaldi]: 'UA-81915606-15',
[DeviceType.Safari]: 'UA-81915606-16',
[DeviceType.Windows]: 'UA-81915606-17',
[DeviceType.Linux]: 'UA-81915606-19',
[DeviceType.MacOs]: 'UA-81915606-18',
[DeviceType.Web]: 'UA-81915606-3',
[DeviceType.ChromeExtension]: 'UA-81915606-6',
[DeviceType.FirefoxExtension]: 'UA-81915606-7',
[DeviceType.OperaExtension]: 'UA-81915606-8',
[DeviceType.EdgeExtension]: 'UA-81915606-9',
[DeviceType.VivaldiExtension]: 'UA-81915606-15',
[DeviceType.SafariExtension]: 'UA-81915606-16',
[DeviceType.WindowsDesktop]: 'UA-81915606-17',
[DeviceType.LinuxDesktop]: 'UA-81915606-19',
[DeviceType.MacOsDesktop]: 'UA-81915606-18',
};
export class Analytics {

View File

@ -85,9 +85,12 @@ export class ApiService implements ApiServiceAbstraction {
private logoutCallback: (expired: boolean) => Promise<void>) {
const device = platformUtilsService.getDevice();
this.deviceType = device.toString();
this.isWebClient = device === DeviceType.Web;
this.isDesktopClient = device === DeviceType.Windows || device === DeviceType.MacOs ||
device === DeviceType.Linux;
this.isWebClient = device === DeviceType.IEBrowser || device === DeviceType.ChromeBrowser ||
device === DeviceType.EdgeBrowser || device === DeviceType.FirefoxBrowser ||
device === DeviceType.OperaBrowser || device === DeviceType.SafariBrowser ||
device === DeviceType.UnknownBrowser || device === DeviceType.VivaldiBrowser;
this.isDesktopClient = device === DeviceType.WindowsDesktop || device === DeviceType.MacOsDesktop ||
device === DeviceType.LinuxDesktop;
}
setUrls(urls: EnvironmentUrls): void {