[MM-48682] Stop user from opening the servers menu when no servers are configured (#2434)
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
||||
handleRemoveServerModal,
|
||||
handleWelcomeScreenModal,
|
||||
handleMainWindowIsShown,
|
||||
handleShowOnboardingScreens,
|
||||
} from './intercom';
|
||||
|
||||
jest.mock('common/config', () => ({
|
||||
@@ -271,21 +270,16 @@ describe('main/app/intercom', () => {
|
||||
Config.set.mockImplementation((name, value) => {
|
||||
Config[name] = value;
|
||||
});
|
||||
Config.teams = JSON.parse(JSON.stringify([{
|
||||
name: 'test-team',
|
||||
order: 0,
|
||||
url: 'https://someurl.here',
|
||||
}]));
|
||||
Config.registryConfigData = {
|
||||
teams: JSON.parse(JSON.stringify([{
|
||||
name: 'test-team',
|
||||
order: 0,
|
||||
url: 'https://someurl.here',
|
||||
}])),
|
||||
};
|
||||
|
||||
handleMainWindowIsShown();
|
||||
expect(ModalManager.addModal).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('handleShowOnboardingScreens', () => {
|
||||
it('MM-48079 should not show onboarding screen or server screen if GPO server is pre-configured', () => {
|
||||
handleShowOnboardingScreens(false, false, true);
|
||||
expect(ModalManager.addModal).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -254,13 +254,15 @@ export function createTemplate(config: Config, updateManager: UpdateManager) {
|
||||
role: 'close',
|
||||
label: isMac ? localizeMessage('main.menus.app.window.closeWindow', 'Close Window') : localizeMessage('main.menus.app.window.close', 'Close'),
|
||||
accelerator: 'CmdOrCtrl+W',
|
||||
}, separatorItem, {
|
||||
}, separatorItem,
|
||||
...(config.data?.teams.length ? [{
|
||||
label: localizeMessage('main.menus.app.window.showServers', 'Show Servers'),
|
||||
accelerator: `${process.platform === 'darwin' ? 'Cmd+Ctrl' : 'Ctrl+Shift'}+S`,
|
||||
click() {
|
||||
ipcMain.emit(OPEN_TEAMS_DROPDOWN);
|
||||
},
|
||||
}, ...teams.sort((teamA, teamB) => teamA.order - teamB.order).slice(0, 9).map((team, i) => {
|
||||
}] : []),
|
||||
...teams.sort((teamA, teamB) => teamA.order - teamB.order).slice(0, 9).map((team, i) => {
|
||||
const items = [];
|
||||
items.push({
|
||||
label: team.name,
|
||||
|
Reference in New Issue
Block a user