Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit c20dc22

Browse files
committed
Moved qnamaker hostname to constants file.
1 parent 1689cb9 commit c20dc22

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

packages/app/client/src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ export const DOCUMENT_ID_APP_SETTINGS = 'app:settings';
5656
export const DOCUMENT_ID_BOT_SETTINGS = 'bot:settings';
5757
export const DOCUMENT_ID_WELCOME_PAGE = 'welcome-page';
5858
export const DOCUMENT_ID_MARKDOWN_PAGE = 'markdown-page';
59+
60+
/* a QnA maker service needs to be initialized with a valid hostname or msbot will throw */
61+
export const QnAMakerSampleHostname = 'https://myqna.azurewebsites.net';

packages/app/client/src/state/sagas/servicesExplorerSagas.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import {
6464
import { sortExplorerContents } from '../actions/explorerActions';
6565
import { SortCriteria } from '../reducers/explorer';
6666
import { RootState } from '../store';
67+
import { QnAMakerSampleHostname } from '../../constants';
6768

6869
import { AzureAuthSaga } from './azureAuthSaga';
6970

@@ -166,8 +167,7 @@ export class ServicesExplorerSagas {
166167
if (result === 1) {
167168
action.payload.connectedService = BotConfigurationBase.serviceFromJSON({
168169
type,
169-
hostname:
170-
'https://myqna.azurewebsites.net' /* a QnA maker service needs to be initialized with a valid hostname or msbot will throw */,
170+
hostname: QnAMakerSampleHostname,
171171
} as any);
172172
result = yield* ServicesExplorerSagas.launchConnectedServiceEditor(action);
173173
}

packages/app/client/src/ui/shell/explorer/servicesExplorer/connectedServiceEditor/connectedServiceEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import * as React from 'react';
3939
import { ChangeEvent, Component, ReactNode } from 'react';
4040

4141
import { serviceTypeLabels } from '../../../../../utils/serviceTypeLables';
42+
import { QnAMakerSampleHostname } from '../../../../../constants';
4243

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

0 commit comments

Comments
 (0)