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
34 commits
Select commit Hold shift + click to select a range
8daa1a0
tab name changes
pavolum Apr 16, 2021
35f1c4c
Updating to latest UI: first/overview tab in settings page
pavolum Apr 16, 2021
c689a0c
Adding (root) suffix to root bot in settings view nav pane
pavolum Apr 16, 2021
45373f1
removing old table view of bot settings page
pavolum Apr 17, 2021
c096597
Merging latest and resolving conflicts
pavolum Apr 19, 2021
ed3628d
Fixing Luis and Qna styling
pavolum Apr 19, 2021
d11d591
Fixing fluentUI imports and skills settings page UI
pavolum Apr 19, 2021
931db84
Fixing UI for appID component in settings page
pavolum Apr 19, 2021
eaaaed4
Fixing connections tab UI
pavolum Apr 19, 2021
efff028
Fixing skills tab UI
pavolum Apr 20, 2021
0bb02b3
language tab UI fixes
pavolum Apr 20, 2021
540c130
Adding teams callout when teams is enabled
pavolum Apr 20, 2021
3a8f331
Merge branch 'main' into pavolum/settingPageUi
pavolum Apr 20, 2021
c3f2701
removing unused variables and deps
pavolum Apr 20, 2021
6009f9f
Merge branch 'pavolum/settingPageUi' of https://github.com/microsoft/…
pavolum Apr 20, 2021
bacb072
Changing text with links to use formatMessage.rich
pavolum Apr 20, 2021
d572f34
Fix column width
pavolum Apr 20, 2021
f4fd646
Pulling latest and resolving conflicts
pavolum Apr 20, 2021
f63aae2
Fixing luis provision modal read me link
pavolum Apr 20, 2021
8ab38f3
Updating locale file
pavolum Apr 20, 2021
ec6c4a3
Remove unused import
pavolum Apr 20, 2021
fed6729
Update unit test to reflect new tab text
pavolum Apr 21, 2021
9e5e774
Add links to new hyperlinks in settings page
pavolum Apr 21, 2021
1816869
Handle merge conflcits
pavolum Apr 21, 2021
5571eb9
Adding learnmore links to new qna/luis modal implementation
pavolum Apr 21, 2021
a9afd56
Handling merge conflicts
pavolum Apr 21, 2021
3934ce6
Adding keys to rich format message
pavolum Apr 21, 2021
1e96c70
Merge branch 'main' into pavolum/settingPageUi
pavolum Apr 21, 2021
25a2924
updating locale file
pavolum Apr 21, 2021
48e7944
Mergin latest
pavolum Apr 21, 2021
05b45e6
Making minor changes requested in PR
pavolum Apr 21, 2021
3e7055c
Merge branch 'main' into pavolum/settingPageUi
pavolum Apr 21, 2021
6b01678
Merge branch 'main' into pavolum/settingPageUi
pavolum Apr 21, 2021
1c7f172
Merge branch 'main' into pavolum/settingPageUi
hatpick Apr 21, 2021
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
2 changes: 1 addition & 1 deletion Composer/cypress/integration/LuisDeploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ context('Luis Deploy', () => {

it('can deploy luis success', () => {
cy.visitPage('Project settings');
cy.findByText('LUIS and QnA').click();
cy.findByText('Development Resources').click();
cy.findAllByTestId('rootLUISAuthoringKey').type('12345678', { delay: 200 });
cy.findAllByTestId('rootLUISRegion').click();
cy.findByText('westus').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const ManageLuis = (props: ManageLuisProps) => {
'1. Using the Azure portal, please create a Language Understanding resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffluis'
)}
hidden={props.hidden}
learnMore={'https://aka.ms/composer-luis-learnmore'}
regions={LUIS_REGIONS}
serviceKeyType={'LUIS.Authoring'}
serviceName={'LUIS'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const ManageQNA = (props: ManageQNAProps) => {
'1. Using the Azure portal, please create a QnAMaker resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffqnamaker'
)}
hidden={props.hidden}
learnMore={'https://aka.ms/composer-addqnamaker-learnmore'}
regions={QNA_REGIONS}
serviceKeyType={'QnAMaker'}
serviceName={'QnA Maker'}
Expand Down
37 changes: 21 additions & 16 deletions Composer/packages/client/src/pages/botProject/AllowedCallers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the MIT License.

/** @jsx jsx */
import { css, jsx } from '@emotion/core';
import React from 'react';
import { jsx } from '@emotion/core';
import React, { Fragment } from 'react';
import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
import { ActionButton } from 'office-ui-fabric-react/lib/components/Button';
Expand All @@ -13,12 +13,12 @@ import { ITextField, TextField } from 'office-ui-fabric-react/lib/components/Tex
import cloneDeep from 'lodash/cloneDeep';
import formatMessage from 'format-message';
import { MessageBar, MessageBarType } from 'office-ui-fabric-react/lib/MessageBar';
import { Link } from 'office-ui-fabric-react/lib/Link';

import { dispatcherState, rootBotProjectIdSelector, settingsState } from '../../recoilModel';
import { mergePropertiesManagedByRootBot } from '../../recoilModel/dispatchers/utils/project';
import { CollapsableWrapper } from '../../components/CollapsableWrapper';

import { actionButton, subtitle as defaultSubtitle, title } from './styles';
import { actionButton, subtext, title } from './styles';

const Input = styled(TextField)({
width: '100%',
Expand Down Expand Up @@ -54,10 +54,6 @@ const ItemContainer = styled.div({
marginTop: '4px',
});

const subtitle = css`
padding: 8px 0;
`;

type ItemProps = {
value: string;
onBlur: () => void;
Expand Down Expand Up @@ -144,10 +140,22 @@ export const AllowedCallers: React.FC<Props> = ({ projectId }) => {
}, [runtimeSettings?.skills?.allowedCallers, updateAllowedCallers]);

return (
<CollapsableWrapper title={formatMessage('Allowed callers')} titleStyle={title}>
<div css={[defaultSubtitle, subtitle]}>
{formatMessage(
'Skills can be “called” by external bots. Allow other bots to call your skill by adding their App IDs to the list below.'
<Fragment>
<div css={title}>{formatMessage('Allowed Callers')}</div>
<div css={subtext}>
{formatMessage.rich(
'Skills can be “called” by external bots. Allow other bots to call your skill by adding their App IDs to the list below. <a>Learn more.</a>',
{
a: ({ children }) => (
<Link
key="allowed-callers-settings-page"
href={'https://aka.ms/composer-skills-learnmore'}
target="_blank"
>
{children}
</Link>
),
}
)}
</div>
<ItemContainer>
Expand All @@ -157,9 +165,6 @@ export const AllowedCallers: React.FC<Props> = ({ projectId }) => {
);
})}
</ItemContainer>
<ActionButton data-testid={'addNewAllowedCaller'} styles={actionButton} onClick={onAddNewAllowedCaller}>
{formatMessage('Add caller')}
</ActionButton>
{!runtimeSettings?.skills?.allowedCallers?.length && (
<MessageBar messageBarType={MessageBarType.warning}>
{formatMessage('This bot cannot be called as a skill since the allowed caller list is empty')}
Expand All @@ -168,6 +173,6 @@ export const AllowedCallers: React.FC<Props> = ({ projectId }) => {
<ActionButton data-testid={'addNewAllowedCaller'} styles={actionButton} onClick={onAddNewAllowedCaller}>
{formatMessage('Add new caller')}
</ActionButton>
</CollapsableWrapper>
</Fragment>
);
};
38 changes: 20 additions & 18 deletions Composer/packages/client/src/pages/botProject/AppIdAndPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
// Licensed under the MIT License.

/** @jsx jsx */
import React, { useState, useEffect, useCallback } from 'react';
import React, { useState, useEffect, useCallback, Fragment } from 'react';
import { jsx, css } from '@emotion/core';
import { useRecoilValue } from 'recoil';
import { TextField } from 'office-ui-fabric-react/lib/TextField';
import { TooltipHost } from 'office-ui-fabric-react/lib/Tooltip';
import { Icon } from 'office-ui-fabric-react/lib/Icon';
import formatMessage from 'format-message';
import { mergeStyleSets } from '@uifabric/styling';
import { FontSizes } from 'office-ui-fabric-react/lib/Styling';
import { SharedColors } from '@uifabric/fluent-theme';
import { Link } from 'office-ui-fabric-react/lib/Link';

import { dispatcherState, settingsState } from '../../recoilModel';
import { CollapsableWrapper } from '../../components/CollapsableWrapper';
import { mergePropertiesManagedByRootBot } from '../../recoilModel/dispatchers/utils/project';
import { rootBotProjectIdSelector } from '../../recoilModel/selectors/project';

import { title } from './styles';
import { inputFieldStyles, subtext, title } from './styles';
// -------------------- Styles -------------------- //

const labelContainer = css`
Expand Down Expand Up @@ -50,16 +49,6 @@ const appIdAndPasswordStyle = css`
flex-direction: column;
`;

const customError = {
root: {
selectors: {
'p > span': {
width: '100%',
},
},
},
};

// -------------------- AppIdAndPassword -------------------- //

type AppIdAndPasswordProps = {
Expand Down Expand Up @@ -114,14 +103,27 @@ export const AppIdAndPassword: React.FC<AppIdAndPasswordProps> = (props) => {
}, [projectId, mergedSettings, localMicrosoftAppId]);

return (
<CollapsableWrapper title={formatMessage('App Id / Password')} titleStyle={title}>
<Fragment>
<div css={title}>{formatMessage('Microsoft App ID')}</div>
<div css={subtext}>
{formatMessage.rich(
'A Microsoft App ID is required for your local Azure resources. If you’ve created an App ID already, you can add here. If not, your App ID and secret will be created when you provision resources for this bot. <a>Learn more.</a>',
{
a: ({ children }) => (
<Link key="app-id-settings-page" href={'https://aka.ms/composer-appid-learnmore'} target="_blank">
{children}
</Link>
),
}
)}
</div>
<div css={appIdAndPasswordStyle}>
<TextField
ariaLabel={formatMessage('Microsoft App Id')}
data-testid={'MicrosoftAppId'}
label={formatMessage('Microsoft App Id')}
placeholder={formatMessage('Enter Microsoft App Id')}
styles={customError}
styles={inputFieldStyles}
value={localMicrosoftAppId}
onBlur={handleAppIdOnBlur}
onChange={handleAppIdOnChange}
Expand All @@ -132,13 +134,13 @@ export const AppIdAndPassword: React.FC<AppIdAndPasswordProps> = (props) => {
data-testid={'MicrosoftPassword'}
label={formatMessage('Microsoft App Password')}
placeholder={formatMessage('Enter Microsoft App Password')}
styles={mergeStyleSets({ root: { marginTop: 15 } }, customError)}
styles={inputFieldStyles}
value={localMicrosoftAppPassword}
onBlur={handleAppPasswordOnBlur}
onChange={handleAppPasswordOnChange}
onRenderLabel={onRenderLabel}
/>
</div>
</CollapsableWrapper>
</Fragment>
);
};
87 changes: 42 additions & 45 deletions Composer/packages/client/src/pages/botProject/BotLanguage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ import { FontSizes, FontWeights } from 'office-ui-fabric-react/lib/Styling';
import { NeutralColors, SharedColors } from '@uifabric/fluent-theme';

import { dispatcherState, settingsState } from '../../recoilModel';
import { CollapsableWrapper } from '../../components/CollapsableWrapper';
import { languageListTemplates } from '../../components/MultiLanguage';
import { localeState, showAddLanguageModalState } from '../../recoilModel/atoms';
import { AddLanguageModal } from '../../components/MultiLanguage';
import { mergePropertiesManagedByRootBot } from '../../recoilModel/dispatchers/utils/project';
import { rootBotProjectIdSelector } from '../../recoilModel/selectors/project';

import { title, subtitle } from './styles';
import { subtitle } from './styles';
// -------------------- Styles -------------------- //

const botLanguageContainerStyle = css`
Expand Down Expand Up @@ -152,51 +151,49 @@ export const BotLanguage: React.FC<BotLanguageProps> = (props) => {

return (
<Fragment>
<CollapsableWrapper title={formatMessage('Bot language')} titleStyle={title}>
<div css={botLanguageContainerStyle}>
<div css={subtitle}>
{formatMessage(
'List of languages that bot will be able to understand (User input) and respond to (Bot responses). To make this bot available in other languages, click ‘Manage bot languages’ to create a copy of the default language, and translate the content into the new language.'
)}
</div>
<div css={botLanguageFieldStyle}>
{languageListOptions.map((l) => (
<div key={l.key} css={languageRowContainer}>
{l.key === defaultLanguage && (
<div css={languageTextStyle} data-testid={'defaultLanguage'}>
{l.text}
<span css={defaultLanguageTextStyle}> {formatMessage('DEFAULT LANGUAGE')}</span>
</div>
)}
{l.key !== defaultLanguage && (
<div css={languageItemContainer}>
<div css={languageItem}>{l.text}</div>
<div css={languageButtonContainer}>
<ActionButton
data-testid={'setDefaultLanguage'}
styles={languageButton}
onClick={(e) => setDefaultLanguage(l.key)}
>
{formatMessage('Set it as default language')}
</ActionButton>
<ActionButton
data-testid={'remove'}
styles={languageButton}
onClick={() => deleteLanguages({ languages: [l.key], projectId: projectId })}
>
{formatMessage('Remove')}
</ActionButton>
</div>
<div css={botLanguageContainerStyle}>
<div css={subtitle}>
{formatMessage(
'List of languages that bot will be able to understand (User input) and respond to (Bot responses). To make this bot available in other languages, click ‘Manage languages’ to create a copy of the default language, and translate the content into the new language.'
)}
</div>
<div css={botLanguageFieldStyle}>
{languageListOptions.map((l) => (
<div key={l.key} css={languageRowContainer}>
{l.key === defaultLanguage && (
<div css={languageTextStyle} data-testid={'defaultLanguage'}>
{l.text}
<span css={defaultLanguageTextStyle}> {formatMessage('DEFAULT LANGUAGE')}</span>
</div>
)}
{l.key !== defaultLanguage && (
<div css={languageItemContainer}>
<div css={languageItem}>{l.text}</div>
<div css={languageButtonContainer}>
<ActionButton
data-testid={'setDefaultLanguage'}
styles={languageButton}
onClick={(e) => setDefaultLanguage(l.key)}
>
{formatMessage('Set it as default language')}
</ActionButton>
<ActionButton
data-testid={'remove'}
styles={languageButton}
onClick={() => deleteLanguages({ languages: [l.key], projectId: projectId })}
>
{formatMessage('Remove')}
</ActionButton>
</div>
)}
</div>
))}
</div>
<ActionButton styles={manageBotLanguage} onClick={() => addLanguageDialogBegin(projectId, () => {})}>
{formatMessage('Manage bot languages')}
</ActionButton>
</div>
)}
</div>
))}
</div>
</CollapsableWrapper>
<ActionButton styles={manageBotLanguage} onClick={() => addLanguageDialogBegin(projectId, () => {})}>
{formatMessage('Manage bot languages')}
</ActionButton>
</div>
<AddLanguageModal
defaultLanguage={defaultLanguage}
isOpen={showAddLanguageModal}
Expand Down
22 changes: 13 additions & 9 deletions Composer/packages/client/src/pages/botProject/BotProjectInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ const valueStyle = css`
`;

const headerStyle = css`
font-size: 16px;
font-size: 20px;
font-weight: 600;
`;

const rootTextStyle = css`
color: gray;
`;

export const BotProjectInfo: React.FC<RouteComponentProps<{
projectId: string;
projectId?: string;
isRootBot?: boolean;
}>> = (props) => {
const { projectId = '' } = props;
const { projectId = '', isRootBot = false } = props;
const botProjects = useRecoilValue(localBotsDataSelector);
const botProject = botProjects.find((b) => b.projectId === projectId);
const readme = useRecoilValue(projectReadmeState(projectId));
Expand All @@ -40,17 +45,16 @@ export const BotProjectInfo: React.FC<RouteComponentProps<{

return (
<div>
<h3 css={headerStyle}>{formatMessage('Bot Details')}</h3>
<h3 css={headerStyle}>
{botProject?.name}
{isRootBot && <span css={rootTextStyle}> {formatMessage('(root)')}</span>}
</h3>
<Stack tokens={{ childrenGap: 10 }}>
<StackItem>
<div css={labelStyle}>{formatMessage('Bot Name')}</div>
<div css={valueStyle}>{botProject?.name}</div>
</StackItem>
<StackItem>
<div css={labelStyle}>{formatMessage('File Location')}</div>
<div css={valueStyle}>{location}</div>
</StackItem>
<StackItem styles={{ root: { marginBottom: '10px' } }}>
<StackItem>
<div css={labelStyle}>{formatMessage('Read Me')}</div>
{readme && (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ const BotProjectSettings: React.FC<RouteComponentProps<{ projectId: string; skil
const newbotProjectLinks: INavTreeItem[] = localBotProjects.map((b) => {
return {
id: b.projectId,
name: b.name,
ariaLabel: formatMessage('Bot'),
name: `${b.name} ${b.isRootBot ? formatMessage('(root)') : ''}`,
ariaLabel: formatMessage('bot'),
url: createBotSettingUrl(rootBotProjectId ?? '', b.projectId),
isRootBot: b.isRootBot,
};
Expand Down
Loading