Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
51b33db
Added schema for bot project support
Jul 29, 2020
8d58b7c
Added support to handle botproject space
Sep 17, 2020
7041fd3
More updates
Sep 18, 2020
e94c5f5
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Sep 18, 2020
425df2e
temp
Sep 18, 2020
c64ecf2
Backup
Sep 21, 2020
29044a0
More updates
Sep 24, 2020
d20ce8e
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Sep 24, 2020
28f917c
More updates
Sep 24, 2020
0b6aa25
update the recoil to 0.0.13
lei9444 Sep 25, 2020
1230a20
fix lint
lei9444 Sep 25, 2020
bee0818
remove @type/recoil
lei9444 Sep 25, 2020
5b4e928
Merge branch 'main' into recoil
cwhitten Sep 25, 2020
d491bac
router work
Sep 25, 2020
671bf84
Merge branch 'recoil' of https://github.com/lei9444/BotFramework-Comp…
Sep 25, 2020
40f8661
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Sep 29, 2020
cb0c67e
Bot Project file
Sep 27, 2020
f105aea
Migrate to old desing page and project tree
Oct 2, 2020
48d7f0b
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 2, 2020
9aa46ca
Revert usage of React 16.13.1 to 16.13.0
Oct 2, 2020
98c60d6
Revert "Revert usage of React 16.13.1 to 16.13.0"
Oct 2, 2020
6d76657
Rename api handlers
Oct 2, 2020
7588efb
Merge branch 'main' into srravich/botproject-file-handler
srinaath Oct 3, 2020
86d7443
Add existing skill tests passing
Oct 3, 2020
955bab7
Merge branch 'srravich/botproject-file-handler' of https://github.com…
Oct 3, 2020
308e392
Add 1.0 botproject schema
Oct 4, 2020
b98e1fa
Fix typo
Oct 4, 2020
26581e2
Manifest tests updated
Oct 4, 2020
7e4f5d0
Removed code for bot migration
Oct 6, 2020
9d5bbc6
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 6, 2020
493c604
Server side tests added
Oct 6, 2020
12648f7
Updated schema url to the correct one
Oct 6, 2020
fc707fe
Fix lint and update schema url on echobot
Oct 6, 2020
52844ff
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 6, 2020
729fff3
botstates
Oct 6, 2020
4fc8e2d
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 7, 2020
103c7b7
Clean up paths
Oct 7, 2020
21ce792
Spellings cleanup
Oct 7, 2020
b046925
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 7, 2020
c56e1b1
Updated gitignore
Oct 7, 2020
b78d118
Typo fixed
Oct 7, 2020
de1a414
Set project ignore validation to true while opening remote skill
Oct 7, 2020
32fa411
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 8, 2020
828bee2
Merge branch 'main' into srravich/bot-projects-schema
cwhitten Oct 8, 2020
ccf5f88
Merge branch 'main' into srravich/bot-projects-schema
srinaath Oct 8, 2020
e9f525a
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 8, 2020
c791838
Merge branch 'srravich/bot-projects-schema' of https://github.com/mic…
Oct 8, 2020
5576163
Following sdk.schema approach to specificy object type using ref
Oct 8, 2020
f6076dc
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 8, 2020
1d815f1
Runtime start first pass
Oct 9, 2020
c1723b4
Runtime start updates
Oct 12, 2020
b155a49
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 14, 2020
6055397
Update to settings
Oct 14, 2020
6262995
Working bot status indicator
Oct 14, 2020
d000d76
Update to start component
Oct 15, 2020
f04a8f1
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 15, 2020
e2041ee
Stable LocalBotRuntime operations
Oct 16, 2020
fa75d8a
add/remote skill sync to *.botproj file
zhixzhan Oct 16, 2020
bc20752
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 16, 2020
90be172
relative path support bp file
Oct 16, 2020
0a688c4
Fix schema
Oct 16, 2020
1f8a9c4
Removed workspace references.
Oct 16, 2020
6970cc5
Relative path support
Oct 16, 2020
a0fc8e2
creation flow of add/open skill bot, remote skill
zhixzhan Oct 16, 2020
84f0a50
Update operations on Bot project file
Oct 16, 2020
96e3fb4
Updated runtime code
Oct 19, 2020
f29484e
clean up
zhixzhan Oct 19, 2020
bd580f9
Start bots panel first pass completed
Oct 19, 2020
e6ef1d2
Updated tests for removing workspace reference
Oct 20, 2020
1339b15
Removed manifest update operation
Oct 20, 2020
975952e
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 20, 2020
64cc847
Cleared logs
Oct 20, 2020
ca842f1
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 20, 2020
c4b33ff
Remove skill references
Oct 20, 2020
a4d5cb6
Remove skill references
Oct 20, 2020
3971053
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 20, 2020
a75f725
Merge branch 'srravich/3957-runtime-start' of https://github.com/micr…
Oct 20, 2020
5c28191
Update references
Oct 20, 2020
195839a
Merge branch 'srravich/bot-projects-schema' of https://github.com/mic…
Oct 20, 2020
0ba924b
Updated runtime experience
Oct 21, 2020
83e15bb
Merge branch 'srravich/3957-runtime-start' into zhixzhan/botprojects-…
zhixzhan Oct 21, 2020
8162107
repair broken link modal
zhixzhan Oct 21, 2020
fa30e2a
update the recognizer types generate function
lei9444 Oct 21, 2020
08d6546
repair broken skill link
zhixzhan Oct 21, 2020
9908533
Safe removal of skills
Oct 21, 2020
0b03794
Resolve bugs with $kind
Oct 22, 2020
321eaf1
Merge branch 'srravich/3957-runtime-start' into zhixzhan/botprojects-…
zhixzhan Oct 22, 2020
30e933d
check LUIS & QnA key
zhixzhan Oct 22, 2020
854c61d
add diagnostics to botProjectSpaceSelector
zhixzhan Oct 22, 2020
e8ea50c
diagnostics in projectree
zhixzhan Oct 22, 2020
4d50213
safely remove unused refs
Oct 22, 2020
581a9d3
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 22, 2020
034a893
Handle select skill dialog tests
Oct 22, 2020
b912855
Skill utils updated
Oct 23, 2020
ac3c86e
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 23, 2020
ed84694
diagnostics style in project tree
zhixzhan Oct 23, 2020
d8f487e
context menu in project tree
zhixzhan Oct 23, 2020
05eaaf4
Merge branch 'srravich/3957-runtime-start' into zhixzhan/botprojects-…
zhixzhan Oct 23, 2020
503e4bb
update
zhixzhan Oct 23, 2020
7bb67f3
Added more unit tests
Oct 23, 2020
6e4423e
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 23, 2020
34e64a0
Added back file to get it back to main version
Oct 23, 2020
b0f7b99
Bot status tracker operation
Oct 23, 2020
24fef2b
More tests added
Oct 24, 2020
53c6911
Moved test files
Oct 24, 2020
814a0ce
Added aria labels
Oct 24, 2020
4c0ac80
Header tests updated
Oct 25, 2020
a79dd42
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
Oct 25, 2020
031175b
cleaned up tests and rebased main
Oct 25, 2020
a472ced
yarn update and header test
Oct 25, 2020
dcd0c2b
PR cleanup before moving from draft status
Oct 25, 2020
c7e05dc
Merge branch 'srravich/3957-runtime-start' into zhixzhan/botprojects-…
zhixzhan Oct 26, 2020
0917831
package all setting check into botindexer.validate
zhixzhan Oct 26, 2020
0a04fde
update
zhixzhan Oct 26, 2020
16dbd3c
Migration completed
Oct 26, 2020
1121f3c
Updated yarn.lock on vacore
Oct 26, 2020
3a8ae55
Revert azure publish yarn lock
Oct 26, 2020
c27cca1
remove fit from test
Oct 26, 2020
3d7e9fc
Update settings on removing a skill
Oct 26, 2020
68c695f
Logic update for skill deletion
Oct 26, 2020
02d935e
Merge branch 'feature/bot-projects' of https://github.com/microsoft/B…
Oct 26, 2020
4ff5427
Add get port to server
Oct 26, 2020
6d6a6c5
Start root bot if skills are not present
Oct 27, 2020
3a40468
trigger dispatcher
zhixzhan Oct 27, 2020
bf6b085
context menu button enable
zhixzhan Oct 27, 2020
354f0b4
start/stop bot in project tree
zhixzhan Oct 27, 2020
010a759
edit/create manifest
zhixzhan Oct 27, 2020
403e441
Merge branch 'srravich/3957-runtime-start' into zhixzhan/botprojects-…
zhixzhan Oct 28, 2020
ca84b80
Create/edit skill manifest modal
zhixzhan Oct 28, 2020
ad018de
clean up qnaKbUrls
zhixzhan Oct 28, 2020
0ba014d
creation flow in design page
zhixzhan Oct 28, 2020
663ed31
update broken skill repair modal
zhixzhan Oct 28, 2020
6ddb55d
feat: local bot controller
tdurnford Oct 28, 2020
ec1eb93
fet: Add test in emulator column
tdurnford Oct 28, 2020
74287da
Updated select skill dialog to disable controls if no skill
Oct 28, 2020
b7808b9
open emulator test
tdurnford Oct 28, 2020
7a70e1a
Added fnd by role
Oct 28, 2020
fc37046
Merge branch 'srravich/3957-runtime-start' of https://github.com/micr…
Oct 28, 2020
1c6724d
open Emulator test updates
Oct 29, 2020
4c6d4c5
Update to skills Utils
Oct 29, 2020
763920b
update error message style
zhixzhan Oct 29, 2020
ecc013d
Support skillhost endpoint for remote skills
Oct 29, 2020
9644592
edit skill manifest in edit mode
zhixzhan Oct 29, 2020
3ac0750
fix menu flash
tdurnford Oct 29, 2020
6d38c99
Port set
Oct 30, 2020
b9093b7
Merge branch 'feature/bot-projects' of https://github.com/microsoft/B…
Oct 30, 2020
cef687c
Update yarn lock
Oct 30, 2020
b0b655e
remote skill manifest editor
zhixzhan Oct 30, 2020
c5b3b58
refine broken bot
zhixzhan Oct 30, 2020
a907cd8
fixed styles
tdurnford Oct 30, 2020
7c12f00
tests
tdurnford Oct 30, 2020
81c72ee
tests
tdurnford Nov 2, 2020
babdd5b
Merge branch 'feature/bot-projects' of https://github.com/microsoft/B…
Nov 2, 2020
b764b63
Unit tests completed
Nov 2, 2020
24ea004
Merge branch 'srravich/3957-runtime-start' into zhixzhan/botprojects-…
zhixzhan Nov 3, 2020
c8e4e58
resolve merge conflict
zhixzhan Nov 3, 2020
d14c3db
navigation and visual editor for remote skill
zhixzhan Nov 3, 2020
bab7529
lint fix
zhixzhan Nov 4, 2020
69fd3fa
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
zhixzhan Nov 10, 2020
2811e37
resolve merge conflict
zhixzhan Nov 10, 2020
e89195c
update
zhixzhan Nov 10, 2020
4c1324f
update
zhixzhan Nov 11, 2020
1c6bb9d
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
zhixzhan Nov 11, 2020
f484cda
get bot diagnostics when load bot
zhixzhan Nov 11, 2020
25d4ca8
update
zhixzhan Nov 11, 2020
213ac68
move skillsProjectIdSelector to selectors/skills
zhixzhan Nov 11, 2020
7632b01
navigate to skill bot, update test
zhixzhan Nov 11, 2020
64060e9
feat: Property Editor Header when botname is selected in Project tree…
srinaath Nov 12, 2020
51b6be6
clean up
zhixzhan Nov 12, 2020
e4cd7ed
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
zhixzhan Nov 12, 2020
90a3a1b
move PropertyEditorHeader.test.tsx to client/design
zhixzhan Nov 12, 2020
3b49c84
clean up
zhixzhan Nov 12, 2020
19317e9
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
zhixzhan Nov 12, 2020
f4b5e8a
clean up qnaKbUrls
zhixzhan Nov 12, 2020
e752d5c
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
zhixzhan Nov 12, 2020
1257068
resolve merge conflict
zhixzhan Nov 12, 2020
c52a88f
clean up
zhixzhan Nov 12, 2020
2174c5b
clean
zhixzhan Nov 12, 2020
0b67c62
validation from settings
zhixzhan Nov 12, 2020
7e8b7cb
ut for trigger dispatcher
zhixzhan Nov 12, 2020
f11fcb8
fix e2e tests and update the dialog create logic
lei9444 Nov 12, 2020
189bf26
Merge branch 'zhixzhan/botprojects-skill' of https://github.com/micro…
lei9444 Nov 12, 2020
8340d73
fix unit tests
lei9444 Nov 12, 2020
8ba45ff
fix create bot error
lei9444 Nov 12, 2020
06e63ae
change the warning and error position
lei9444 Nov 12, 2020
2a69658
fix navigate error when create a new dialog
lei9444 Nov 12, 2020
49eef7e
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
zhixzhan Nov 13, 2020
b01027e
update
zhixzhan Nov 13, 2020
68bfcc6
update link
zhixzhan Nov 13, 2020
fe29b9c
Header update
Nov 13, 2020
be433a9
Adjust styles
Nov 13, 2020
15ee986
bot check filter empty qna/lu files
zhixzhan Nov 13, 2020
af7ede5
context menu in project tree header
zhixzhan Nov 13, 2020
b449fd3
Merge branch 'zhixzhan/botprojects-skill' of https://github.com/micro…
zhixzhan Nov 13, 2020
a669ff1
update
zhixzhan Nov 13, 2020
466a6c6
Updated styles
Nov 13, 2020
3e43a79
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
beyackle Nov 13, 2020
87b16d4
Merge branch 'feature/bot-projects' into zhixzhan/botprojects-skill
srinaath Nov 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Composer/cypress/integration/RemoveDialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ context('RemoveDialog', () => {
});
});

cy.get('.ms-ContextualMenu-linkContent > .ms-ContextualMenu-itemText').within(() => {
cy.findByText('Remove this dialog').click();
});
cy.findByText('Remove this dialog').click();

cy.findByText('Yes').click();

Expand Down
84 changes: 46 additions & 38 deletions Composer/packages/adaptive-form/src/components/AdaptiveForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React from 'react';
import { FormErrors, JSONSchema7, UIOptions } from '@bfc/extension-client';
import ErrorBoundary from 'react-error-boundary';
import formatMessage from 'format-message';
import { FontSizes } from '@uifabric/fluent-theme';

import AdaptiveFormContext from '../AdaptiveFormContext';

Expand All @@ -15,12 +16,6 @@ import FormTitle from './FormTitle';
import ErrorInfo from './ErrorInfo';
import { LoadingTimeout } from './LoadingTimeout';

const styles = {
errorLoading: css`
padding: 18px;
`,
};

export interface AdaptiveFormProps {
errors?: string | FormErrors | string[] | FormErrors[];
schema?: JSONSchema7;
Expand All @@ -32,43 +27,56 @@ export interface AdaptiveFormProps {
onChange: (value: any) => void;
}

const schemaLoadErrorStyle = css`
display: flex;
align-items: center;
justify-content: center;
height: 100%;
font-size: ${FontSizes.size14};
`;

export const AdaptiveForm: React.FC<AdaptiveFormProps> = function AdaptiveForm(props) {
const { errors, focusedTab, formData, schema, uiOptions, onChange, onFocusedTab } = props;

if (!formData || !schema) {
if (!formData && !schema) {
return (
<LoadingTimeout timeout={2000}>
<div css={styles.errorLoading}>
{formatMessage('{type} could not be loaded', {
type: formData ? formatMessage('Schema') : formatMessage('Dialog data'),
})}
</div>
</LoadingTimeout>
<div css={schemaLoadErrorStyle}>
<LoadingTimeout timeout={2000}>
<p>
{formatMessage('{type} could not be loaded', {
type: formData ? formatMessage('Schema') : formatMessage('Dialog data'),
})}
</p>
</LoadingTimeout>
</div>
);
}

return (
<ErrorBoundary FallbackComponent={ErrorInfo}>
<AdaptiveFormContext.Provider value={{ focusedTab, onFocusedTab, baseSchema: schema }}>
<FormTitle
formData={formData}
id={formData.$designer?.id || 'unknown'}
schema={schema}
uiOptions={uiOptions}
onChange={(newData) => onChange({ ...formData, ...newData })}
/>
<SchemaField
definitions={schema?.definitions}
depth={-1}
id={formData.$designer?.id ? `root[${formData.$designer?.id}]` : 'root'}
name="root"
rawErrors={errors}
schema={schema}
uiOptions={uiOptions}
value={formData}
onChange={onChange}
/>
</AdaptiveFormContext.Provider>
</ErrorBoundary>
);
if (schema) {
return (
<ErrorBoundary FallbackComponent={ErrorInfo}>
<AdaptiveFormContext.Provider value={{ focusedTab, onFocusedTab, baseSchema: schema }}>
<FormTitle
formData={formData}
id={formData.$designer?.id || 'unknown'}
schema={schema}
uiOptions={uiOptions}
onChange={(newData) => onChange({ ...formData, ...newData })}
/>
<SchemaField
definitions={schema?.definitions}
depth={-1}
id={formData.$designer?.id ? `root[${formData.$designer?.id}]` : 'root'}
name="root"
rawErrors={errors}
schema={schema}
uiOptions={uiOptions}
value={formData}
onChange={onChange}
/>
</AdaptiveFormContext.Provider>
</ErrorBoundary>
);
}
return null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ describe('<CreationFlow/>', () => {
description: '',
location: expectedLocation,
name: 'EchoBot-1',
qnaKbUrls: undefined,
schemaUrl: '',
templateId: 'EchoBot',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('<CreateDialogModal/>', () => {
return renderWithRecoil(
<CreateDialogModal isOpen projectId={projectId} onDismiss={onDismissMock} onSubmit={onSubmitMock} />,
({ set }) => {
set(showCreateDialogModalState(projectId), true);
set(showCreateDialogModalState, true);
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ describe('<ProjectTree/>', () => {
const handleDeleteTrigger = jest.fn(() => {});

const { findByTestId } = renderWithRecoil(
<ProjectTree onDeleteDialog={handleDeleteDialog} onDeleteTrigger={handleDeleteTrigger} onSelect={handleSelect} />,
<ProjectTree
onBotDeleteDialog={handleDeleteDialog}
onDialogDeleteTrigger={handleDeleteTrigger}
onSelect={handleSelect}
/>,
initRecoilState
);
const node = await findByTestId('EchoBot-1_Greeting');
Expand Down
22 changes: 4 additions & 18 deletions Composer/packages/client/__tests__/components/projecttree.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,21 @@ const initRecoilStateMulti = ({ set }) => {

describe('<ProjectTree/>', () => {
it('should render the projecttree', async () => {
const { findByText } = renderWithRecoil(
<ProjectTree onDeleteDialog={() => {}} onDeleteTrigger={() => {}} onSelect={() => {}} />,
initRecoilState
);
const { findByText } = renderWithRecoil(<ProjectTree onSelect={() => {}} />, initRecoilState);

await findByText('EchoBot-1');
});

it('should render the projecttree with multiple bots', async () => {
const { findAllByText, findByText } = renderWithRecoil(
<ProjectTree onDeleteDialog={() => {}} onDeleteTrigger={() => {}} onSelect={() => {}} />,
initRecoilStateMulti
);
const { findAllByText, findByText } = renderWithRecoil(<ProjectTree onSelect={() => {}} />, initRecoilStateMulti);

await findAllByText('EchoBot-1');
await findByText('EchoBot-1b');
});

it('should handle project tree item click', async () => {
const mockFileSelect = jest.fn(() => null);
const component = renderWithRecoil(
<ProjectTree onDeleteDialog={() => {}} onDeleteTrigger={() => {}} onSelect={mockFileSelect} />,
initRecoilState
);
const component = renderWithRecoil(<ProjectTree onSelect={mockFileSelect} />, initRecoilState);

const node = await component.findByTestId('EchoBot-1_Greeting');
fireEvent.click(node);
Expand All @@ -75,12 +66,7 @@ describe('<ProjectTree/>', () => {
it('fires the onSelectAll event', async () => {
const mockOnSelected = jest.fn();
const { findByText } = renderWithRecoil(
<ProjectTree
onDeleteDialog={() => {}}
onDeleteTrigger={() => {}}
onSelect={() => {}}
onSelectAllLink={mockOnSelected}
/>,
<ProjectTree onSelect={() => {}} onSelectAllLink={mockOnSelected} />,
initRecoilState
);

Expand Down
18 changes: 5 additions & 13 deletions Composer/packages/client/__tests__/shell/triggerApi.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ const state = {
};

describe('use triggerApi hooks', () => {
let selectToMock, updateDialogMock, createLgTemplatesMock, createLuIntentMock, result;
let createTriggerMock, result;
beforeEach(() => {
selectToMock = jest.fn();
updateDialogMock = jest.fn();
createLgTemplatesMock = jest.fn();
createLuIntentMock = jest.fn();
createTriggerMock = jest.fn();

const initRecoilState = ({ set }) => {
set(currentProjectIdState, state.projectId);
Expand All @@ -61,10 +58,7 @@ describe('use triggerApi hooks', () => {
set(schemasState(state.projectId), state.schemas);
set(dispatcherState, (current: Dispatcher) => ({
...current,
selectTo: selectToMock,
updateDialog: updateDialogMock,
createLgTemplates: createLgTemplatesMock,
createLuIntent: createLuIntentMock,
createTrigger: createTriggerMock,
}));
};

Expand All @@ -89,9 +83,7 @@ describe('use triggerApi hooks', () => {
triggerPhrases: '',
};
await result.current.createTrigger(dialogId, formData);
expect(createLgTemplatesMock).toBeCalledTimes(1);
expect(updateDialogMock).toBeCalledTimes(1);
expect(createLgTemplatesMock).toBeCalledTimes(1);
expect(updateDialogMock).toBeCalledTimes(1);
const arg = [state.projectId, dialogId, formData, true];
expect(createTriggerMock).toBeCalledWith(...arg);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import { BotTemplate } from '@bfc/shared';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';
import { NeutralColors } from '@uifabric/fluent-theme';
import { RouteComponentProps } from '@reach/router';
import { useRecoilValue } from 'recoil';

import { DialogCreationCopy, EmptyBotTemplateId, QnABotTemplateId } from '../../constants';
import { creationFlowTypeState } from '../../recoilModel';

// -------------------- Styles -------------------- //

Expand Down Expand Up @@ -116,6 +118,8 @@ export function CreateOptions(props: CreateOptionsProps) {
const { templates, onDismiss, onNext } = props;
const [currentTemplate, setCurrentTemplate] = useState('');
const [emptyBotKey, setEmptyBotKey] = useState('');
const creationFlowType = useRecoilValue(creationFlowTypeState);

const selection = useMemo(() => {
return new Selection({
onSelectionChanged: () => {
Expand Down Expand Up @@ -252,20 +256,14 @@ export function CreateOptions(props: CreateOptionsProps) {
},
];

const choiceGroupTitle = creationFlowType === 'Skill' ? '' : formatMessage('Choose how to create your bot');
const dialogWrapperProps =
creationFlowType === 'Skill' ? DialogCreationCopy.CREATE_NEW_SKILLBOT : DialogCreationCopy.CREATE_NEW_BOT;

return (
<Fragment>
<DialogWrapper
isOpen
{...DialogCreationCopy.CREATE_NEW_BOT}
dialogType={DialogTypes.CreateFlow}
onDismiss={onDismiss}
>
<ChoiceGroup
label={formatMessage('Choose how to create your bot')}
options={choiceOptions}
selectedKey={option}
onChange={handleChange}
/>
<DialogWrapper isOpen {...dialogWrapperProps} dialogType={DialogTypes.CreateFlow} onDismiss={onDismiss}>
<ChoiceGroup label={choiceGroupTitle} options={choiceOptions} selectedKey={option} onChange={handleChange} />
<h3 css={listHeader}>{formatMessage('Examples')}</h3>
<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 @@ -112,15 +112,14 @@ const CreationFlow: React.FC<CreationFlowProps> = () => {
openProject(botFolder);
};

const handleCreateNew = async (formData, templateId: string, qnaKbUrls?: string[]) => {
const handleCreateNew = async (formData, templateId: string) => {
const newBotData = {
templateId: templateId || '',
name: formData.name,
description: formData.description,
location: formData.location,
schemaUrl: formData.schemaUrl,
appLocale,
qnaKbUrls,
templateDir: formData.templateDir,
eTag: formData.eTag,
urlSuffix: formData.urlSuffix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useRecoilValue } from 'recoil';
import { DialogCreationCopy, QnABotTemplateId, nameRegex } from '../../constants';
import { FieldConfig, useForm } from '../../hooks/useForm';
import { StorageFolder } from '../../recoilModel/types';
import { creationFlowTypeState } from '../../recoilModel';
import { createNotification } from '../../recoilModel/dispatchers/notification';
import { ImportSuccessNotificationWrapper } from '../ImportModal/ImportSuccessNotification';
import { dispatcherState } from '../../recoilModel';
Expand Down Expand Up @@ -102,6 +103,7 @@ const DefineConversation: React.FC<DefineConversationProps> = (props) => {
createFolder,
updateFolder,
} = props;
const creationFlowType = useRecoilValue(creationFlowTypeState);
const files = focusedStorageFolder?.children ?? [];
const writable = focusedStorageFolder.writable;
const getDefaultName = () => {
Expand Down Expand Up @@ -257,6 +259,13 @@ const DefineConversation: React.FC<DefineConversationProps> = (props) => {
updateField('location', location);
}, [focusedStorageFolder]);

const dialogWrapperProps =
creationFlowType === 'Skill'
? DialogCreationCopy.DEFINE_CONVERSATION_OBJECTIVE
: isImported
? DialogCreationCopy.IMPORT_BOT_PROJECT
: DialogCreationCopy.DEFINE_BOT_PROJECT;

const locationSelectContent = useMemo(() => {
return (
<LocationSelectContent
Expand All @@ -268,11 +277,10 @@ const DefineConversation: React.FC<DefineConversationProps> = (props) => {
/>
);
}, [focusedStorageFolder]);
const dialogCopy = isImported ? DialogCreationCopy.IMPORT_BOT_PROJECT : DialogCreationCopy.DEFINE_BOT_PROJECT;

return (
<Fragment>
<DialogWrapper isOpen {...dialogCopy} dialogType={DialogTypes.CreateFlow} onDismiss={onDismiss}>
<DialogWrapper isOpen {...dialogWrapperProps} dialogType={DialogTypes.CreateFlow} onDismiss={onDismiss}>
<form onSubmit={handleSubmit}>
<input style={{ display: 'none' }} type="submit" />
<Stack horizontal styles={stackinput} tokens={{ childrenGap: '2rem' }}>
Expand Down
Loading