mattermost-desktop/src/types/config.ts

134 lines
3.1 KiB
TypeScript
Raw Normal View History

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export type Tab = {
name: string;
order: number;
isOpen?: boolean;
}
export type Team = {
name: string;
order: number;
url: string;
lastActiveTab?: number;
}
export type TeamWithIndex = Team & {index: number};
export type TeamWithTabs = Team & {tabs: Tab[]};
export type TeamWithTabsAndGpo = TeamWithTabs & {isGpo?: boolean};
export type Config = ConfigV3;
export type ConfigV3 = {
version: 3;
teams: TeamWithTabs[];
showTrayIcon: boolean;
trayIconTheme: string;
minimizeToTray: boolean;
notifications: {
flashWindow: number;
bounceIcon: boolean;
bounceIconType: 'critical' | 'informational';
};
showUnreadBadge: boolean;
useSpellChecker: boolean;
enableHardwareAcceleration: boolean;
autostart: boolean;
hideOnStart: boolean;
spellCheckerLocales: string[];
darkMode: boolean;
downloadLocation?: string;
spellCheckerURL?: string;
lastActiveTeam?: number;
startInFullscreen?: boolean;
[MM-18552] Autoupdater (#1714) * wip * background download * various fixes * wip * wokring autoupgrade * fix menu * fix windows * cleanup * add publishername * fix messages and titles * Test updates * Moved module and added functionality to click icon to install (instead of just download) * Add auto update setting, update on close app if downloaded * Tests, changes for security fixes, update version number * Update E2E tests * Lint fix * Update to latest electron-updater * Revert to stable electron-builder (only needed to update electron-updater) * Fix package-lock * skip flaky test * Update package * Fix E2E test * Fixes for enabling/disabled autoupdater * Fixed GPO definitions * [MM-38300] Set localhost as the test server * blank * Switch to s3 bucket for testing * Update icons to match spec * Add menu items for download/update actions * Type and test fixes * Fix notification circle * Fix macOS app not restarting on Restart/Update * Update dialog box titles * Turn off file system check for Linux * Changes to support deployments * Testing autoupdater deployments to s3 * disable tests for now * asfrehwf * fine no windows WHATEVER * remove windows again * Try universal all in one * pffftttngggguhhhh * make sure it's working * Missed artifacts script * Modify destination as well * one more time! * Update yml files * Oops * add yq manually * oof * Fix the script to work properly * Fix release script * Fix script again so it runs in time * Build version 2 * Revert build specific changes * Lint override * Fix build apps for PR builds * One more change * Add file generation for .deb repo * Deb repo test * skip tests for now * Fix artifact push * Persist after repo creation * Put tests back * Fix unit tests * Enable mac generated builds temp * Temporarily disable tests * Fix issue where notification doesn't pop dialog box * Try version 2 again * Put the version back * Attempting to debug mac app path issue * Fix issue where Mac app will quarantine itself after first update * Lock versions of yq * Fix yq for mac * As usual, Mac is difficult :P * Add quotes to anti-quarantine command * Change to spawn to avoid command injection * Oops * Nightly deployment changes (#2005) * Test nightly deploy * I fixed a some things * aaaaaaaaa * Restore old bucket * Added progress indicator via tooltip * Ship nightly builds to main S3 bucket * PR feedback * Fix a couple security exploits * Fix opacity on light mode button * Use large app icon * Resize icon for Windows * Resize icon for Mac * Update to electron-updater final * Remove Mac support and deb repo * Typo * Remove deb script * Remove checksum function * Removed autoUpdateSettingsPath * Update URL Co-authored-by: = <=> Co-authored-by: Devin Binnie <devin.binnie@mattermost.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
2022-03-08 08:38:38 -08:00
autoCheckForUpdates?: boolean;
alwaysMinimize?: boolean;
alwaysClose?: boolean;
logLevel?: string;
appLanguage?: string;
}
export type ConfigV2 = {
version: 2;
teams: Array<{
name: string;
url: string;
order: number;
}>;
showTrayIcon: boolean;
trayIconTheme: string;
minimizeToTray: boolean;
notifications: {
flashWindow: number;
bounceIcon: boolean;
bounceIconType: 'critical' | 'informational';
};
showUnreadBadge: boolean;
useSpellChecker: boolean;
enableHardwareAcceleration: boolean;
autostart: boolean;
spellCheckerLocale: string;
spellCheckerURL?: string;
darkMode: boolean;
downloadLocation?: string;
}
export type ConfigV1 = {
version: 1;
teams: Array<{
name: string;
url: string;
}>;
showTrayIcon: boolean;
trayIconTheme: string;
minimizeToTray: boolean;
notifications: {
flashWindow: number;
bounceIcon: boolean;
bounceIconType: 'critical' | 'informational';
};
showUnreadBadge: boolean;
useSpellChecker: boolean;
spellCheckerURL?: string;
enableHardwareAcceleration: boolean;
autostart: boolean;
spellCheckerLocale: string;
}
export type ConfigV0 = {version: 0; url: string};
export type AnyConfig = ConfigV3 | ConfigV2 | ConfigV1 | ConfigV0;
export type BuildConfig = {
defaultTeams?: Team[];
helpLink: string;
enableServerManagement: boolean;
enableAutoUpdater: boolean;
managedResources: string[];
allowedProtocols: string[];
}
export type RegistryConfig = {
teams: Team[];
enableServerManagement: boolean;
enableAutoUpdater: boolean;
}
export type CombinedConfig = ConfigV3 & BuildConfig & {
registryTeams: Team[];
appName: string;
useNativeWindow: boolean;
}
export type LocalConfiguration = Config & {
appName: string;
enableServerManagement: boolean;
[MM-18552] Autoupdater (#1714) * wip * background download * various fixes * wip * wokring autoupgrade * fix menu * fix windows * cleanup * add publishername * fix messages and titles * Test updates * Moved module and added functionality to click icon to install (instead of just download) * Add auto update setting, update on close app if downloaded * Tests, changes for security fixes, update version number * Update E2E tests * Lint fix * Update to latest electron-updater * Revert to stable electron-builder (only needed to update electron-updater) * Fix package-lock * skip flaky test * Update package * Fix E2E test * Fixes for enabling/disabled autoupdater * Fixed GPO definitions * [MM-38300] Set localhost as the test server * blank * Switch to s3 bucket for testing * Update icons to match spec * Add menu items for download/update actions * Type and test fixes * Fix notification circle * Fix macOS app not restarting on Restart/Update * Update dialog box titles * Turn off file system check for Linux * Changes to support deployments * Testing autoupdater deployments to s3 * disable tests for now * asfrehwf * fine no windows WHATEVER * remove windows again * Try universal all in one * pffftttngggguhhhh * make sure it's working * Missed artifacts script * Modify destination as well * one more time! * Update yml files * Oops * add yq manually * oof * Fix the script to work properly * Fix release script * Fix script again so it runs in time * Build version 2 * Revert build specific changes * Lint override * Fix build apps for PR builds * One more change * Add file generation for .deb repo * Deb repo test * skip tests for now * Fix artifact push * Persist after repo creation * Put tests back * Fix unit tests * Enable mac generated builds temp * Temporarily disable tests * Fix issue where notification doesn't pop dialog box * Try version 2 again * Put the version back * Attempting to debug mac app path issue * Fix issue where Mac app will quarantine itself after first update * Lock versions of yq * Fix yq for mac * As usual, Mac is difficult :P * Add quotes to anti-quarantine command * Change to spawn to avoid command injection * Oops * Nightly deployment changes (#2005) * Test nightly deploy * I fixed a some things * aaaaaaaaa * Restore old bucket * Added progress indicator via tooltip * Ship nightly builds to main S3 bucket * PR feedback * Fix a couple security exploits * Fix opacity on light mode button * Use large app icon * Resize icon for Windows * Resize icon for Mac * Update to electron-updater final * Remove Mac support and deb repo * Typo * Remove deb script * Remove checksum function * Removed autoUpdateSettingsPath * Update URL Co-authored-by: = <=> Co-authored-by: Devin Binnie <devin.binnie@mattermost.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
2022-03-08 08:38:38 -08:00
canUpgrade: boolean;
}
export type MigrationInfo = {
updateTrayIconWin32: boolean;
masConfigs: boolean;
}