From 2fe3a77fe9bd2b5a1766af914dc13e91cefc48bb Mon Sep 17 00:00:00 2001 From: Corina Date: Mon, 19 Nov 2018 13:32:44 -0800 Subject: [PATCH 1/2] 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/2] 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/'); });