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

[#1749] Disable presentation mode #1867

Merged
merged 6 commits into from
Sep 13, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [1861](https://github.com/microsoft/BotFramework-Emulator/pull/1861)
- [1862](https://github.com/microsoft/BotFramework-Emulator/pull/1862)
- [1864](https://github.com/microsoft/BotFramework-Emulator/pull/1864)
- [1867](https://github.com/microsoft/BotFramework-Emulator/pull/1867)

- [client] Fixed an issue with the transcripts path input inside of the resource settings dialog in PR [1836](https://github.com/microsoft/BotFramework-Emulator/pull/1836)

Expand Down
23 changes: 14 additions & 9 deletions packages/app/client/src/ui/shell/mdi/tabBar/tabBar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ describe('TabBar', () => {
instance = node.instance();
});

it('should enable presentation mode', async () => {
await instance.onPresentationModeClick();
expect(mockDispatch).toHaveBeenCalledWith(
executeCommand(true, SharedConstants.Commands.Telemetry.TrackEvent, null, 'tabBar_presentationMode')
);
expect(mockDispatch).toHaveBeenCalledWith(enable());
});
// Presentation Mode button has been disabled. For more information, please see https://github.com/microsoft/BotFramework-Emulator/issues/1866
// it('should enable presentation mode', async () => {
// await instance.onPresentationModeClick();
// expect(mockDispatch).toHaveBeenCalledWith(
// executeCommand(true, SharedConstants.Commands.Telemetry.TrackEvent, null, 'tabBar_presentationMode')
// );
// expect(mockDispatch).toHaveBeenCalledWith(enable());
// });

it('should load widgets', () => {
// no widgets
Expand All @@ -190,7 +191,9 @@ describe('TabBar', () => {
);
dumbNode = dumbWrapper.find(TabBar);
dumbInstance = dumbNode.instance() as any;
expect(dumbInstance.widgets).toHaveLength(2);
// Presentation Mode button has been disabled, which affects this test. For more information, please see https://github.com/microsoft/BotFramework-Emulator/issues/1866
// The below line will need to be adjusted back to 2.
corinagum marked this conversation as resolved.
Show resolved Hide resolved
expect(dumbInstance.widgets).toHaveLength(1);

dumbWrapper = mount(
<TabBar
Expand All @@ -201,7 +204,9 @@ describe('TabBar', () => {
);
dumbNode = dumbWrapper.find(TabBar);
dumbInstance = dumbNode.instance() as any;
expect(dumbInstance.widgets).toHaveLength(2);
// Presentation Mode button has been disabled, which affects this test. For more information, please see https://github.com/microsoft/BotFramework-Emulator/issues/1866
// The below line will need to be adjusted back to 2.
corinagum marked this conversation as resolved.
Show resolved Hide resolved
expect(dumbInstance.widgets).toHaveLength(1);
});

it('should load tabs', () => {
Expand Down
29 changes: 14 additions & 15 deletions packages/app/client/src/ui/shell/mdi/tabBar/tabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import { BotConfigWithPath } from '@bfemulator/sdk-shared';
import * as React from 'react';
import { DragEvent, MouseEvent } from 'react';

import * as Constants from '../../../../constants';
import {
CONTENT_TYPE_APP_SETTINGS,
CONTENT_TYPE_DEBUG,
Expand Down Expand Up @@ -130,8 +129,8 @@ export class TabBar extends React.Component<TabBarProps, TabBarState> {
</div>
);
}

private onPresentationModeClick = () => this.props.enablePresentationMode();
// Presentation Mode button has been disabled. For more information, please see https://github.com/microsoft/BotFramework-Emulator/issues/1866
// private onPresentationModeClick = () => this.props.enablePresentationMode();

private onKeyDown = (event: KeyboardEvent): void => {
// Meta corresponds to 'Command' on Mac
Expand All @@ -145,22 +144,22 @@ export class TabBar extends React.Component<TabBarProps, TabBarState> {
};

private get widgets(): JSX.Element[] {
const activeDoc = this.props.documents[this.props.activeDocumentId];
const presentationEnabled =
activeDoc &&
(activeDoc.contentType === Constants.CONTENT_TYPE_TRANSCRIPT ||
activeDoc.contentType === Constants.CONTENT_TYPE_LIVE_CHAT);
// const activeDoc = this.props.documents[this.props.activeDocumentId];
// const presentationEnabled =
// activeDoc &&
// (activeDoc.contentType === Constants.CONTENT_TYPE_TRANSCRIPT ||
// activeDoc.contentType === Constants.CONTENT_TYPE_LIVE_CHAT);
const splitEnabled = Object.keys(this.props.documents).length > 1;

const widgets: JSX.Element[] = [];

if (presentationEnabled) {
widgets.push(
<button key={'presentation-widget'} title="Presentation Mode" onClick={this.onPresentationModeClick}>
<div className={`${styles.widget} ${styles.presentationWidget}`} />
</button>
);
}
// if (presentationEnabled) {
// widgets.push(
// <button key={'presentation-widget'} title="Presentation Mode" onClick={this.onPresentationModeClick}>
// <div className={`${styles.widget} ${styles.presentationWidget}`} />
// </button>
// );
// }
if (splitEnabled) {
widgets.push(
<button key={'split-widget'} title="Split Editor" onClick={this.onSplitClick}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const mapDispatchToProps = (dispatch): TabBarProps => ({
},
appendTab: (srcEditorKey: string, destEditorKey: string, tabId: string) =>
dispatch(appendTab(srcEditorKey, destEditorKey, tabId)),
// Presentation Mode button has been disabled. For more information, please see https://github.com/microsoft/BotFramework-Emulator/issues/1866
enablePresentationMode: async () => {
dispatch(executeCommand(true, SharedConstants.Commands.Telemetry.TrackEvent, null, 'tabBar_presentationMode'));
dispatch(enablePresentationMode());
Expand Down