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
38 commits
Select commit Hold shift + click to select a range
8d4a9f6
Adding va core template plug in with corresponding plugin build steps
pavolumMsft Sep 15, 2020
bd78386
Adding env variable feature flag around VA=Core template
pavolumMsft Sep 15, 2020
e46cb29
removing unused code that was initially added for custom runtime whic…
pavolumMsft Sep 15, 2020
dc389e5
Merge branch 'main' into pavolum/va-template
pavolumMsft Sep 15, 2020
c8247bc
Added creation UI workspace which is linked to and referenced from cl…
pavolumMsft Sep 16, 2020
1a61ef4
Minor styling changes
pavolumMsft Sep 17, 2020
6a7da65
Cleaning up code for review:
pavolumMsft Sep 17, 2020
ce38062
Merge branch 'main' into pavolum/va-template
pavolumMsft Sep 17, 2020
2df9855
Merging latest
pavolumMsft Sep 17, 2020
f1678c7
Cleaning up unused changes
pavolumMsft Sep 17, 2020
0f02f8c
removing bot type tile
pavolumMsft Sep 18, 2020
271ed3f
removing bot type tile
pavolumMsft Sep 18, 2020
c488301
Making requested PR changes, general clean up, conversion of interfac…
pavolumMsft Sep 22, 2020
51df024
Converting props types to intersaction with reach router, adding awai…
pavolumMsft Sep 23, 2020
e9c39bf
Fixing files to follow repoo linting rules
pavolumMsft Oct 1, 2020
4643735
Changed post creation logic to execute on useEffect as opposed to rel…
pavolumMsft Oct 1, 2020
6fabb60
resolve reentry bug
pavolumMsft Oct 1, 2020
d4d46e8
removing unused function
pavolumMsft Oct 1, 2020
3e65229
Fixing linting errors
pavolumMsft Oct 1, 2020
884032b
resolve reentry bug
pavolumMsft Oct 1, 2020
ff4de94
Merge branch 'main' into pavolum/va-template
pavolumMsft Oct 6, 2020
e4312bd
Pulling latest from main
pavolumMsft Oct 6, 2020
8774906
Fixing reference
pavolumMsft Oct 7, 2020
f51e8ed
Updating react version in creation extension
pavolumMsft Oct 7, 2020
9a50176
Updating react version in creation extension
pavolumMsft Oct 7, 2020
c348192
Making PR changes
pavolumMsft Oct 7, 2020
7f5911b
Fixed non static formatMessage calls
pavolumMsft Oct 8, 2020
fd39d61
minor syntax refactoring
pavolumMsft Oct 8, 2020
7bcaa36
Refactoring state management for more modular state.
pavolumMsft Oct 8, 2020
7f2c10e
Making additional state management changes for better readability and…
pavolumMsft Oct 8, 2020
1b7d47f
Fixing file naming
pavolumMsft Oct 9, 2020
a5710e7
Merging from master
pavolumMsft Oct 12, 2020
55e3afe
Formatting template strings for localization
pavolumMsft Oct 12, 2020
eb1c3e2
Merging from latest in va-template branch
pavolumMsft Oct 12, 2020
b92a9c2
Merge branch 'main' into pavolum/va-creation-ui
pavolum Oct 12, 2020
8c571b1
changing ReachRouter version dpendency to match client reach/router v…
pavolumMsft Oct 12, 2020
26dea81
update Azure Publish yarn.lock
pavolumMsft Oct 12, 2020
d18bd02
Updating reach router version and tamplate name
pavolumMsft Oct 12, 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

import React from 'react';
import { render } from '@bfc/test-utils';

import { DialogWrapper, DialogTypes } from '../../../src/components/DialogWrapper';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';

describe('<DialogWrapper />', () => {
const props = {
Expand Down
2 changes: 2 additions & 0 deletions Composer/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@bfc/extension-client": "*",
"@bfc/indexers": "*",
"@bfc/shared": "*",
"@bfc/ui-shared": "*",
"@bfc/ui-plugin-composer": "*",
"@bfc/ui-plugin-cross-trained": "*",
"@bfc/ui-plugin-dialog-schema-editor": "*",
Expand All @@ -33,6 +34,7 @@
"@bfc/ui-plugin-prompts": "*",
"@bfc/ui-plugin-select-dialog": "*",
"@bfc/ui-plugin-select-skill-dialog": "*",
"@bfc/ui-plugin-va-creation": "*",
"@emotion/core": "^10.0.27",
"@reach/router": "^1.2.1",
"@uifabric/fluent-theme": "^7.1.107",
Expand Down
14 changes: 14 additions & 0 deletions Composer/packages/client/public/react-bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/** @license React v16.13.1
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
23 changes: 23 additions & 0 deletions Composer/packages/client/public/react-dom-bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/** @license React v0.19.1
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v16.13.1
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
3 changes: 1 addition & 2 deletions Composer/packages/client/src/components/CreateSkillModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import { TextField } from 'office-ui-fabric-react/lib/TextField';
import { useRecoilValue } from 'recoil';
import debounce from 'lodash/debounce';
import { SkillSetting } from '@bfc/shared';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';

import { addSkillDialog } from '../constants';
import httpClient from '../utils/httpUtil';
import { skillsState } from '../recoilModel';

import { DialogWrapper, DialogTypes } from './DialogWrapper';

export interface SkillFormDataErrors {
endpoint?: string;
manifestUrl?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import {
} from 'office-ui-fabric-react/lib/DetailsList';
import { Sticky, StickyPositionType } from 'office-ui-fabric-react/lib/Sticky';
import { ProjectTemplate } from '@bfc/shared';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';
import { NeutralColors } from '@uifabric/fluent-theme';

import { DialogCreationCopy, EmptyBotTemplateId, QnABotTemplateId } from '../../constants';
import { DialogWrapper, DialogTypes } from '../DialogWrapper';

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

Expand Down
108 changes: 70 additions & 38 deletions Composer/packages/client/src/components/CreationFlow/CreationFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
// TODO: Remove path module
import Path from 'path';

import React, { useEffect, useRef, Fragment, useState } from 'react';
import React, { useEffect, useRef, Fragment, useState, useMemo } from 'react';
import { RouteComponentProps, Router, navigate } from '@reach/router';
import { useRecoilValue } from 'recoil';
import VirtualAssistantCreationModal from '@bfc/ui-plugin-va-creation';
import { PluginConfig, mergePluginConfigs, EditorExtension } from '@bfc/extension-client';

import { CreationFlowStatus } from '../../constants';
import {
Expand All @@ -22,6 +24,8 @@ import Home from '../../pages/home/Home';
import ImportQnAFromUrlModal from '../../pages/knowledge-base/ImportQnAFromUrlModal';
import { QnABotTemplateId } from '../../constants';
import { useProjectIdCache } from '../../utils/hooks';
import { useShell } from '../../shell';
import plugins from '../../plugins';

import { CreateOptions } from './CreateOptions';
import { OpenProject } from './OpenProject';
Expand Down Expand Up @@ -56,8 +60,8 @@ const CreationFlow: React.FC<CreationFlowProps> = () => {
const currentStorageIndex = useRef(0);
const storage = storages[currentStorageIndex.current];
const currentStorageId = storage ? storage.id : 'default';
const [formData, setFormData] = useState({ name: '' });

const [formData, setFormData] = useState({ name: '', description: '', location: '' });
const shellForCreation = useShell('VaCreation', projectId);
useEffect(() => {
if (storages && storages.length) {
const storageId = storage.id;
Expand All @@ -67,6 +71,13 @@ const CreationFlow: React.FC<CreationFlowProps> = () => {
}
}, [storages]);

// Plugin config for VA creation plug in
const pluginConfig: PluginConfig = useMemo(() => {
const sdkUISchema = {};
const userUISchema = {};
return mergePluginConfigs({ uiSchema: sdkUISchema }, plugins, { uiSchema: userUISchema });
}, []);

const fetchResources = async () => {
// fetchProject use `gotoSnapshot` which will wipe out all state value.
// so here make those methods call in sequence.
Expand Down Expand Up @@ -125,12 +136,20 @@ const CreationFlow: React.FC<CreationFlowProps> = () => {
handleCreateNew(formData, QnABotTemplateId, urls);
};

const handleSubmitOrImportQnA = async (formData, templateId: string) => {
const handleDefineConversationSubmit = async (formData, templateId: string) => {
// If selected template is qnaSample then route to QNA import modal
if (templateId === 'QnASample') {
setFormData(formData);
navigate(`./QnASample/importQnA`);
return;
}
// If selected template is vaCore then route to VA Customization modal
if (templateId === 'va-core') {
setFormData(formData);
navigate(`./vaCore/customize`);
return;
}

handleSubmit(formData, templateId);
};

Expand All @@ -155,40 +174,53 @@ const CreationFlow: React.FC<CreationFlowProps> = () => {
return (
<Fragment>
<Home />
<Router>
<DefineConversation
createFolder={createFolder}
focusedStorageFolder={focusedStorageFolder}
path="create/:templateId"
updateFolder={updateFolder}
onCurrentPathUpdate={updateCurrentPath}
onDismiss={handleDismiss}
onSubmit={handleSubmitOrImportQnA}
/>
<CreateOptions path="create" templates={templateProjects} onDismiss={handleDismiss} onNext={handleCreateNext} />
<DefineConversation
createFolder={createFolder}
focusedStorageFolder={focusedStorageFolder}
path=":projectId/:templateId/save"
updateFolder={updateFolder}
onCurrentPathUpdate={updateCurrentPath}
onDismiss={handleDismiss}
onSubmit={handleSubmitOrImportQnA}
/>
<OpenProject
focusedStorageFolder={focusedStorageFolder}
path="open"
onCurrentPathUpdate={updateCurrentPath}
onDismiss={handleDismiss}
onOpen={openBot}
/>
<ImportQnAFromUrlModal
dialogId={formData.name.toLowerCase()}
path="create/QnASample/importQnA"
onDismiss={handleDismiss}
onSubmit={handleCreateQnA}
/>
</Router>
<EditorExtension plugins={pluginConfig} projectId={projectId} shell={shellForCreation}>
<Router>
<DefineConversation
createFolder={createFolder}
focusedStorageFolder={focusedStorageFolder}
path="create/:templateId"
updateFolder={updateFolder}
onCurrentPathUpdate={updateCurrentPath}
onDismiss={handleDismiss}
onSubmit={handleDefineConversationSubmit}
/>
<CreateOptions
path="create"
templates={templateProjects}
onDismiss={handleDismiss}
onNext={handleCreateNext}
/>
<DefineConversation
createFolder={createFolder}
focusedStorageFolder={focusedStorageFolder}
path=":projectId/:templateId/save"
updateFolder={updateFolder}
onCurrentPathUpdate={updateCurrentPath}
onDismiss={handleDismiss}
onSubmit={handleDefineConversationSubmit}
/>
<OpenProject
focusedStorageFolder={focusedStorageFolder}
path="open"
onCurrentPathUpdate={updateCurrentPath}
onDismiss={handleDismiss}
onOpen={openBot}
/>
<ImportQnAFromUrlModal
dialogId={formData.name.toLowerCase()}
path="create/QnASample/importQnA"
onDismiss={handleDismiss}
onSubmit={handleCreateQnA}
/>
<VirtualAssistantCreationModal
formData={formData}
handleCreateNew={handleCreateNew}
path="create/vaCore/*"
onDismiss={handleDismiss}
/>
</Router>
</EditorExtension>
</Fragment>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { TextField } from 'office-ui-fabric-react/lib/TextField';
import { RouteComponentProps } from '@reach/router';
import querystring from 'query-string';
import { FontWeights } from '@uifabric/styling';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';

import { DialogCreationCopy, QnABotTemplateId, nameRegex } from '../../constants';
import { DialogWrapper, DialogTypes } from '../DialogWrapper';
import { FieldConfig, useForm } from '../../hooks/useForm';
import { StorageFolder } from '../../recoilModel/types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { DialogFooter } from 'office-ui-fabric-react/lib/Dialog';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
import formatMessage from 'format-message';
import { RouteComponentProps } from '@reach/router';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';

import { StorageFolder } from '../../recoilModel/types';
import { DialogCreationCopy } from '../../constants';
import { DialogWrapper, DialogTypes } from '../DialogWrapper';

import { LocationSelectContent } from './LocationSelectContent';
interface OpenProjectProps extends RouteComponentProps<{}> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { Stack, StackItem } from 'office-ui-fabric-react/lib/Stack';
import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox';
import { Label } from 'office-ui-fabric-react/lib/Label';
import { Dropdown, IDropdownOption } from 'office-ui-fabric-react/lib/Dropdown';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';

import { DialogWrapper, DialogTypes } from '../DialogWrapper';
import { MultiLanguagesDialog } from '../../constants';

import { ILanguageFormData } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { ScrollablePane, IScrollablePaneStyles } from 'office-ui-fabric-react/li
import { Stack, StackItem } from 'office-ui-fabric-react/lib/Stack';
import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox';
import { Label } from 'office-ui-fabric-react/lib/Label';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';

import { DialogWrapper, DialogTypes } from '../DialogWrapper';
import { MultiLanguagesDialog } from '../../constants';

import { ILanguageFormData } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { TextField } from 'office-ui-fabric-react/lib/TextField';
import { useRecoilValue } from 'recoil';
import { RecognizerSchema, useRecognizerConfig, useShellApi } from '@bfc/extension-client';
import { DialogFactory, SDKKinds } from '@bfc/shared';
import { DialogWrapper, DialogTypes } from '@bfc/ui-shared';

import { DialogCreationCopy, nameRegex } from '../../constants';
import { StorageFolder } from '../../recoilModel/types';
import { DialogWrapper, DialogTypes } from '../../components/DialogWrapper';
import { FieldConfig, useForm } from '../../hooks/useForm';
import { actionsSeedState, schemasState, validateDialogSelectorFamily } from '../../recoilModel';

Expand Down
6 changes: 4 additions & 2 deletions Composer/packages/client/src/shell/useShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { useTriggerApi } from './triggerApi';

const FORM_EDITOR = 'PropertyEditor';

type EventSource = 'FlowEditor' | 'PropertyEditor' | 'DesignPage';
type EventSource = 'FlowEditor' | 'PropertyEditor' | 'DesignPage' | 'VaCreation';

export function useShell(source: EventSource, projectId: string): Shell {
const dialogMapRef = useRef({});
Expand Down Expand Up @@ -240,7 +240,9 @@ export function useShell(source: EventSource, projectId: string): Shell {
skills,
skillsSettings: settings.skill || {},
}
: ({} as ShellData);
: ({
projectId,
} as ShellData);

return {
api,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ interface DialogWrapperProps extends Pick<IDialogProps, 'onDismiss'> {
export const DialogWrapper: React.FC<DialogWrapperProps> = (props) => {
const { isOpen, onDismiss, title, subText, children, dialogType } = props;
const [currentStyle, setStyle] = useState(styles[dialogType]);

useEffect(() => {
if (dialogType) {
setStyle(styles[dialogType]);
Expand Down
1 change: 1 addition & 0 deletions Composer/packages/lib/ui-shared/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

export * from './ListOverview';
export * from './PropertyAssignment';
export * from './DialogWrapper';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ['../../../.eslintrc.react.js'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib
.vscode
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@bfc/ui-plugin-va-creation",
"version": "0.0.0",
"private": true,
"description": "Virtual assistant creation experience.",
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"start": "tsc --watch --preserveWatchOutput",
"build": "yarn clean && yarn build:ts",
"build:ts": "tsc --build ./tsconfig.build.json",
"clean": "rimraf lib demo/dist",
"lint": "eslint --quiet src",
"lint:fix": "yarn lint --fix",
"prepare": "yarn build"
},
"license": "MIT",
"peerDependencies": {
"@bfc/extension-client": "*",
"@bfc/adaptive-form": "*",
"@uifabric/fluent-theme": "^7.1.4",
"@uifabric/icons": "^7.3.0",
"@uifabric/styling": "^7.7.4",
"format-message": "^6.2.3",
"office-ui-fabric-react": "^7.71.0",
"react": "16.13.1",
"react-dom": "16.13.1"
},
"devDependencies": {
"@types/react": "16.9.23",
"format-message": "^6.2.3",
"react": "16.13.1",
"react-dom": "16.13.1"
},
"dependencies": {
"@bfc/ui-shared": "*",
"@bfc/extension-client": "*",
"@emotion/core": "^10.0.27",
"@reach/router": "^1.3.4",
"@types/reach__router": "^1.3.5",
"axios": "^0.19.2"
}
}
Loading