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
123 commits
Select commit Hold shift + click to select a range
2b3b476
add import endpoint
benbrown May 27, 2020
8c1281a
ne dependency
benbrown May 27, 2020
1550e33
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown May 27, 2020
d1b4c43
t pushMerge branch 'master' of github.com:microsoft/BotFramework-Comp…
benbrown May 29, 2020
2451a27
add support for getting a github project
benbrown Jun 11, 2020
c7b7660
allow import from github
benbrown Jun 12, 2020
93e0893
fix issue with internal reference
benbrown Jun 12, 2020
945f3cb
add support for nuget packages
benbrown Jun 12, 2020
09d63c0
new deps
benbrown Jun 22, 2020
87bc3a2
Merge branch 'main' of github.com:microsoft/BotFramework-Composer int…
benbrown Jul 14, 2020
584f77e
semi-functional UI for importing assets from the web, some error chec…
benbrown Jul 15, 2020
c60d8ac
Ability to add, update, remove declarative libraries
benbrown Jul 20, 2020
fdc43a7
allow plugins to provide assets to appear in the library
benbrown Jul 20, 2020
3d82601
remove add route
benbrown Jul 20, 2020
e3b2ec1
sample libs
benbrown Jul 22, 2020
edcaff0
merge main, refactor for recoil
benbrown Jul 24, 2020
d6b1d1a
additional error handling
benbrown Jul 24, 2020
9fd3891
Merge branch 'main' of github.com:microsoft/BotFramework-Composer int…
benbrown Jul 28, 2020
ede3e7f
Merge branch 'main' of github.com:microsoft/BotFramework-Composer int…
benbrown Jul 28, 2020
8225aa9
allow categories of available libraries
benbrown Jul 28, 2020
9920b16
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 7, 2020
2c72222
implement package manipulation using bf cli
benbrown Oct 12, 2020
3e50990
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 13, 2020
56a2d16
functioning install from npm or nuget
benbrown Oct 13, 2020
2739329
exlcude version flag if not specified
benbrown Oct 13, 2020
176d354
update to latest bf-dialog
benbrown Oct 15, 2020
c9c59a5
fix typos
benbrown Oct 19, 2020
171dae3
specify path to schema
benbrown Oct 19, 2020
64e9a34
add confirmation if the merge process detects a conflict
benbrown Oct 19, 2020
58d3599
detect ejected
benbrown Oct 19, 2020
b677afd
Merge branch 'main' into benbrown/importfromweb
a-b-r-o-w-n Oct 19, 2020
0c34d67
update lockfile
a-b-r-o-w-n Oct 19, 2020
e30065c
wrap test controller in editor extension
a-b-r-o-w-n Oct 19, 2020
a044f01
[wip] move asset library into extension
a-b-r-o-w-n Oct 20, 2020
637c427
move some components into ui-shared
a-b-r-o-w-n Oct 20, 2020
74e5801
add more apis to extension client
a-b-r-o-w-n Oct 20, 2020
cb781c6
add fabric to window
a-b-r-o-w-n Oct 20, 2020
62cdc23
fix build script
a-b-r-o-w-n Oct 20, 2020
640ce1f
disable if not ejected
benbrown Oct 20, 2020
e038c9a
do not show installed list when disabled
benbrown Oct 20, 2020
864088a
Merge remote-tracking branch 'origin/abrown/asset-library-extension' …
benbrown Oct 21, 2020
5f74387
exit with error if error in any extensions
a-b-r-o-w-n Oct 21, 2020
3596ce6
add navigateTo to application context
a-b-r-o-w-n Oct 21, 2020
12f83f6
Merge branch 'abrown/asset-library-extension' of https://github.com/m…
benbrown Oct 21, 2020
89aa2e3
move asset library wholy into its own extension~
benbrown Oct 21, 2020
5b6da64
use results of import/remove to update the ui instead of reprocessing
benbrown Oct 22, 2020
e5c7fa8
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 22, 2020
15edffc
merge master
benbrown Oct 22, 2020
6f61410
add confirm api to application context
a-b-r-o-w-n Oct 22, 2020
3879238
use the confirm api
a-b-r-o-w-n Oct 22, 2020
fefd311
fix types resolution for sample-ui-plugin
a-b-r-o-w-n Oct 22, 2020
be69db7
add recently used list to the asset library
benbrown Oct 23, 2020
e03c4d3
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 23, 2020
284ec64
remove old version of library files
benbrown Oct 23, 2020
3e15545
aggregate all the UI strings at the top for ease of editing
benbrown Oct 23, 2020
09e4831
fix test
benbrown Oct 23, 2020
7ca0fcb
add key field to default config
benbrown Oct 23, 2020
bb16bdd
show only compatible packages
benbrown Oct 23, 2020
9de9327
add missing field to test file
benbrown Oct 26, 2020
4573a33
yarn file
benbrown Oct 26, 2020
e9b8efd
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 26, 2020
580ce41
finish merge
benbrown Oct 26, 2020
ef5e81e
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 26, 2020
a97035b
Merge branch 'main' into benbrown/importfromweb
benbrown Oct 26, 2020
09c96ad
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 26, 2020
08a262a
refactor ui to use tabs
benbrown Oct 26, 2020
27267c8
Merge branch 'benbrown/importfromweb' of https://github.com/microsoft…
benbrown Oct 26, 2020
56cbb0c
learn more links
benbrown Oct 26, 2020
5b64b48
add readme
benbrown Oct 26, 2020
398b06f
readme updates
benbrown Oct 27, 2020
74412c8
readme updates
benbrown Oct 27, 2020
2c3b12e
extract a few ui strings
benbrown Oct 27, 2020
c8d1be0
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 27, 2020
19a82bb
more readme
benbrown Oct 28, 2020
c18990c
more readme
benbrown Oct 28, 2020
b710366
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 28, 2020
4304d7b
latest rc
benbrown Oct 28, 2020
73693dc
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Oct 30, 2020
002c30a
add key to runtime settings
a-b-r-o-w-n Oct 30, 2020
b00fa01
move extension context to server package
a-b-r-o-w-n Oct 30, 2020
27aa43b
update ExtensionContext imports
a-b-r-o-w-n Oct 30, 2020
7e7b6ad
pass extension context to ext manager
a-b-r-o-w-n Oct 30, 2020
9c56184
fix server launch config
a-b-r-o-w-n Oct 30, 2020
8119ad1
move extension manager to server
a-b-r-o-w-n Oct 30, 2020
a120871
do not update lockfiles when building extensions
a-b-r-o-w-n Oct 30, 2020
5f0dcd3
do not pass extension context when loading
a-b-r-o-w-n Oct 30, 2020
b910413
remove unused import
a-b-r-o-w-n Oct 31, 2020
dcf8413
Merge branch 'main' into abrown/ext-context
a-b-r-o-w-n Nov 2, 2020
27dfd61
fix typescript error
a-b-r-o-w-n Nov 2, 2020
30498e4
fix test failure
a-b-r-o-w-n Nov 2, 2020
ad37aa9
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Nov 2, 2020
0f55dec
Merge branch 'benbrown/importfromweb' into abrown/ext-context
a-b-r-o-w-n Nov 2, 2020
6bc13d8
add missing type imports
a-b-r-o-w-n Nov 2, 2020
20b70f4
remove duplicate property
a-b-r-o-w-n Nov 2, 2020
32ce7c3
Merge branch 'benbrown/importfromweb' into abrown/ext-context
a-b-r-o-w-n Nov 2, 2020
75e3c81
remove obsolete api
a-b-r-o-w-n Nov 2, 2020
d12d94f
Merge branch 'abrown/ext-context' into benbrown/importfromweb
benbrown Nov 2, 2020
0bd197b
add ExtensionRegistration type
a-b-r-o-w-n Nov 2, 2020
193f799
update extension references to ExtensionRegistration
a-b-r-o-w-n Nov 2, 2020
2a3cfef
pass dataDir to registration
a-b-r-o-w-n Nov 2, 2020
64cbe7f
use axios library instead of @types
a-b-r-o-w-n Nov 2, 2020
91bdd7a
use same version of axios in types and client
a-b-r-o-w-n Nov 3, 2020
a0e2c13
Merge branch 'abrown/ext-context' of https://github.com/microsoft/Bot…
benbrown Nov 3, 2020
01559c7
Merge branch 'main' into benbrown/importfromweb
benbrown Nov 3, 2020
f96aef5
Update readme.md
Nov 4, 2020
300e86a
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Nov 12, 2020
4749117
fix issue with extensions
benbrown Nov 12, 2020
5f5e23b
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Nov 13, 2020
4072b33
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Nov 13, 2020
9aa47a5
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Nov 17, 2020
9b59e7a
small adjustments due to extension boundary change
benbrown Nov 17, 2020
99630fb
fix test
benbrown Nov 17, 2020
ebc0516
remove some unused code
benbrown Nov 17, 2020
f6d0965
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Nov 18, 2020
4de22d9
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Nov 18, 2020
96fa96f
move strings into component. add types to internal state.
benbrown Nov 18, 2020
915005e
Add cards to list of package features
benbrown Nov 18, 2020
aee8fbc
add instructions for using a JS custom action
benbrown Nov 18, 2020
3b17fd5
add typing for telemetry setting
benbrown Nov 18, 2020
0d1ff91
remove mocked enum
benbrown Nov 18, 2020
c186e04
Merge branch 'main' into benbrown/importfromweb
a-b-r-o-w-n Nov 19, 2020
4169efc
fix main js
benbrown Nov 19, 2020
736ed73
Merge branch 'benbrown/importfromweb' of https://github.com/microsoft…
benbrown Nov 19, 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
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"type": "node",
"request": "launch",
"name": "Server: Launch",
"args": ["./build/init.js"],
"program": "${workspaceFolder}/Composer/packages/server/src/init.ts",
"env": {
"DEBUG": ""
"DEBUG": "composer*"
},
"restart": true,
"outFiles": ["./build/*"],
"outFiles": ["${workspaceFolder}/Composer/packages/server/build/**/*.js"],
"preLaunchTask": "server: build",
"outputCapture": "std",
"cwd": "${workspaceFolder}/Composer/packages/server"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const useEditorEventApi = (
break;
case NodeEventTypes.OpenDialog:
handler = ({ callee }) => {
navTo(callee, '"beginDialog"');
navTo(callee);
announce(ScreenReaderMessage.DialogOpened);
};
break;
Expand Down
3 changes: 2 additions & 1 deletion Composer/packages/client/__tests__/components/home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

import * as React from 'react';
import { fireEvent, render } from '@botframework-composer/test-utils';
import { Toolbar } from '@bfc/ui-shared';
import { BotTemplate } from '@bfc/shared';

import { RecentBotList } from '../../src/pages/home/RecentBotList';
import { ExampleList } from '../../src/pages/home/ExampleList';
import { renderWithRecoil } from '../testUtils';
import { Toolbar } from '../../src/components/Toolbar';

describe('<Home/>', () => {
it('should dispatch onSelectionChanged event when clicked on a link on <RecentBotList>', () => {
const recentProjects = [
Expand Down
2 changes: 0 additions & 2 deletions Composer/packages/client/__tests__/components/skill.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import Skills from '../../src/pages/skills';

jest.mock('../../src//utils/httpUtil');

jest.mock('../../src/components/Modal/dialogStyle', () => ({}));

const skills: Skill[] = [
{
id: 'email-skill',
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@uifabric/icons": "^7.3.59",
"@uifabric/react-hooks": "^7.4.12",
"@uifabric/styling": "^7.13.7",
"axios": "^0.19.2",
"axios": "^0.21.0",
"babel-plugin-extract-format-message": "^6.2.3",
"format-message": "^6.2.3",
"format-message-generate-id": "^6.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = (props) => {
);
};

export const OpenConfirmModal = (title, subTitle, setting = {}) => {
export const OpenConfirmModal = (title, subTitle, setting = {}): Promise<boolean> => {
return new Promise((resolve) => {
const node = document.createElement('div');
document.body.appendChild(node);
const removeNode = () => {
ReactDOM.unmountComponentAtNode(node);
node.remove();
};

const onConfirm = () => {
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/src/components/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import { jsx, css } from '@emotion/core';
import React from 'react';
import { FontWeights, FontSizes } from 'office-ui-fabric-react/lib/Styling';
import { Toolbar, IToolbarItem } from '@bfc/ui-shared';

import { LeftRightSplit } from '../components/Split/LeftRightSplit';

import { Toolbar, IToolbarItem } from './Toolbar';
import { NavTree, INavTreeItem } from './NavTree';

// -------------------- Styles -------------------- //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

/** @jsx jsx */

import React, { useState, useRef, Fragment, useEffect, useCallback } from 'react';
import React, { useState, useRef, Fragment, useEffect, useCallback, useMemo } from 'react';
import { jsx, css } from '@emotion/core';
import { PrimaryButton } from 'office-ui-fabric-react/lib/Button';
import formatMessage from 'format-message';
import { useRecoilValue } from 'recoil';
import { IConfig, IPublishConfig, defaultPublishConfig, checkForPVASchema } from '@bfc/shared';
import { EditorExtension, PluginConfig, mergePluginConfigs } from '@bfc/extension-client';

import {
botEndpointsState,
Expand All @@ -27,6 +28,8 @@ import { BotStatus } from '../../constants';
import { isAbsHosted } from '../../utils/envUtil';
import useNotifications from '../../pages/notifications/useNotifications';
import { navigateTo, openInEmulator } from '../../utils/navigation';
import plugins from '../../plugins';
import { useShell } from '../../shell/useShell';

import { isBuildConfigComplete, needsBuild } from './../../utils/buildUtil';
import { PublishDialog } from './publishDialog';
Expand All @@ -53,7 +56,7 @@ let botStatusInterval: NodeJS.Timeout | undefined = undefined;

// -------------------- TestController -------------------- //
const POLLING_INTERVAL = 2500;
export const TestController: React.FC<{ projectId: string }> = (props) => {
export const TestControllerContent: React.FC<{ projectId: string }> = (props) => {
const { projectId = '' } = props;
const [modalOpen, setModalOpen] = useState(false);
const [calloutVisible, setCalloutVisible] = useState(false);
Expand Down Expand Up @@ -287,3 +290,20 @@ export const TestController: React.FC<{ projectId: string }> = (props) => {
</Fragment>
);
};

export const TestController: React.FC<{ projectId: string }> = (props) => {
const schemas = useRecoilValue(schemasState(props.projectId));
const shellForPropertyEditor = useShell('DesignPage', props.projectId);

const pluginConfig: PluginConfig = useMemo(() => {
const sdkUISchema = schemas?.ui?.content ?? {};
const userUISchema = schemas?.uiOverrides?.content ?? {};
return mergePluginConfigs({ uiSchema: sdkUISchema }, plugins, { uiSchema: userUISchema });
}, [schemas?.ui?.content, schemas?.uiOverrides?.content]);

return (
<EditorExtension plugins={pluginConfig} projectId={props.projectId} shell={shellForPropertyEditor}>
<TestControllerContent {...props} />
</EditorExtension>
Comment thread
a-b-r-o-w-n marked this conversation as resolved.
);
};
2 changes: 1 addition & 1 deletion Composer/packages/client/src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { Icon } from 'office-ui-fabric-react/lib/Icon';
import { RouteComponentProps } from '@reach/router';
import { navigate } from '@reach/router';
import { useRecoilValue } from 'recoil';
import { Toolbar, IToolbarItem } from '@bfc/ui-shared';

import { CreationFlowStatus } from '../../constants';
import { dispatcherState, botDisplayNameState, filteredTemplatesSelector } from '../../recoilModel';
import { recentProjectsState, templateIdState, currentProjectIdState } from '../../recoilModel/atoms/appState';
import { Toolbar, IToolbarItem } from '../../components/Toolbar';

import * as home from './styles';
import { ItemContainer } from './ItemContainer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import { jsx } from '@emotion/core';
import { useState } from 'react';
import { RouteComponentProps } from '@reach/router';
import { Toolbar } from '@bfc/ui-shared';

import { Toolbar } from '../../components/Toolbar';
import { navigateTo } from '../../utils/navigation';
import { convertPathToUrl } from '../../utils/navigation';

Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/src/pages/publish/Publish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Dialog, DialogType } from 'office-ui-fabric-react/lib/Dialog';
import { TextField } from 'office-ui-fabric-react/lib/TextField';
import { PublishTarget } from '@bfc/shared';
import { useRecoilValue } from 'recoil';
import { Toolbar, IToolbarItem } from '@bfc/ui-shared';

import { LeftRightSplit } from '../../components/Split/LeftRightSplit';
import settingsStorage from '../../utils/dialogSettingStorage';
Expand All @@ -22,7 +23,6 @@ import {
publishHistoryState,
} from '../../recoilModel';
import { navigateTo } from '../../utils/navigation';
import { Toolbar, IToolbarItem } from '../../components/Toolbar';
import { OpenConfirmModal } from '../../components/Modal/ConfirmDialog';

import { TargetList } from './targetList';
Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/client/src/pages/publish/pullDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const PullDialog: React.FC<PullDialogProps> = (props) => {
const { onDismiss, projectId, selectedTarget } = props;
const [status, setStatus] = useState<PullDialogStatus>('connecting');
const [error, setError] = useState<string>('');
const { addNotification, reloadExistingProject } = useRecoilValue(dispatcherState);
const { addNotification, reloadProject } = useRecoilValue(dispatcherState);
const botLocation = useRecoilValue(locationState(projectId));

const pull = useCallback(() => {
Expand All @@ -56,7 +56,7 @@ export const PullDialog: React.FC<PullDialogProps> = (props) => {
});
addNotification(notification);
// reload the bot project to update the authoring canvas
reloadExistingProject(projectId);
reloadProject(projectId);
onDismiss();
return;
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { RouteComponentProps } from '@reach/router';
import { FontIcon } from 'office-ui-fabric-react/lib/Icon';
import { Text } from 'office-ui-fabric-react/lib/Text';
import { useRecoilValue } from 'recoil';
import { IToolbarItem } from '@bfc/ui-shared';

import {
dispatcherState,
Expand All @@ -24,7 +25,6 @@ import { navigateTo } from '../../utils/navigation';
import { Page } from '../../components/Page';
import { INavTreeItem } from '../../components/NavTree';
import { useLocation } from '../../utils/hooks';
import { IToolbarItem } from '../../components/Toolbar';
import { AddLanguageModal, DeleteLanguageModal } from '../../components/MultiLanguage/index';
import { useProjectIdCache } from '../../utils/hooks';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import formatMessage from 'format-message';
import { useRecoilValue, selector } from 'recoil';
import { NeutralColors } from '@uifabric/fluent-theme';
import { ExtensionMetadata, ExtensionSearchResult } from '@bfc/extension-client';
import { Toolbar, IToolbarItem } from '@bfc/ui-shared';

import { Toolbar, IToolbarItem } from '../../../components/Toolbar';
import { dispatcherState, extensionsState } from '../../../recoilModel';

import { InstallExtensionDialog } from './InstallExtensionDialog';
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/src/pages/skills/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import React, { useCallback, useState } from 'react';
import formatMessage from 'format-message';
import { useRecoilValue } from 'recoil';
import { SkillSetting } from '@bfc/shared';
import { Toolbar, IToolbarItem } from '@bfc/ui-shared';

import { dispatcherState, settingsState, botDisplayNameState } from '../../recoilModel';
import { Toolbar, IToolbarItem } from '../../components/Toolbar';
import { TestController } from '../../components/TestController/TestController';
import { CreateSkillModal } from '../../components/CreateSkillModal';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const settings = {
environment: 'composer',
},
publishTargets: [],
importedLibraries: [],
qna: {
knowledgebaseid: '',
endpointKey: '',
Expand All @@ -63,6 +64,7 @@ const settings = {
customRuntime: false,
path: '',
command: '',
key: '',
},
downsampling: {
maxImbalanceRatio: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const formDialogsDispatcher = () => {
const response = await httpClient.post(`/formDialogs/${projectId}/generate`, {
name: schemaId,
});
await reloadProject(callbackHelpers, response);
await reloadProject(response.data.id);
} catch (error) {
set(applicationErrorState, {
message: error.message,
Expand All @@ -99,8 +99,8 @@ export const formDialogsDispatcher = () => {
return;
}

const response = await httpClient.delete(`/formDialogs/${projectId}/${dialogId}`);
await reloadProject(callbackHelpers, response);
await httpClient.delete(`/formDialogs/${projectId}/${dialogId}`);
await reloadProject(projectId);
} catch (error) {
set(applicationErrorState, {
message: error.message,
Expand Down
10 changes: 1 addition & 9 deletions Composer/packages/client/src/recoilModel/dispatchers/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,8 @@ export const projectDispatcher = () => {
}
});

const reloadProject = async (callbackHelpers: CallbackInterface, response: any) => {
callbackHelpers.reset(filePersistenceState(response.data.id));
const { projectData, botFiles } = loadProjectData(response.data);

await initBotState(callbackHelpers, projectData, botFiles);
};

/** Resets the file persistence of a project, and then reloads the bot state. */
const reloadExistingProject = useRecoilCallback((callbackHelpers: CallbackInterface) => async (projectId: string) => {
const reloadProject = useRecoilCallback((callbackHelpers: CallbackInterface) => async (projectId: string) => {
callbackHelpers.reset(filePersistenceState(projectId));
const { projectData, botFiles } = await fetchProjectDataById(projectId);
await initBotState(callbackHelpers, projectData, botFiles);
Expand Down Expand Up @@ -490,7 +483,6 @@ export const projectDispatcher = () => {
addRemoteSkillToBotProject,
replaceSkillInBotProject,
reloadProject,
reloadExistingProject,
updateCreationMessage,
};
};
12 changes: 11 additions & 1 deletion Composer/packages/client/src/recoilModel/dispatchers/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable react-hooks/rules-of-hooks */

import { CallbackInterface, useRecoilCallback } from 'recoil';
import { SensitiveProperties, DialogSetting, PublishTarget, Skill } from '@bfc/shared';
import { SensitiveProperties, DialogSetting, PublishTarget, Skill, LibraryRef } from '@bfc/shared';
import { skillIndexer } from '@bfc/indexers';
import get from 'lodash/get';
import has from 'lodash/has';
Expand Down Expand Up @@ -91,6 +91,15 @@ export const settingsDispatcher = () => {
}
);

const setImportedLibraries = useRecoilCallback(
({ set }: CallbackInterface) => async (projectId: string, importedLibraries: LibraryRef[]) => {
set(settingsState(projectId), (currentSettingsState) => ({
...currentSettingsState,
importedLibraries,
}));
}
);

const setRuntimeField = useRecoilCallback(
({ set }: CallbackInterface) => async (projectId: string, field: string, newValue: boolean) => {
set(settingsState(projectId), (currentValue) => ({
Expand Down Expand Up @@ -134,6 +143,7 @@ export const settingsDispatcher = () => {
setRuntimeSettings,
setPublishTargets,
setRuntimeField,
setImportedLibraries,
setCustomRuntime,
setQnASettings,
};
Expand Down
19 changes: 16 additions & 3 deletions Composer/packages/client/src/shell/useShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import {
rootBotProjectIdSelector,
} from '../recoilModel';
import { undoFunctionState } from '../recoilModel/undo/history';
import httpClient from '../utils/httpUtil';
import { navigateTo } from '../utils/navigation';
import { OpenConfirmModal } from '../components/Modal/ConfirmDialog';

import { useLgApi } from './lgApi';
import { useLuApi } from './luApi';
Expand Down Expand Up @@ -98,6 +101,8 @@ export function useShell(source: EventSource, projectId: string): Shell {
displayManifestModal,
updateSkill,
updateZoomRate,
reloadProject,
setApplicationLevelError,
} = useRecoilValue(dispatcherState);

const lgApi = useLgApi(projectId);
Expand Down Expand Up @@ -226,20 +231,26 @@ export function useShell(source: EventSource, projectId: string): Shell {
undo,
redo,
commitChanges,
addCoachMarkRef: onboardingAddCoachMarkRef,
updateUserSettings,
announce: setMessage,
displayManifestModal: (skillId) => displayManifestModal(skillId, projectId),
updateDialogSchema: async (dialogSchema: DialogSchemaFile) => {
updateDialogSchema(dialogSchema, projectId);
},
updateSkillSetting: (...params) => updateSkill(projectId, ...params),
updateFlowZoomRate,
reloadProject: () => reloadProject(projectId),
...lgApi,
...luApi,
...qnaApi,
...triggerApi,
...actionApi,

// application context
addCoachMarkRef: onboardingAddCoachMarkRef,
announce: setMessage,
navigateTo,
setApplicationLevelError,
updateUserSettings,
confirm: OpenConfirmModal,
};

const currentDialog = useMemo(() => dialogs.find((d) => d.id === dialogId) ?? stubDialog(), [
Expand Down Expand Up @@ -277,6 +288,8 @@ export function useShell(source: EventSource, projectId: string): Shell {
skills,
skillsSettings: settings.skill || {},
flowZoomRate,
settings,
httpClient,
};

return {
Expand Down
Loading