From 1bea213a7b40fc8bf6c1b4ff4a8f1fb127219cd8 Mon Sep 17 00:00:00 2001 From: Chris Whitten Date: Thu, 5 Mar 2020 15:52:23 -0800 Subject: [PATCH 1/2] add name for nodeMenu, arrow and endNode (#2131) Co-authored-by: Chris Whitten --- .../visual-designer/src/components/lib/EdgeUtil.tsx | 9 ++++++++- .../visual-designer/src/components/menus/NodeMenu.tsx | 3 ++- .../visual-designer/src/editors/StepEditor.tsx | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Composer/packages/extensions/visual-designer/src/components/lib/EdgeUtil.tsx b/Composer/packages/extensions/visual-designer/src/components/lib/EdgeUtil.tsx index 192990b7a5..d4b24335ab 100644 --- a/Composer/packages/extensions/visual-designer/src/components/lib/EdgeUtil.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/lib/EdgeUtil.tsx @@ -126,7 +126,14 @@ export const drawSVGEdge = ( const [p1, p2] = calculateArrowPoints(endPoint, direction); const points = [p1, endPoint, p2].map(p => `${p.x},${p.y}`).join(' '); const arrow = ( - + ); elements.push(arrow); } diff --git a/Composer/packages/extensions/visual-designer/src/components/menus/NodeMenu.tsx b/Composer/packages/extensions/visual-designer/src/components/menus/NodeMenu.tsx index c05d8bd5ac..a562e37ab3 100644 --- a/Composer/packages/extensions/visual-designer/src/components/menus/NodeMenu.tsx +++ b/Composer/packages/extensions/visual-designer/src/components/menus/NodeMenu.tsx @@ -19,7 +19,7 @@ const declareElementAttributes = (id: string) => { [AttrNames.SelectedId]: `${id}${MenuTypes.NodeMenu}`, }; }; -export const NodeMenu = ({ id, onEvent }): JSX.Element => { +export const NodeMenu = ({ id, onEvent }) => { const menuItems = [ { key: 'delete', @@ -35,6 +35,7 @@ export const NodeMenu = ({ id, onEvent }): JSX.Element => { return (
Date: Thu, 5 Mar 2020 16:37:40 -0800 Subject: [PATCH 2/2] fix: remove edit button in lu all up view (#2146) * fix some known issues * fix e2e test * handle comments Co-authored-by: Chris Whitten --- Composer/cypress/integration/LUPage.spec.ts | 7 ++----- .../pages/language-understanding/index.tsx | 21 ++++++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Composer/cypress/integration/LUPage.spec.ts b/Composer/cypress/integration/LUPage.spec.ts index f989d4dce7..950e35157a 100644 --- a/Composer/cypress/integration/LUPage.spec.ts +++ b/Composer/cypress/integration/LUPage.spec.ts @@ -14,10 +14,7 @@ context('LU Page', () => { cy.contains('ToDoBotWithLuisSample.Main'); cy.contains('All'); - cy.get('.toggleEditMode button').as('switchButton'); - - // all multiple file, edit mode button is disabled. - cy.get('@switchButton').should('be.disabled'); + cy.get('.toggleEditMode button').should('not.exist'); // by default is table view cy.findByTestId('LUEditor') @@ -28,7 +25,7 @@ context('LU Page', () => { cy.findByTestId('LUEditor').within(() => { cy.findByText('__TestToDoBotWithLuisSample.Main').click(); }); - + cy.get('.toggleEditMode button').as('switchButton'); // goto edit-mode cy.get('@switchButton').click(); cy.findByTestId('LUEditor') diff --git a/Composer/packages/client/src/pages/language-understanding/index.tsx b/Composer/packages/client/src/pages/language-understanding/index.tsx index 960a8730a7..95ee7bd2da 100644 --- a/Composer/packages/client/src/pages/language-understanding/index.tsx +++ b/Composer/packages/client/src/pages/language-understanding/index.tsx @@ -91,16 +91,17 @@ const LUPage: React.FC = props => {
{formatMessage('User Input')}
- + {(!isRoot || edit) && ( + + )}