Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue with adding a QnA KB. #2066

Merged
merged 2 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [client/main] Added Ngrok Debugger UI in PR [2032](https://github.com/microsoft/BotFramework-Emulator/pull/2032)
- [client/main] Changed conversation infrastructure to use Web Sockets to communicate with Web Chat in PR [2034](https://github.com/microsoft/BotFramework-Emulator/pull/2034)

## Changed
## Fixed
- [client] Hid services pane by default in PR [2059](https://github.com/microsoft/BotFramework-Emulator/pull/2059)
- [client] Fixed an issue where trying to add a QnA KB manually after signing into Azure was causing the app to crash in PR [2066](https://github.com/microsoft/BotFramework-Emulator/pull/2066)

## Removed
- [client/main] Removed legacy payments code in PR [2058](https://github.com/microsoft/BotFramework-Emulator/pull/2058)
Expand Down
3 changes: 3 additions & 0 deletions packages/app/client/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ export const DOCUMENT_ID_APP_SETTINGS = 'app:settings';
export const DOCUMENT_ID_BOT_SETTINGS = 'bot:settings';
export const DOCUMENT_ID_WELCOME_PAGE = 'welcome-page';
export const DOCUMENT_ID_MARKDOWN_PAGE = 'markdown-page';

/* a QnA maker service needs to be initialized with a valid hostname or msbot will throw */
export const QnAMakerSampleHostname = 'https://myqna.azurewebsites.net';
3 changes: 2 additions & 1 deletion packages/app/client/src/state/sagas/servicesExplorerSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import {
import { sortExplorerContents } from '../actions/explorerActions';
import { SortCriteria } from '../reducers/explorer';
import { RootState } from '../store';
import { QnAMakerSampleHostname } from '../../constants';

import { AzureAuthSaga } from './azureAuthSaga';

Expand Down Expand Up @@ -166,7 +167,7 @@ export class ServicesExplorerSagas {
if (result === 1) {
action.payload.connectedService = BotConfigurationBase.serviceFromJSON({
type,
hostname: '' /* defect workaround */,
hostname: QnAMakerSampleHostname,
} as any);
result = yield* ServicesExplorerSagas.launchConnectedServiceEditor(action);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import * as React from 'react';
import { ChangeEvent, Component, ReactNode } from 'react';

import { serviceTypeLabels } from '../../../../../utils/serviceTypeLables';
import { QnAMakerSampleHostname } from '../../../../../constants';

import * as styles from './connectedServiceEditor.scss';
import { KvPair } from './kvPair';
Expand Down Expand Up @@ -106,8 +107,7 @@ export class ConnectedServiceEditor extends Component<ConnectedServiceEditorProp
};
// if qnamaker, initialize with sample hostname so that botframework-config doesn't throw
if (props.serviceType === ServiceTypes.QnA) {
(connectedService as IQnAService).hostname =
(connectedService as IQnAService).hostname || 'https://myqna.azurewebsites.net';
(connectedService as IQnAService).hostname = (connectedService as IQnAService).hostname || QnAMakerSampleHostname;
}
this.state = {
connectedServiceCopy: BotConfigurationBase.serviceFromJSON(connectedService),
Expand Down