Skip to content

Commit

Permalink
Merge branch 'main' into toanzian/watch-tab-switch
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyanziano committed Jul 14, 2021
2 parents bf7b972 + 72c4e3a commit a4c7462
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('QnA creation flow', () => {
const next1 = getByText('Next');
fireEvent.click(next1);

const option = getAllByText('Create new knowledge base from URL or file');
const option = getAllByText('Create new knowledge base from URL');
fireEvent.click(option[0]);

const urlField = getByTestId('adden-usInCreateQnAFromUrlModal');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ export const CreateQnAFromUrl: React.FC<CreateQnAFromFormProps> = (props) => {
return (
<Fragment>
<Stack>
<Text styles={knowledgeBaseStyle}>{formatMessage('Create new knowledge base from URL or file')}</Text>
<Text styles={knowledgeBaseStyle}>{formatMessage('Create new knowledge base from URL')}</Text>
<p>
<span css={subText}>
{formatMessage(
'Select this option when you want to create a knowledge base from content such as an FAQ available online or in a file .csv, .xls or .doc format '
'Select this option if you want to create a knowledge base from content hosted online such as an FAQ or document link (.csv, .xls or .doc format)'
)}
</span>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const CreateQnAModal: React.FC<CreateQnAModalProps> = (props) => {
const avaliableLanguages = uniq(locales.map((item) => localeToLanguage(item)));

const actionOptions: IChoiceGroupOption[] = [
{ key: 'url', text: formatMessage('Create new knowledge base from URL or file ') },
{ key: 'url', text: formatMessage('Create new knowledge base from URL') },
{
key: 'portal',
text: formatMessage('Import existing knowledge base from QnA maker portal'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const title = <div style={titleStyle}>{formatMessage('Replace knowledge base fro
const description = (
<div style={descriptionStyle}>
{formatMessage(
'Select this option when you want to replace current knowledge base from content such as an FAQ available online or in a file .csv, .xls or .doc format '
'Select this option if you want to replace current knowledge base from content hosted online such as an FAQ or document link (.csv, .xls or .doc format)'
)}
</div>
);
Expand Down Expand Up @@ -86,7 +86,7 @@ export const ImportQnAFromUrl: React.FC<ImportQnAFromUrlModalProps> = (props) =>
<TextField
data-testid={'ImportNewUrlToOverwriteQnAFile'}
errorMessage={formErrors.url}
label={formatMessage('Source URL or file')}
label={formatMessage('Source URL')}
placeholder={formatMessage('Enter a URL to Import QnA resource')}
prefix={getLanguage(locale)}
styles={textFieldKBNameFromScratch}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const ReplaceQnAFromModal: React.FC<ReplaceQnAModalProps> = (props) => {
const currentAuthoringLanuage = localeToLanguage(currentLocale);

const actionOptions: IChoiceGroupOption[] = [
{ key: 'url', text: formatMessage('Replace knowledge base from URL or file ') },
{ key: 'url', text: formatMessage('Replace knowledge base from URL') },
{
key: 'portal',
text: formatMessage('Replace with an existing knowledge base from QnA maker portal'),
Expand Down
4 changes: 3 additions & 1 deletion Composer/packages/client/src/pages/design/PropertyPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
projectMetaDataState,
skillsStateSelector,
skillNameIdentifierByProjectIdSelector,
localeState,
} from '../../recoilModel';
import { undoVersionState } from '../../recoilModel/undo/history';
import { LoadingSpinner } from '../../components/LoadingSpinner';
Expand All @@ -29,6 +30,7 @@ type PropertyViewProps = {
};

const PropertyPanel: React.FC<PropertyViewProps> = React.memo(({ projectId = '', isSkill = false }) => {
const locale = useRecoilValue(localeState(projectId));
const schemas = useRecoilValue(schemasState(projectId));
const focusPath = useRecoilValue(focusPathState(projectId));
const undoVersion = useRecoilValue(undoVersionState(projectId));
Expand Down Expand Up @@ -58,7 +60,7 @@ const PropertyPanel: React.FC<PropertyViewProps> = React.memo(({ projectId = '',
(isRemoteSkill && skillManifestFile ? (
<ManifestEditor formData={skillManifestFile} />
) : (
<PropertyEditor key={focusPath + undoVersion} />
<PropertyEditor key={focusPath + undoVersion + locale} />
))}
</EditorExtension>
);
Expand Down
14 changes: 7 additions & 7 deletions Composer/packages/client/src/pages/design/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import formatMessage from 'format-message';
import { Diagnostic } from '@bfc/shared';
import { Diagnostic, DialogInfo } from '@bfc/shared';
import { useRecoilValue } from 'recoil';
import { OpenConfirmModal, dialogStyle } from '@bfc/ui-shared';
import { useSetRecoilState } from 'recoil';
Expand Down Expand Up @@ -47,13 +47,13 @@ function onRenderContent(subTitle, style) {
);
}

function getAllRef(targetId, dialogs) {
let refs: string[] = [];
function getAllRef(targetId: string, dialogs: DialogInfo[]) {
const refs: string[] = [];

// find target dialog's all parent
dialogs.forEach((dialog) => {
if (dialog.id === targetId) {
refs = refs.concat(dialog.referredDialogs);
} else if (!dialog.referredDialogs.every((item) => item !== targetId)) {
refs.push(dialog.displayName || dialog.id);
if (dialog.referredDialogs?.some((name) => name === targetId)) {
refs.push(dialog.id);
}
});
return refs;
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/indexers/src/dialogIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function extractReferredDialogs(dialog): string[] {
* */
const visitor: VisitorFunc = (path: string, value: any): boolean => {
// it's a valid schema dialog node.
if (has(value, '$kind') && value.$kind === SDKKinds.BeginDialog) {
if (has(value, '$kind') && value.$kind === SDKKinds.BeginDialog && value.dialog) {
const dialogName = value.dialog;
dialogs.push(dialogName);
}
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@botframework-composer/types": "*",
"@microsoft/bf-dialog": "4.14.0-dev.20210415.161c029",
"@microsoft/bf-dispatcher": "^4.11.0-beta.20201016.393c6b2",
"@microsoft/bf-generate-library": "4.14.0-preview.20210706.f886b46",
"@microsoft/bf-generate-library": "4.14.0-preview.20210713.5839ad4",
"@microsoft/bf-lu": "4.15.0-dev.20210702.cbf708d",
"@microsoft/bf-orchestrator": "4.14.0-rc0",
"applicationinsights": "^1.8.7",
Expand Down
31 changes: 11 additions & 20 deletions Composer/packages/server/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,11 +1055,8 @@
"create_new_knowledge_base_d15d6873": {
"message": "Create new knowledge base"
},
"create_new_knowledge_base_from_url_or_file_15e5758a": {
"message": "Create new knowledge base from URL or file"
},
"create_new_knowledge_base_from_url_or_file_47826842": {
"message": "Create new knowledge base from URL or file "
"create_new_knowledge_base_from_url_e8e94121": {
"message": "Create new knowledge base from URL"
},
"create_new_publish_profile_e27c0950": {
"message": "Create new publish profile"
Expand Down Expand Up @@ -2891,11 +2888,11 @@
"provide_access_tokens_8ead7563": {
"message": "Provide access tokens"
},
"provide_arm_token_by_running_az_account_get_access_e9d825a4": {
"message": "Provide ARM token by running `az account get-access-token`"
"provide_arm_token_by_running_a4bc440b": {
"message": "Provide ARM token by running:"
},
"provide_graph_token_by_running_az_account_get_acce_6d27a279": {
"message": "Provide graph token by running `az account get-access-token --resource-type ms-graph`"
"provide_graph_token_by_running_a449b2fc": {
"message": "Provide graph token by running:"
},
"provision_failure_983d3844": {
"message": "Provision failure"
Expand Down Expand Up @@ -3143,9 +3140,6 @@
"replace_knowledge_base_from_url_2be66ee3": {
"message": "Replace knowledge base from URL"
},
"replace_knowledge_base_from_url_or_file_47ef7c15": {
"message": "Replace knowledge base from URL or file "
},
"replace_this_dialog_e304015e": {
"message": "Replace this dialog"
},
Expand Down Expand Up @@ -3422,15 +3416,15 @@
"select_the_subscription_and_resource_you_want_to_c_a3bd2488": {
"message": "Select the subscription and resource you want to choose a knowledge base from"
},
"select_this_option_when_you_want_to_create_a_knowl_21e43487": {
"message": "Select this option when you want to create a knowledge base from content such as an FAQ available online or in a file .csv, .xls or .doc format "
"select_this_option_if_you_want_to_create_a_knowled_ee5a13e0": {
"message": "Select this option if you want to create a knowledge base from content hosted online such as an FAQ or document link (.csv, .xls or .doc format)"
},
"select_this_option_if_you_want_to_replace_current__4b6ca55": {
"message": "Select this option if you want to replace current knowledge base from content hosted online such as an FAQ or document link (.csv, .xls or .doc format)"
},
"select_this_option_when_you_want_to_import_existin_818c5aaa": {
"message": "Select this option when you want to import existing knowledge base from QnA maker portal. "
},
"select_this_option_when_you_want_to_replace_curren_a5139e24": {
"message": "Select this option when you want to replace current knowledge base from content such as an FAQ available online or in a file .csv, .xls or .doc format "
},
"select_triggers_5ff033ae": {
"message": "Select triggers"
},
Expand Down Expand Up @@ -3605,9 +3599,6 @@
"source_url_a7d98ebd": {
"message": "Source URL"
},
"source_url_or_file_346d61fb": {
"message": "Source URL or file"
},
"spaces_and_special_characters_are_not_allowed_20d47684": {
"message": "Spaces and special characters are not allowed."
},
Expand Down
8 changes: 4 additions & 4 deletions Composer/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4327,10 +4327,10 @@
ts-md5 "^1.2.6"
tslib "^1.10.0"

"@microsoft/bf-generate-library@4.14.0-preview.20210706.f886b46":
version "4.14.0-preview.20210706.f886b46"
resolved "https://registry.yarnpkg.com/@microsoft/bf-generate-library/-/bf-generate-library-4.14.0-preview.20210706.f886b46.tgz#6f261a70bb581b1dcfcea6363d8dab6a220b86fe"
integrity sha512-27LBrfYvI7W+jhsAhN8lI1ZQbc8Ds8ysQt5losOoItZjPsAuSnqHkdroV9Vb2QYfyVf/Bf7OelDzfdeYkW9/Sg==
"@microsoft/bf-generate-library@4.14.0-preview.20210713.5839ad4":
version "4.14.0-preview.20210713.5839ad4"
resolved "https://registry.yarnpkg.com/@microsoft/bf-generate-library/-/bf-generate-library-4.14.0-preview.20210713.5839ad4.tgz#cb86eb3fb24d869d33de82375e8f4e6dd59b5d30"
integrity sha512-1GE+WsmdJEPl+HF/ZLj8Fuli726FGdiBrNDMfJbeFU74c6gJsc7orzVGVTqzPeOVpCgcft7gYY44fFXE8n8LHQ==
dependencies:
"@microsoft/bf-lu" "^4.15.0-dev.20210702.cbf708d"
adaptive-expressions "^4.15.0-dev.290c7e0"
Expand Down

0 comments on commit a4c7462

Please sign in to comment.