Skip to content

Commit

Permalink
Merge branch 'main' into julong/skill-hidden-select-dialog
Browse files Browse the repository at this point in the history
* main: (46 commits)
  Hides the PVA publish profile from the profle creation dropdown (#7725)
  fix: converting bot with custom actions (ui update) (#7672)
  fix: generate manifest file when creating new publish target (#7666)
  Feed string, not int, to Switch per schema (#7707)
  fix: (Un) Installing a package now stops the currently running bot beforehand (#7689)
  Add components field to migrated settings. Guard against missing field during component merge (#7674)
  exclude items from the package manager list that do not have names or versions -- such as locally implemented custom actions (#7683)
  chore: Rebase main with 1.4.1 release (#7678)
  fix: restore line beneath page header (#7676)
  remove appsettings file from default gitignore (#7679)
  fix: data race writing on setting file (#7475)
  feat: detect "old" bots and migrate them to new runtime (#6526)
  feat: show tunneling information notification when starting bot with remote skills (#7611)
  fix: Added cleanup logic to app on quit (#7645)
  fix: Update provision & publishing copy (#7583) (#7642)
  fix: rephrase Enable Orchestrator dialog (#7639)
  fix: update left nav and top bar strings (#7609)
  chore: bump wait-on to v5.3.0 (#7648)
  special case the fallback recognizer (#7634)
  fix: fit and finish across the app (#7598)
  ...
  • Loading branch information
alanlong9278 committed May 11, 2021
2 parents 2885212 + e0c8366 commit b75ada3
Show file tree
Hide file tree
Showing 202 changed files with 4,537 additions and 2,934 deletions.
10 changes: 5 additions & 5 deletions 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 All @@ -80,7 +80,7 @@ context('breadcrumb', () => {
cy.findByTestId('DialogHeader-TestBot_TestSample').within(() => {
cy.findByTestId('dialogMoreButton').click({ force: true });
});
cy.findAllByText('Add a trigger').click({ force: true });
cy.findAllByText('Add new trigger').click({ force: true });
cy.findByTestId('triggerTypeDropDown').click();
cy.get('[title="Intent recognized"]').click();
cy.findByTestId('TriggerName').type('myTrigger1');
Expand All @@ -92,7 +92,7 @@ context('breadcrumb', () => {
cy.findByTestId('DialogHeader-TestBot_TestSample').within(() => {
cy.findByTestId('dialogMoreButton').click({ force: true });
});
cy.findAllByText('Add a trigger').click({ force: true });
cy.findAllByText('Add new trigger').click({ force: true });
cy.findByTestId('triggerTypeDropDown').click();
cy.get('[title="Dialog events"]').click();
cy.findByText('Select an event type').click();
Expand All @@ -104,7 +104,7 @@ context('breadcrumb', () => {
cy.findByTestId('DialogHeader-TestBot_TestSample').within(() => {
cy.findByTestId('dialogMoreButton').click({ force: true });
});
cy.findAllByText('Add a trigger').click({ force: true });
cy.findAllByText('Add new trigger').click({ force: true });
cy.findByTestId('triggerTypeDropDown').click();
cy.get('[title="Custom events"]').click();
cy.findByTestId('CustomEventName').type('myCustomEvent');
Expand All @@ -115,7 +115,7 @@ context('breadcrumb', () => {
cy.findByTestId('DialogHeader-TestBot_TestSample').within(() => {
cy.findByTestId('dialogMoreButton').click({ force: true });
});
cy.findAllByText('Add a trigger').click({ force: true });
cy.findAllByText('Add new trigger').click({ force: true });
cy.findByTestId('triggerTypeDropDown').click();
cy.get('[title="Activities"]').click();
cy.findByText('Select an activity type').click();
Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -55,7 +55,7 @@ context('Home Page ', () => {
cy.visit('/home');
cy.findByTestId('LeftNav-CommandBarButtonHome').click();
cy.findByTestId('homePage-Toolbar-New').within(() => {
cy.findByText('New').click();
cy.findByText('Create new').click();
});
cy.wait(3000);
cy.findByTestId('@microsoft/generator-bot-empty').click();
Expand Down
8 changes: 4 additions & 4 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.findByText('Development Resources').click();
cy.visitPage('Configure');
cy.findByText('Development resources').click();
cy.findAllByTestId('rootLUISAuthoringKey').type('12345678', { delay: 200 });
cy.findAllByTestId('rootLUISRegion').click();
cy.findByText('westus').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
8 changes: 7 additions & 1 deletion Composer/packages/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ const Logger = () => {
return null;
};

const { ipcRenderer } = window;
export const App: React.FC = () => {
const { appLocale } = useRecoilValue(userSettingsState);

const { fetchExtensions, fetchFeatureFlags, checkNodeVersion } = useRecoilValue(dispatcherState);
const { fetchExtensions, fetchFeatureFlags, checkNodeVersion, performAppCleanupOnQuit } = useRecoilValue(
dispatcherState
);

useEffect(() => {
loadLocale(appLocale);
Expand All @@ -32,6 +35,9 @@ export const App: React.FC = () => {
checkNodeVersion();
fetchExtensions();
fetchFeatureFlags();
ipcRenderer?.on('cleanup', (_event) => {
performAppCleanupOnQuit();
});
}, []);

return (
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
Loading

0 comments on commit b75ada3

Please sign in to comment.