From 2fe3a77fe9bd2b5a1766af914dc13e91cefc48bb Mon Sep 17 00:00:00 2001 From: Corina Date: Mon, 19 Nov 2018 13:32:44 -0800 Subject: [PATCH 1/4] Fix accessibility of links on Welcome Page by converting to buttons --- .../src/ui/editor/welcomePage/welcomePage.tsx | 93 ++++++++++--------- .../welcomePage/welcomePageContainer.ts | 2 +- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx b/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx index c029179c5..ccebe4835 100644 --- a/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx +++ b/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx @@ -41,7 +41,7 @@ import { GenericDocument } from '../../layout'; export interface WelcomePageProps { accessToken?: string; documentId?: string; - onAnchorClick: (url: string) => void; + onLinkClick: (url: string) => void; onNewBotClick?: () => void; onOpenBotClick?: () => void; onBotClick?: (_e: any, path: string) => void; @@ -90,10 +90,10 @@ export class WelcomePage extends React.Component { this.props.showContextMenuForBot(bot); } - private onAnchorClick = (event: MouseEvent): void => { + private onLinkClick = (event: MouseEvent): void => { const { currentTarget: link } = event; const { href } = link.dataset; - this.props.onAnchorClick(href); + this.props.onLinkClick(href); } private onDeleteBotClick = (event: React.MouseEvent) => { @@ -110,12 +110,13 @@ export class WelcomePage extends React.Component { Start by testing your bot Start talking to your bot by connecting to an endpoint or by opening a bot saved locally.
- More about working locally with a bot. - +
@@ -192,14 +193,13 @@ export class WelcomePage extends React.Component {
Plan:
Review the bot  - design guidelines -   - for best practices  +  for best practices 
@@ -210,51 +210,55 @@ export class WelcomePage extends React.Component {
Build:
- Download Command Line tools -
+
Create a bot  - from Azure - or  - or  +
Add services such as
- Language Understanding (LUIS) - ,  - ,  +   and  - Dispatch - +
@@ -266,21 +270,22 @@ export class WelcomePage extends React.Component {
Test:
Test with the  - Emulator -
+
Test online in  - Web Chat -
+
@@ -291,13 +296,14 @@ export class WelcomePage extends React.Component {
Publish:
Publish directly to Azure or
- Use Continuous Deployment - +  
@@ -310,13 +316,13 @@ export class WelcomePage extends React.Component {
Connect:
Connect to  - channels - +  
@@ -328,13 +334,14 @@ export class WelcomePage extends React.Component {
Evaluate:
- View analytics - +
diff --git a/packages/app/client/src/ui/editor/welcomePage/welcomePageContainer.ts b/packages/app/client/src/ui/editor/welcomePage/welcomePageContainer.ts index cffa7ee3f..3815673c2 100644 --- a/packages/app/client/src/ui/editor/welcomePage/welcomePageContainer.ts +++ b/packages/app/client/src/ui/editor/welcomePage/welcomePageContainer.ts @@ -51,7 +51,7 @@ function mapStateToProps(state: RootState, ownProps: WelcomePageProps): WelcomeP function mapDispatchToProps(dispatch: (action: Action) => void): WelcomePageProps { const { Commands } = SharedConstants; return { - onAnchorClick: (url) => { + onLinkClick: (url) => { CommandServiceImpl.remoteCall(Commands.Electron.OpenExternal, url).catch(); }, onNewBotClick: () => { From 659f329e937a4c29c35c82cc069fcc53ac57e57a Mon Sep 17 00:00:00 2001 From: Corina Date: Mon, 19 Nov 2018 13:52:56 -0800 Subject: [PATCH 2/4] Test fix for welcome page --- .../app/client/src/ui/editor/welcomePage/welcomePage.spec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/client/src/ui/editor/welcomePage/welcomePage.spec.tsx b/packages/app/client/src/ui/editor/welcomePage/welcomePage.spec.tsx index a366246a5..d822cee93 100644 --- a/packages/app/client/src/ui/editor/welcomePage/welcomePage.spec.tsx +++ b/packages/app/client/src/ui/editor/welcomePage/welcomePage.spec.tsx @@ -64,7 +64,7 @@ describe('The AzureLoginFailedDialogContainer component should', () => { }, }; const spy = jest.spyOn(CommandServiceImpl, 'remoteCall'); - instance.onAnchorClick(mockEvent); + instance.onLinkClick(mockEvent); expect(spy).toHaveBeenCalledWith(SharedConstants.Commands.Electron.OpenExternal, 'https://aka.ms/'); }); From 5c21ef0ecee14330d7426a3cf1419971f8016825 Mon Sep 17 00:00:00 2001 From: Corina Date: Mon, 19 Nov 2018 14:33:23 -0800 Subject: [PATCH 3/4] fix failing tests --- packages/app/main/src/commands/botCommands.spec.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/app/main/src/commands/botCommands.spec.ts b/packages/app/main/src/commands/botCommands.spec.ts index d637fda60..f8299e80b 100644 --- a/packages/app/main/src/commands/botCommands.spec.ts +++ b/packages/app/main/src/commands/botCommands.spec.ts @@ -56,7 +56,7 @@ jest.mock('../emulator', () => ({ })); const mockCommandRegistry = new CommandRegistryImpl(); const mockBot = BotConfigWithPathImpl.fromJSON({ - 'path': 'some/path.bot', + 'path': path.normalize('some/path.bot'), 'name': 'AuthBot', 'description': '', 'padlock': '', @@ -98,11 +98,11 @@ describe('The botCommands', () => { const saveBotSpy = jest.spyOn((helpers as any).default, 'saveBot'); const mockBotInfo = { - path: botToSave.path, + path: path.normalize(botToSave.path), displayName: 'AuthBot', secret: 'secret', - chatsPath: 'some/dialogs', - transcriptsPath: 'some/transcripts' + chatsPath: path.normalize('some/dialogs'), + transcriptsPath: path.normalize('some/transcripts') }; const command = mockCommandRegistry.getCommand(Bot.Create); const result = await command.handler(botToSave, 'secret'); @@ -234,7 +234,7 @@ describe('The botCommands', () => { it('should patch the bots list and watch for chat and transcript changes', async () => { const mockBotInfo = { - path: 'this/is/my.json', + path: path.normalize('this/is/my.json'), displayName: 'AuthBot', secret: 'secret' }; @@ -243,8 +243,8 @@ describe('The botCommands', () => { const { handler } = mockCommandRegistry.getCommand(SharedConstants.Commands.Bot.PatchBotList); await handler(mockBotInfo.path, mockBotInfo); - expect(transcriptWatchSpy).toHaveBeenCalledWith('this/is/transcripts'); - expect(chatWatcherSpy).toHaveBeenCalledWith('this/is/dialogs'); + expect(transcriptWatchSpy).toHaveBeenCalledWith(path.normalize('this/is/transcripts')); + expect(chatWatcherSpy).toHaveBeenCalledWith(path.normalize('this/is/dialogs')); }); it('should remove a bot from the list', async () => { From 29a6ca44c054aae45bf7d64a688cbeed4d438e06 Mon Sep 17 00:00:00 2001 From: Corina Date: Mon, 19 Nov 2018 14:55:11 -0800 Subject: [PATCH 4/4] code cleanup --- .../app/client/src/ui/editor/welcomePage/welcomePage.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx b/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx index ccebe4835..3fb548381 100644 --- a/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx +++ b/packages/app/client/src/ui/editor/welcomePage/welcomePage.tsx @@ -114,7 +114,6 @@ export class WelcomePage extends React.Component { className={ styles.ctaLink } data-href="https://aka.ms/bot-framework-emulator-create-bot-locally" onClick={ this.onLinkClick } - tabIndex={ 0 } >More about working locally with a bot. @@ -229,7 +228,6 @@ export class WelcomePage extends React.Component { className={ styles.ctaLink } data-href="https://aka.ms/bot-framework-emulator-create-bot-locally" onClick={ this.onLinkClick } - tabIndex={ 0 } > locally
@@ -238,7 +236,6 @@ export class WelcomePage extends React.Component { className={ styles.ctaLink } data-href="https://aka.ms/bot-framework-emulator-LUIS-docs-home" onClick={ this.onLinkClick } - tabIndex={ 0 } > Language Understanding (LUIS) ,  @@ -246,7 +243,6 @@ export class WelcomePage extends React.Component { className={ styles.ctaLink } data-href="https://aka.ms/bot-framework-emulator-qna-docs-home" onClick={ this.onLinkClick } - tabIndex={ 0 } > QnAMaker   @@ -255,7 +251,6 @@ export class WelcomePage extends React.Component { className={ styles.ctaLink } data-href="https://aka.ms/bot-framework-emulator-create-dispatch" onClick={ this.onLinkClick } - tabIndex={ 0 } > Dispatch @@ -282,7 +277,6 @@ export class WelcomePage extends React.Component { className={ styles.ctaLink } data-href="https://aka.ms/bot-framework-emulator-debug-with-web-chat" onClick={ this.onLinkClick } - tabIndex={ 0 } > Web Chat @@ -338,7 +332,6 @@ export class WelcomePage extends React.Component { className={ styles.ctaLink } data-href="https://aka.ms/bot-framework-emulator-bot-analytics" onClick={ this.onLinkClick } - tabIndex={ 0 } > View analytics