Skip to content

Commit

Permalink
fix: remove edit button in lu all up view (#2146)
Browse files Browse the repository at this point in the history
* fix some known issues

* fix e2e test

* handle comments

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
  • Loading branch information
cwhitten authored Mar 6, 2020
1 parent 1bea213 commit c17b59e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
7 changes: 2 additions & 5 deletions Composer/cypress/integration/LUPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down
21 changes: 11 additions & 10 deletions Composer/packages/client/src/pages/language-understanding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,17 @@ const LUPage: React.FC<LUPageProps> = props => {
<div css={ContentHeaderStyle}>
<div css={HeaderText}>{formatMessage('User Input')}</div>
<div css={flexContent}>
<Toggle
className={'toggleEditMode'}
css={actionButton}
onText={formatMessage('Edit mode')}
offText={formatMessage('Edit mode')}
defaultChecked={false}
checked={!!edit}
disabled={isRoot && edit === false}
onChange={onToggleEditMode}
/>
{(!isRoot || edit) && (
<Toggle
className={'toggleEditMode'}
css={actionButton}
onText={formatMessage('Edit mode')}
offText={formatMessage('Edit mode')}
defaultChecked={false}
checked={!!edit}
onChange={onToggleEditMode}
/>
)}
</div>
</div>
<div css={ContentStyle} data-testid="LUEditor">
Expand Down

0 comments on commit c17b59e

Please sign in to comment.