Skip to content

Commit

Permalink
Merge branch 'main' into sorgh/fix_prttr
Browse files Browse the repository at this point in the history
  • Loading branch information
hatpick committed May 5, 2021
2 parents 4d2100e + 1d7d1c9 commit 85adac7
Show file tree
Hide file tree
Showing 79 changed files with 552 additions and 577 deletions.
2 changes: 1 addition & 1 deletion Composer/cypress/integration/DesignPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ context('breadcrumb', () => {
});

it('can create different kinds of triggers ', () => {
cy.visitPage('Design');
cy.visitPage('Create');
cy.findByTestId('DialogHeader-TestBot_TestSample').click();
cy.findByTestId('recognizerTypeDropdown').click();
cy.findByText('Regular expression recognizer').click();
Expand Down
2 changes: 1 addition & 1 deletion Composer/cypress/integration/HomePage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ context('Home Page ', () => {
cy.createTestBot('EmptySample', ({ id }) => {
cy.visit(`/bot/${id}`);
cy.findByTestId('LeftNavButton').click();
cy.findByTestId('LeftNav-CommandBarButtonDesign').should('exist');
cy.findByTestId('LeftNav-CommandBarButtonCreate').should('exist');
cy.findByTestId('LeftNav-CommandBarButtonBot responses').click();
cy.url().should('include', 'language-generation');
cy.findByTestId('LeftNav-CommandBarButtonUser input').click();
Expand Down
4 changes: 2 additions & 2 deletions Composer/cypress/integration/LuisDeploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ context('Luis Deploy', () => {
});

it('can deploy luis success', () => {
cy.visitPage('Project settings');
cy.visitPage('Configure');
cy.findByText('Development resources').click();
cy.findAllByTestId('rootLUISAuthoringKey').type('12345678', { delay: 200 });
cy.findAllByTestId('rootLUISRegion').click();
cy.findByText('West US').click();
cy.visitPage('User input');
cy.visitPage('Design');
cy.visitPage('Create');
cy.route({
method: 'POST',
url: 'api/projects/*/build',
Expand Down
6 changes: 3 additions & 3 deletions Composer/cypress/integration/NotificationPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ context('Notification Page', () => {
});

it('can show lg syntax error ', () => {
cy.visitPage('Design');
cy.visitPage('Create');
cy.visitPage('Bot responses');

cy.findByTestId('ProjectTree').within(() => {
Expand All @@ -27,7 +27,7 @@ context('Notification Page', () => {
});

it('can show lu syntax error ', () => {
cy.visitPage('Design');
cy.visitPage('Create');
cy.visitPage('User input');

cy.findByTestId('ProjectTree').within(() => {
Expand All @@ -45,7 +45,7 @@ context('Notification Page', () => {
});

// it('can show dialog expression error ', () => {
// cy.visitPage('Design');
// cy.visitPage('Create');

// cy.findByTestId('ProjectTree').within(() => {
// cy.findByText('WelcomeUser').click();
Expand Down
4 changes: 2 additions & 2 deletions Composer/cypress/integration/Onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ context('Onboarding', () => {
cy.createTestBot('TestSample', ({ id }) => {
cy.visit(`/bot/${id}`);
//enable onboarding setting
cy.visitPage('Composer settings');
cy.visitPage('Composer settings', false);
cy.findByTestId('ProjectTree').within(() => {
cy.findByText('Application Settings').click();
});
cy.findByTestId('onboardingToggle').click();
cy.visitPage('Design');
cy.visitPage('Create');
});
});

Expand Down
2 changes: 1 addition & 1 deletion Composer/cypress/support/commands.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare namespace Cypress {
* Visits a page from the left nav bar using the page's testid
* @example visitPage('Bot Responses');
*/
visitPage(page: string): void;
visitPage(page: string, checked?: boolean): void;

/**
* Invokes callback inside editor context
Expand Down
4 changes: 2 additions & 2 deletions Composer/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ Cypress.Commands.add('withinEditor', (editorName, cb) => {
cy.findByTestId(editorName).within(cb);
});

Cypress.Commands.add('visitPage', (page) => {
Cypress.Commands.add('visitPage', (page: string, checked = true) => {
cy.findByTestId(`LeftNav-CommandBarButton${page}`).click();
cy.findByTestId('ActiveLeftNavItem').should('contain', page);
if (checked) cy.findByTestId('ActiveLeftNavItem').should('contain', page);

// click the logo to clear any stray tooltips from page navigation
cy.findByAltText('Composer Logo').click({ force: true });
Expand Down
2 changes: 1 addition & 1 deletion Composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"ts-loader": "7.0.4",
"tslib": "^2.0.0",
"typescript": "3.9.2",
"wait-on": "^5.2.0",
"wait-on": "^5.3.0",
"wsrun": "^5.2.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('<CreationFlowV2/>', () => {
);

navigate('create/dotnet/%40microsoft%2Fgenerator-bot-empty');
const node = await findByText('OK');
const node = await findByText('Create');

act(() => {
fireEvent.click(node);
Expand Down
9 changes: 5 additions & 4 deletions Composer/packages/client/__tests__/components/header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

import * as React from 'react';
import { within } from '@testing-library/dom';

import { renderWithRecoil } from '../testUtils';
import { Header } from '../../src/components/Header';
Expand All @@ -15,30 +16,30 @@ describe('<Header />', () => {
return { location: { pathname: 'http://server/home' } };
});
const { container } = renderWithRecoil(<Header />);
expect(container).toHaveTextContent('Bot Framework Composer');
expect(within(container).findByAltText('Composer Logo')).not.toBeNull();
});

it('should not show the start bots widget in Home page', async () => {
(useLocation as jest.Mock).mockImplementation(() => {
return { location: { pathname: 'http://server/home' } };
});
const { queryByText } = renderWithRecoil(<Header />);
expect(queryByText('Start all bots')).toBeNull();
expect(queryByText('Start all')).toBeNull();
});

it('should show the start bots widget on design page', async () => {
(useLocation as jest.Mock).mockImplementation(() => {
return { location: { pathname: 'http://server/bot/1234/dialogs' } };
});
const result = renderWithRecoil(<Header />);
expect(result.findAllByDisplayValue('Start all bots')).not.toBeNull();
expect(result.findAllByDisplayValue('Start all')).not.toBeNull();
});

it('should show the start bots widget on settings page', async () => {
(useLocation as jest.Mock).mockImplementation(() => {
return { location: { pathname: 'http://server/bot/1234/settings' } };
});
const result = renderWithRecoil(<Header />);
expect(result.findAllByDisplayValue('Start all bots')).not.toBeNull();
expect(result.findAllByDisplayValue('Start all')).not.toBeNull();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('<SkillForm />', () => {
recoilInitState
);

const urlInput = getByLabelText('Skill Manifest Url');
const urlInput = getByLabelText('Skill Manifest URL');
act(() => {
fireEvent.change(urlInput, {
target: { value: 'https://onenote-dev.azurewebsites.net/manifests/OneNoteSync-2-1-preview-1-manifest.json' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ describe('ExternalAdapterSettings', () => {
setSettingsMock.mockClear();
});

it('renders a link to the package manager', () => {
const { getByText } = renderWithRecoilAndCustomDispatchers(
<ExternalAdapterSettings projectId={PROJECT_ID} />,
initRecoilState
);

const link = getByText(/from package manager/);

expect(link.attributes.getNamedItem('href')?.value).toContain('plugin/package-manager/package-manager');
});

it('brings up the modal', () => {
const { getByTestId, getByText, queryByTestId } = renderWithRecoilAndCustomDispatchers(
<ExternalAdapterSettings projectId={PROJECT_ID} />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ describe('Publish Target', () => {
act(() => {
fireEvent.click(addNewPublishProfile);
});
expect(getByText('Add new publishing profile')).toBeInTheDocument();
expect(getByText('Create a publishing profile')).toBeInTheDocument();
});
});
3 changes: 2 additions & 1 deletion Composer/packages/client/__tests__/routers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

import React from 'react';
import { within } from '@testing-library/dom';
import { render } from '@botframework-composer/test-utils';
import { createHistory, createMemorySource, LocationProvider } from '@reach/router';

Expand Down Expand Up @@ -35,7 +36,7 @@ describe('<Router/> router test', () => {
} = renderWithRouter(wrapWithRecoil(<AppTest />));

const appContainer = container;
expect(appContainer.innerHTML).toMatch('Bot Framework Composer');
expect(within(appContainer).findByAltText('Composer Logo')).not.toBeNull();

navigate('/language-understanding');
expect(appContainer.innerHTML).toMatch('Setting');
Expand Down
6 changes: 3 additions & 3 deletions Composer/packages/client/src/Onboarding/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export const stepSets = (projectId: string, rootDialogId: string): IStepSet[] =>
id: 'publish',
steps: [
{
id: 'projectSettings',
id: 'publish',
navigateTo: `/bot/${projectId}/dialogs/${rootDialogId}?selected=triggers[0]`,
targetId: 'navProjectsettings',
targetId: 'navPublish',
},
],
title: formatMessage('Configure and publish'),
Expand Down Expand Up @@ -120,7 +120,7 @@ export const getTeachingBubble = (id: string | undefined): TeachingBubble => {
case 'actions':
return {
content: formatMessage(
'Actions are the main component of a trigger, they are what enable your bot to take action whether in response to user input or any other event that may occur.'
'Actions are the main component of a trigger; they are what enable your bot to take action whether in response to user input or any other event that may occur.'
),
headline: formatMessage('Actions'),
helpLink: 'https://docs.microsoft.com/en-us/composer/concept-dialog#action',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useRecoilValue } from 'recoil';
import debounce from 'lodash/debounce';
import { isUsingAdaptiveRuntime, SDKKinds } from '@bfc/shared';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';
import { Link } from 'office-ui-fabric-react/lib/Link';
import { Separator } from 'office-ui-fabric-react/lib/Separator';
import { Dropdown, IDropdownOption, ResponsiveMode } from 'office-ui-fabric-react/lib/Dropdown';

Expand Down Expand Up @@ -196,23 +195,16 @@ export const CreateSkillModal: React.FC<CreateSkillModalProps> = (props) => {
) : (
<Fragment>
<div style={{ marginBottom: '16px' }}>
{addSkillDialog.SKILL_MANIFEST_FORM.preSubText}
<Link href="https://aka.ms/bf-composer-docs-publish-bot" style={{ padding: '0 5px' }} target="_blank">
{formatMessage('Get an overview')}
</Link>
or
<Link href="https://aka.ms/bf-composer-docs-publish-bot" style={{ padding: '0 5px' }} target="_blank">
{formatMessage('learn how to build a skill')}
</Link>
{addSkillDialog.SKILL_MANIFEST_FORM.afterSubText}
{addSkillDialog.SKILL_MANIFEST_FORM.subText('https://aka.ms/bf-composer-docs-publish-bot')}
</div>
<Separator />
<Stack horizontal horizontalAlign="start" styles={{ root: { height: 300 } }}>
<div style={{ width: '50%' }}>
<TextField
required
errorMessage={formDataErrors.manifestUrl}
label={formatMessage('Skill Manifest Url')}
label={formatMessage('Skill Manifest URL')}
placeholder={formatMessage('Ask the skill owner for the URL and provide your bot’s App ID')}
value={formData.manifestUrl || ''}
onChange={handleManifestUrlChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@ const EnableOrchestrator: React.FC<OrchestratorProps> = (props) => {
};
return (
<Stack data-testid="orchestrator-skill">
<StackItem styles={{ root: { height: 300, width: '60%' } }}>
<StackItem styles={{ root: { height: 150, width: '90%' } }}>
<div style={{ marginBottom: '16px' }}>
{enableOrchestratorDialog.content}
{enableOrchestratorDialog.subText}
<Link href={learnMoreUrl} target="_blank">
<div>{formatMessage('Learn more about Orchestrator')}</div>
</Link>
</div>
<Checkbox
defaultChecked
label={formatMessage('Make Orchestrator my preferred recognizer for multi-bot projects')}
label={formatMessage(
'Use Orchestrator for multi-bot projects (bots that consist of multiple bots or connect to skills).'
)}
styles={{ root: { margin: '20px 0' } }}
onChange={onChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const BotController: React.FC<BotControllerProps> = ({ onHideController, isContr
`{
total, plural,
=1 {Start bot}
other {Start all bots}
other {Start all}
}`,
{ total: runningBots.totalBots }
)
Expand Down Expand Up @@ -275,7 +275,7 @@ const BotController: React.FC<BotControllerProps> = ({ onHideController, isContr
</DisableFeatureToolTip>
<div ref={onboardRef} css={[iconSectionContainer, disableStartBots ? disabledStyle : '']}>
<IconButton
ariaDescription={formatMessage('Open start bots panel')}
ariaDescription={formatMessage('Start and stop local bot runtimes')}
data-testid="StartBotsPanel"
disabled={disableStartBots}
iconProps={{
Expand All @@ -296,7 +296,7 @@ const BotController: React.FC<BotControllerProps> = ({ onHideController, isContr
},
rootHovered: { background: transparentBackground, color: NeutralColors.white },
}}
title={formatMessage('Open start bots panel')}
title={formatMessage('Start and stop local bot runtimes')}
onClick={onSplitButtonClick}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const PublishDialog: React.FC<IPublishDialogProps> = (props) => {
<br />
{Text.LUISDEPLOY}
<Link href={Links.LUIS} target="_blank">
{formatMessage('Learn more.')}
{formatMessage('Learn more')}
</Link>
</Fragment>
);
Expand All @@ -187,7 +187,7 @@ export const PublishDialog: React.FC<IPublishDialogProps> = (props) => {
<br />
{Text.QNADEPLOY}
<Link href={Links.QNA} target="_blank">
{formatMessage('Learn more.')}
{formatMessage('Learn more')}
</Link>
</Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export function CreateOptions(props: CreateOptionsProps) {
const dialogWrapperProps = DialogCreationCopy.CREATE_OPTIONS;

const options: IChoiceGroupOption[] = [
{ key: 'Create', text: formatMessage('Create a new bot') },
{ key: 'Connect', text: formatMessage('Connect to an existing bot') },
{ key: 'Create', text: formatMessage('Use Azure Bot to create a new conversation') },
{ key: 'Connect', text: formatMessage('Apply my Azure Bot resources for an existing bot') },
];

const handleChange = (e, option) => {
Expand Down Expand Up @@ -112,7 +112,7 @@ export function CreateOptions(props: CreateOptionsProps) {
>
<ChoiceGroup required defaultSelectedKey="B" options={options} onChange={handleChange} />
<DialogFooter>
<PrimaryButton data-testid="NextStepButton" text={formatMessage('Open')} onClick={handleJumpToNext} />
<PrimaryButton data-testid="NextStepButton" text={formatMessage('Next')} onClick={handleJumpToNext} />
<DefaultButton text={formatMessage('Cancel')} onClick={onDismiss} />
</DialogFooter>
</DialogWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,17 +527,20 @@ export const FileSelector: React.FC<FileSelectorProps> = (props) => {
label={formatMessage('Location')}
options={breadcrumbItems}
selectedKey={currentPath}
styles={{ root: { width: '420px' } }}
onChange={updatePath}
onPendingValueChanged={updatePathPending}
/>
</StackItem>
{operationMode.write && (
<StackItem align={'end'} styles={{ root: { marginBottom: 5 } }}>
<Link disabled={editMode !== EditMode.NONE} onClick={onCreateNewFolder}>
{operationMode.write && (
<Link
disabled={editMode !== EditMode.NONE}
styles={{ root: { marginTop: '5px' } }}
onClick={onCreateNewFolder}
>
{formatMessage('Create new folder')}
</Link>
</StackItem>
)}
)}
</StackItem>
</Stack>
<div css={detailListContainer} data-is-scrollable="true">
<ScrollablePane scrollbarVisibility={ScrollbarVisibility.auto}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export function CreateOptionsV2(props: CreateOptionsProps) {
};

const options: IChoiceGroupOption[] = [
{ key: 'Create', text: formatMessage('Create a new bot') },
{ key: 'Connect', text: formatMessage('Connect to an existing bot') },
{ key: 'Create', text: formatMessage('Use Azure Bot to create a new conversation') },
{ key: 'Connect', text: formatMessage('Apply my Azure Bot resources for an existing bot') },
];

const handleChange = (e, option) => {
Expand Down Expand Up @@ -133,7 +133,7 @@ export function CreateOptionsV2(props: CreateOptionsProps) {
>
<ChoiceGroup required defaultSelectedKey="Create" options={options} onChange={handleChange} />
<DialogFooter>
<PrimaryButton data-testid="NextStepButton" text={formatMessage('Open')} onClick={handleJumpToNext} />
<PrimaryButton data-testid="NextStepButton" text={formatMessage('Next')} onClick={handleJumpToNext} />
<DefaultButton text={formatMessage('Cancel')} onClick={onDismiss} />
</DialogFooter>
</DialogWrapper>
Expand Down
Loading

0 comments on commit 85adac7

Please sign in to comment.