Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue where the themes menu was empty on Windows & Linux #2069

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Fixed
- [client] Hid services pane by default in PR [2059](https://github.com/microsoft/BotFramework-Emulator/pull/2059)
- [client] Fixed an issue where trying to add a QnA KB manually after signing into Azure was causing the app to crash in PR [2066](https://github.com/microsoft/BotFramework-Emulator/pull/2066)
- [client] Removed buble background on attachments [2067](https://github.com/microsoft/BotFramework-Emulator/pull/2067)
- [client] Fixed an issue where the themes menu was empty on Windows & Linux in PR [2069](https://github.com/microsoft/BotFramework-Emulator/pull/2069)

## Removed
- [client/main] Removed legacy payments code in PR [2058](https://github.com/microsoft/BotFramework-Emulator/pull/2058)

## Fixed
- [client] Removed buble background on attachments [2067](https://github.com/microsoft/BotFramework-Emulator/pull/2067)

## v4.7.0 - 2019 - 12 - 13
## Fixed
- [client] Added an empty state for the recent bots submenu in the app menu for Windows in PR [1945](https://github.com/microsoft/BotFramework-Emulator/pull/1945)
Expand Down
14 changes: 14 additions & 0 deletions packages/app/client/src/ui/shell/appMenu/appMenu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,25 @@ describe('<AppMenu />', () => {
...instance.props,
activeBot: undefined,
activeDocumentType: SharedConstants.ContentTypes.CONTENT_TYPE_WELCOME_PAGE,
availableThemes: [
{ name: 'Light', href: '' },
{ name: 'Dark', href: '' },
{ name: 'High contrast', href: '' },
],
currentTheme: 'Light',
recentBots: [
{ displayName: 'bot1', path: 'path1' },
{ displayName: 'bot2', path: 'path2' },
{ displayName: 'bot3', path: 'path3' },
{ displayName: 'bot4', path: 'path4' },
],
};
const menuTemplate = (instance as any).updateMenu(AppMenuTemplate.template);

expect(Object.keys(menuTemplate)).toHaveLength(6);
expect(menuTemplate['file'][3].items.length).toBe(4); // recent bots menu should be populated
expect(menuTemplate['file'][7].disabled).toBe(true); // "Close tab" should be disabled
expect(menuTemplate['file'][14].items.length).toBe(3); // themes menu should be populated
expect(menuTemplate['conversation'][0].disabled).toBe(true); // send activity menu should be disabled on welcome page
});

Expand Down
2 changes: 1 addition & 1 deletion packages/app/client/src/ui/shell/appMenu/appMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class AppMenu extends React.Component<AppMenuProps, {}> {

private updateMenu(template: { [key: string]: MenuItem[] }): { [key: string]: MenuItem[] } {
const fileMenu = template['file'];
fileMenu[12].items = this.getThemeMenuItems();
fileMenu[14].items = this.getThemeMenuItems();
fileMenu[3].items = this.getRecentBotsMenuItems();
// disable / enable "Close tab" button
fileMenu[7].disabled = !this.props.activeBot;
Expand Down