Skip to content

Commit

Permalink
chore: merge latest master into multibot branch (#3518)
Browse files Browse the repository at this point in the history
* link the application keys with bot service in provision script (#3425)

* fix: #3309 Allow configuring app settings without opening a bot project (#3454)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: 'Ctrl + Click', 'Shift + Click' behaviors in Flow Editor (#3448)

* ctrl + click behavior

* enhance the focus behavior

* range selection e2e

* calculate accurate range selection

* MacOS Meta + Click support

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: fix relative path of runtime folder in eject customized (#3434)

* fix runtime relative path in eject

* fix process pid not exist when runtime folder not exist

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: typo (#3474)

* Fix a typo

Message recieved -> Message received

* Improve language

A basic brush of the Home page.

* fix: fix get history before file persistence (#3440)

* fix get history before file persistence

* flush in action not in component

* fix bug

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: #2692 Tabbing / clicking / returning out of a number field round your input (#3427)

* bug fix

* pr comment

* lint

* double export

* updated test

Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: revert plugins out of workspace (#3479)

* revert commit about add plugins into workspace

* revert other relative path change

* update the lock file

* remove yarn.lock in azure plugins to make sure bot-deploy updated

Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: Hide ignored folders in vscode, update prettier config (#3493)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

* fix: #3485

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: show 'AutoEndDialog' from Adaptive Dialog Property Editor (#3498)

* refactor: add rule and remove dangling underscores (#3496)

* add rule and remove dangling underscores

* update elliptic and test

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: added config to debug Electron main process. (#3501)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* Merge pull request #3502 from hatpick/master

fix: #3486 Debug/Fix HMR support

* fix: add logo-clicking to tests (#3500)

* add logo-clicking to tests

* bump elliptic version

* Update yarn.lock

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* feat: support validate lg custom functions (#3273)

* fix: support validate lg custom functions and separate the dialog validation from parser

* use file name as namespace

* add unit test

* fix lint

* fix: inline editing LU mess up whole file (#3478)

* upgrade lu packages

* update package

* clean

* update

* clean up

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* refactor: change term primary key to authoring key (#3516)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

Co-authored-by: Qi Kang <kangqidev@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: zeye <2295905420@qq.com>
Co-authored-by: VanyLaw <wenyluo@microsoft.com>
Co-authored-by: Yan Liu <32497439+zxyanliu@users.noreply.github.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: LouisEugeneMSFT <66701106+LouisEugeneMSFT@users.noreply.github.com>
Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: TJ Durnford <tjdford@gmail.com>
Co-authored-by: Tony Anziano <toanzian@microsoft.com>
Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com>
Co-authored-by: liweitian <liweitian93@outlook.com>
  • Loading branch information
17 people authored Jun 29, 2020
1 parent 9355bbf commit ede0728
Show file tree
Hide file tree
Showing 352 changed files with 8,313 additions and 900 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,18 @@
"port": 9228,
"sourceMaps": true
}
{
"type": "node",
"request": "launch",
"name": "Electron Main Process",
"runtimeExecutable": "${workspaceRoot}/Composer/node_modules/.bin/electron",
"args": [
"${workspaceRoot}/Composer/packages/electron-server",
],
"env": {
"NODE_ENV": "development",
},
"outputCapture": "std"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"files.trimTrailingWhitespace": true,
"files.associations": {
"*.dialog": "json",
"*.botproj": "json",
"*.schema": "json"
},
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": true,
"**/build": true
},
"eslint.enable": true,
"eslint.packageManager": "yarn",
"eslint.validate": [
Expand All @@ -14,6 +21,7 @@
],
"eslint.workingDirectories": ["./Composer"],
"typescript.tsdk": "./Composer/node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
Expand Down
10 changes: 10 additions & 0 deletions Composer/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ module.exports = {
yoda: 'error',
'no-bitwise': 'error',
// eqeqeq: 'error',
'no-underscore-dangle': [
'error',
{
// add special window.__foo__ names as exceptions here
allow: ['__nonce__', '__IS_ELECTRON__'],
// allow this._name so custom getters and setters can be written gracefully
allowAfterThis: true,
enforceInMethodNames: true,
},
],

// plugin: import
'import/first': 'error',
Expand Down
3 changes: 3 additions & 0 deletions Composer/cypress/integration/LGPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ context('LG Page', () => {
// back to table view
cy.get('@switchButton').click();

// click the logo to clear any stray navigation
cy.findByAltText('Composer Logo').click();

// nav to Main dialog
cy.findByTestId('ProjectTree').within(() => {
cy.findByText('__TestTodoSample').click();
Expand Down
3 changes: 3 additions & 0 deletions Composer/cypress/integration/NotificationPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ context('Notification Page', () => {
it('can show dialog expression error ', () => {
cy.visitPage('Design');

// click the logo to clear any stray tooltips from page navigation
cy.findByAltText('Composer Logo').click();

cy.findByTestId('ProjectTree').within(() => {
cy.findByText('WelcomeUser').click();
});
Expand Down
2 changes: 1 addition & 1 deletion Composer/cypress/integration/Onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ context('Onboarding', () => {

//enable onboarding setting
cy.visitPage('Settings');
cy.findByText('App Settings').click();
cy.findByText('Application Settings').click();
cy.findByLabelText('Onboarding').click();
cy.visitPage('Design');
});
Expand Down
13 changes: 8 additions & 5 deletions Composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"serialize-javascript": "^3.1.0",
"lodash": "^4.17.12",
"set-value": "^3.0.2",
"kind-of": "^6.0.3"
"kind-of": "^6.0.3",
"elliptic": "^6.5.3"
},
"engines": {
"node": ">=12"
Expand All @@ -26,9 +27,7 @@
"packages/tools",
"packages/tools/language-servers",
"packages/tools/language-servers/*",
"packages/ui-plugins/*",
"packages/plugins",
"packages/plugins/*"
"packages/ui-plugins/*"
],
"scripts": {
"build": "node scripts/begin.js && yarn build:prod && yarn build:plugins",
Expand All @@ -41,7 +40,11 @@
"build:server": "yarn workspace @bfc/server build",
"build:client": "yarn workspace @bfc/client build",
"build:tools": "yarn workspace @bfc/tools build:all",
"build:plugins": "wsrun -lt -p @bfc/plugin-samples @bfc/plugin-azure-publish @bfc/plugin-azure-functions-publish @bfc/plugin-localpublish -c build",
"build:plugins": "yarn build:plugins:localpublish && yarn build:plugins:samples && yarn build:plugins:azurePublish && yarn build:plugins:azureFunctionsPublish",
"build:plugins:localpublish": "cd plugins/localPublish && yarn install && yarn build",
"build:plugins:samples": "cd plugins/samples && yarn install && yarn build",
"build:plugins:azurePublish": "cd plugins/azurePublish && yarn install && yarn build",
"build:plugins:azureFunctionsPublish": "cd plugins/azureFunctionsPublish && yarn install && yarn build",
"start": "cross-env NODE_ENV=production PORT=3000 yarn start:server",
"startall": "yarn start",
"start:dev": "concurrently \"npm:start:client\" \"npm:start:server:dev\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ describe('getActivityTypes', () => {
{ key: 'Microsoft.OnHandoffActivity', text: 'Handover to human (Handoff activity)' },
{ key: 'Microsoft.OnInvokeActivity', text: 'Conversation invoked (Invoke activity)' },
{ key: 'Microsoft.OnTypingActivity', text: 'User is typing (Typing activity)' },
{ key: 'Microsoft.OnMessageActivity', text: 'Message received (Message recieved activity)' },
{ key: 'Microsoft.OnMessageActivity', text: 'Message received (Message received activity)' },
{ key: 'Microsoft.OnMessageDeleteActivity', text: 'Message deleted (Message deleted activity)' },
{ key: 'Microsoft.OnMessageReactionActivity', text: 'Message reaction (Message reaction activity)' },
{ key: 'Microsoft.OnMessageUpdateActivity', text: 'Message updated (Message updated activity)' },
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getClientEnvironment(publicUrl) {
SDK_PACKAGE_VERSION: '4.9.3', // TODO: change this when Composer supports custom schema/custom runtime
COMPOSER_VERSION: '1.0.1',
LOCAL_PUBLISH_PATH:
process.env.LOCAL_PUBLISH_PATH || path.resolve(process.cwd(), '../plugins/localPublish/hostedBots'),
process.env.LOCAL_PUBLISH_PATH || path.resolve(process.cwd(), '../../plugins/localPublish/hostedBots'),
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
Expand Down
5 changes: 3 additions & 2 deletions Composer/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"proxy": "http://localhost:5000",
"dependencies": {
"@bfc/adaptive-flow": "*",
"@bfc/adaptive-form": "*",
"@bfc/code-editor": "*",
"@bfc/extension": "*",
Expand All @@ -29,9 +30,8 @@
"@bfc/ui-plugin-prompts": "*",
"@bfc/ui-plugin-select-dialog": "*",
"@bfc/ui-plugin-select-skill-dialog": "*",
"@bfc/adaptive-flow": "*",
"@emotion/core": "^10.0.7",
"@microsoft/bf-lu": "4.9.1",
"@microsoft/bf-lu": "^4.10.0-preview.141651",
"@reach/router": "^1.2.1",
"@uifabric/fluent-theme": "^7.1.13",
"@uifabric/icons": "^7.3.4",
Expand Down Expand Up @@ -73,6 +73,7 @@
"@types/reach__router": "^1.2.4",
"@types/react": "16.9.23",
"@types/react-dom": "16.9.5",
"@types/webpack-env": "^1.15.2",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-loader": "8.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type SortState = {
descending: boolean;
};

const _renderIcon = (file: File) => {
const renderIcon = (file: File) => {
const iconName = getFileIconName(file);
if (iconName === FileTypes.FOLDER) {
return <Icon iconName="OpenFolderHorizontal" style={{ fontSize: '16px' }} />;
Expand All @@ -60,7 +60,7 @@ const _renderIcon = (file: File) => {
return <img alt={`${iconName} file icon`} className={detailListClass.fileIconImg} src={url} />;
};

const _renderNameColumn = (onFileChosen: (file: File) => void) => (file: File) => {
const renderNameColumn = (onFileChosen: (file: File) => void) => (file: File) => {
const iconName = getFileIconName(file);
return (
<div data-is-focusable css={tableCell}>
Expand Down Expand Up @@ -105,7 +105,7 @@ export const FileSelector: React.FC<FileSelectorProps> = (props) => {
fieldName: 'name',
minWidth: 16,
maxWidth: 16,
onRender: _renderIcon,
onRender: renderIcon,
},
{
key: 'name',
Expand All @@ -118,7 +118,7 @@ export const FileSelector: React.FC<FileSelectorProps> = (props) => {
sortAscendingAriaLabel: formatMessage('Sorted A to Z'),
sortDescendingAriaLabel: formatMessage('Sorted Z to A'),
data: 'string',
onRender: _renderNameColumn(onFileChosen),
onRender: renderNameColumn(onFileChosen),
isPadded: true,
},
{
Expand Down
6 changes: 3 additions & 3 deletions Composer/packages/client/src/components/ErrorPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type ErrorPopupProps = {
export const ErrorPopup = (props: ErrorPopupProps) => {
const [hidden, setHidden] = useState(props.error ? false : true);

const _closeDialog = () => {
const closeDialog = () => {
setHidden(true);
props.onDismiss();
};
Expand All @@ -35,11 +35,11 @@ export const ErrorPopup = (props: ErrorPopupProps) => {
isBlocking: false,
styles: { main: { maxWidth: 450 } },
}}
onDismiss={_closeDialog}
onDismiss={closeDialog}
>
<div css={consoleStyle}>{props.error}</div>
<DialogFooter>
<PrimaryButton text="Ok" onClick={_closeDialog} />
<PrimaryButton text="Ok" onClick={closeDialog} />
</DialogFooter>
</Dialog>
);
Expand Down
2 changes: 2 additions & 0 deletions Composer/packages/client/src/components/NavTree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface INavTreeItem {
name: string;
ariaLabel?: string;
url: string;
disabled?: boolean;
}

interface INavTreeProps {
Expand Down Expand Up @@ -54,6 +55,7 @@ const NavTree: React.FC<INavTreeProps> = (props) => {
return (
<DefaultButton
key={item.id}
disabled={item.disabled}
href={item.url}
styles={isSelected ? itemSelected : itemNotSelected}
text={item.name}
Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/client/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const Tips = {
(projectname-environment-LUfilename)`),
ENVIRONMENT: formatMessage(`When multiple people are working with models you want to be able to work with
models independently from each other tied to the source control.`),
AUTHORING_KEY: formatMessage('A primary key is created automatically when you create a LUIS account.'),
AUTHORING_KEY: formatMessage('An authoring key is created automatically when you create a LUIS account.'),
AUTHORING_REGION: formatMessage('Authoring region to use [westus,westeurope,australiaeast]'),
DEFAULT_LANGUAGE: formatMessage(
`Configures default language model to use if there is no culture code in the file name (Default:en-us)`
Expand Down Expand Up @@ -251,7 +251,7 @@ export enum AppUpdaterStatus {

export const DefaultPublishConfig = {
name: 'default',
type: '@bfc/plugin-localpublish',
type: 'localpublish',
};

export const EmptyBotTemplateId = 'EmptyBot';
Expand Down
36 changes: 28 additions & 8 deletions Composer/packages/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import './index.css';
import { App } from './App';
import { StoreProvider } from './store';

const appHostElm = document.getElementById('root');

formatMessage.setup({
missingTranslation: 'ignore',
});
Expand All @@ -20,11 +22,29 @@ const emotionCache = createCache({
nonce: window.__nonce__,
});

ReactDOM.render(
<CacheProvider value={emotionCache}>
<StoreProvider>
<App />
</StoreProvider>
</CacheProvider>,
document.getElementById('root')
);
/**
* Renders the React App module.
*/
const renderApp = (AppComponent: typeof App) => {
ReactDOM.render(
<CacheProvider value={emotionCache}>
<StoreProvider>
<AppComponent />
</StoreProvider>
</CacheProvider>,
appHostElm
);
};

// Rendering the App for the first time.
renderApp(App);

/**
* Re-render updated App Module when hot module notifies a change.
*/
if (module.hot) {
module.hot.accept('./App', () => {
const NextApp = require<{ App: typeof App }>('./App').App;
renderApp(NextApp);
});
}
2 changes: 2 additions & 0 deletions Composer/packages/client/src/pages/design/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ const DesignPage: React.FC<RouteComponentProps<{ dialogId: string; projectId: st
onBreadcrumbItemClick: handleBreadcrumbItemClick,
promptTab: getTabFromFragment(),
});
/* eslint-disable no-underscore-dangle */
// @ts-ignore
globalHistory._onTransitionComplete();
/* eslint-enable */
} else {
//leave design page should clear the history
clearUndoHistory();
Expand Down
5 changes: 3 additions & 2 deletions Composer/packages/client/src/pages/home/ExampleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const resolveIcon = (exampleId: string): string => {
export const ExampleList: React.FC<ExampleListProps> = (props) => {
const { onClick, examples } = props;

function _onRenderCell(item?: ProjectTemplate): React.ReactNode {
function onRenderCell(item?: ProjectTemplate): React.ReactNode {
if (!item) {
return;
}
Expand All @@ -46,6 +46,7 @@ export const ExampleList: React.FC<ExampleListProps> = (props) => {
data-is-focusable
aria-label={item.name + '; ' + item.description}
css={exampleListCell}
role="button"
tabIndex={0}
onClick={() => onClick(item.id)}
onKeyDown={(ev) => {
Expand All @@ -66,7 +67,7 @@ export const ExampleList: React.FC<ExampleListProps> = (props) => {
return (
<div css={exampleListContainer} data-is-scrollable="true">
<ScrollablePane scrollbarVisibility={ScrollbarVisibility.auto}>
<List items={examples} onRenderCell={_onRenderCell} />
<List items={examples} onRenderCell={onRenderCell} />
</ScrollablePane>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/client/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const Home: React.FC<RouteComponentProps> = () => {
<h1 css={home.title}>{formatMessage(`Bot Framework Composer`)}</h1>
<div aria-label={formatMessage('Composer introduction')} css={home.introduction} role="region">
{formatMessage(
'Bot Framework Composer is an integrated development environment (IDE) for building bots and other types of conversational software with the Microsoft Bot Framework technology stack'
'Bot Framework Composer is an integrated development environment (IDE) for building bots and other types of conversational software with the Microsoft Bot Framework technology stack.'
)}
</div>
<div css={home.newBotContainer}>
Expand Down Expand Up @@ -216,7 +216,7 @@ const Home: React.FC<RouteComponentProps> = () => {
<div css={home.linkContainer}>
<div>
{formatMessage(
'Bot Framework provides the most comprehensive experience for building conversation applications.'
'Bot Framework provides the most comprehensive experience for building conversational applications.'
)}
</div>
{linksButtom.map((link) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
[file, projectId]
);

const _onChange = useCallback(
const onChange = useCallback(
(value) => {
if (!file) return;
if (inlineMode) {
Expand Down Expand Up @@ -142,7 +142,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
}}
lgOption={lgOption}
value={content}
onChange={_onChange}
onChange={onChange}
onChangeSettings={handleSettingsChange}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
[file, projectId]
);

const _onChange = useCallback(
const onChange = useCallback(
(value) => {
setContent(value);
if (!file) return;
Expand Down Expand Up @@ -134,7 +134,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
}}
luOption={luOption}
value={content}
onChange={_onChange}
onChange={onChange}
onChangeSettings={handleSettingsChange}
/>
);
Expand Down
Loading

0 comments on commit ede0728

Please sign in to comment.