[MM-36431] Logic to support multiple configurable tabs per server (#1655)

* Updated config, added types and classes for messaging tab

* Working app with tabs and servers

* Remainder of logic

* Make base tab abstract class

* Account for new app case

* Merge'd

* PR feedback
This commit is contained in:
Devin Binnie
2021-07-20 09:05:53 -04:00
committed by GitHub
parent 29a049e8ae
commit d3599fc500
30 changed files with 636 additions and 361 deletions

View File

@@ -1,19 +1,48 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export type Team = {
export type Tab = {
name: string;
url: string;
order: number;
}
export type TeamWithIndex = Team & {index: number};
export type Team = Tab & {
url: string;
lastActiveTab?: number;
}
export type Config = ConfigV2;
export type TeamWithIndex = Team & {index: number};
export type TeamWithTabs = Team & {tabs: Tab[]};
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;
spellCheckerLocale: string;
darkMode: boolean;
downloadLocation: string;
}
export type ConfigV2 = {
version: 2;
teams: Team[];
teams: Array<{
name: string;
url: string;
order: number;
}>;
showTrayIcon: boolean;
trayIconTheme: string;
minimizeToTray: boolean;
@@ -54,7 +83,7 @@ export type ConfigV1 = {
export type ConfigV0 = {version: 0; url: string};
export type AnyConfig = ConfigV2 | ConfigV1 | ConfigV0;
export type AnyConfig = ConfigV3 | ConfigV2 | ConfigV1 | ConfigV0;
export type BuildConfig = {
defaultTeams?: Team[];
@@ -70,7 +99,7 @@ export type RegistryConfig = {
enableAutoUpdater: boolean;
}
export type CombinedConfig = ConfigV2 & BuildConfig & {
export type CombinedConfig = ConfigV3 & BuildConfig & {
registryTeams: Team[];
appName: string;
}

View File

@@ -4,7 +4,6 @@
export type ServerFromURL = {
name: string;
url: URL;
index: number;
}
export type Boundaries = {