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
44 commits
Select commit Hold shift + click to select a range
adddaa2
move provisionig readme into scripts folder so that main package read…
benbrown Mar 29, 2021
620c8fb
Read in and display a readme.md file for the project
benbrown Mar 29, 2021
1be5eb0
Merge branch 'main' into benbrown/readmes
benbrown Mar 29, 2021
c5788b2
remove errant constant
benbrown Mar 29, 2021
6f3d46a
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Mar 29, 2021
fd85954
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown Mar 29, 2021
415bda8
adding bot project tab view
pavolumMsft Apr 1, 2021
a9411c4
Updating botProjectInfo
pavolumMsft Apr 1, 2021
b3e0ea2
Adding support for deep linking into settings page
pavolumMsft Apr 1, 2021
83d3336
Merging latest form main and resolving conflict
pavolumMsft Apr 1, 2021
d4f6571
Main merge clean up
pavolumMsft Apr 1, 2021
7062fc9
Fixing skills settings dependency
pavolumMsft Apr 1, 2021
7bab94a
Adding bottons for luis and qna provision in settings page
pavolumMsft Apr 1, 2021
a15430a
Updating setting after qna and luis provisioning
pavolumMsft Apr 1, 2021
6ad4e83
Merge branch 'main' into benbrown/readmes
pavolum Apr 1, 2021
a388c4e
Naming changes for readme modal
pavolumMsft Apr 1, 2021
3bf7cfa
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
pavolumMsft Apr 1, 2021
6bfcdf5
removing unused isBack option
pavolumMsft Apr 1, 2021
b2f243e
address feedback
benbrown Apr 1, 2021
3821132
Adding formatMesage
pavolumMsft Apr 1, 2021
b679759
Removing unused ref
pavolumMsft Apr 1, 2021
cbc2cc3
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown Apr 1, 2021
77ed140
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown Apr 1, 2021
ac01860
Temp remove template tag and text
pavolumMsft Apr 1, 2021
7aa06a7
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
pavolumMsft Apr 1, 2021
4b61a62
Removing unused variables and deps
pavolumMsft Apr 2, 2021
6858230
removing unsed imports
pavolumMsft Apr 2, 2021
3f02de5
Resolving merge conflicts
pavolumMsft Apr 2, 2021
17cb268
Adding testIds to tabs in settings page and updating broken integrati…
pavolumMsft Apr 2, 2021
c86c43c
Merge branch 'main' into benbrown/readmes
pavolum Apr 2, 2021
80d219d
Fixing Luis deploy test to work with tab experience
pavolumMsft Apr 3, 2021
a80a2e4
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
pavolumMsft Apr 3, 2021
1dbdf31
Merging and resolving conflicts
pavolumMsft Apr 5, 2021
9b7bba9
Fixing import in test
pavolumMsft Apr 5, 2021
9fefd80
Fixing header unit test
pavolumMsft Apr 5, 2021
182ad9f
Merge branch 'main' into benbrown/readmes
pavolum Apr 5, 2021
ac28eb2
use iconUrl field instead of icon. Fix for https://github.com/microso…
benbrown Apr 5, 2021
b426df2
Merge branch 'main' into benbrown/readmes
beyackle Apr 5, 2021
7376c45
read in icon and include it as a data url
benbrown Apr 5, 2021
90f0909
Merge branch 'benbrown/fixicon' into benbrown/readmes
benbrown Apr 5, 2021
8322ca4
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown Apr 5, 2021
2f13e3c
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown Apr 5, 2021
ebb499a
Merge branch 'main' into benbrown/readmes
pavolum Apr 5, 2021
03bfbdf
Simplyfing array inclusion check
pavolumMsft Apr 5, 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
1 change: 1 addition & 0 deletions Composer/cypress/integration/LuisDeploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ context('Luis Deploy', () => {

it('can deploy luis success', () => {
cy.visitPage('Project Settings');
cy.findByText('LUIS and QnA').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 @@ -39,6 +39,6 @@ describe('<Header />', () => {
return { location: { pathname: 'http://server/bot/1234/settings' } };
});
const result = renderWithRecoil(<Header />);
expect(result.findAllByDisplayValue('Start all bots')).not.toBeNull();
expect(result.findAllByDisplayValue('Start bot')).not.toBeNull();
});
});
80 changes: 80 additions & 0 deletions Composer/packages/client/src/pages/botProject/BotProjectInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

/** @jsx jsx */
import { css, jsx } from '@emotion/core';
import { useRecoilValue } from 'recoil';
import React, { useState, Fragment } from 'react';
import { RouteComponentProps } from '@reach/router';
import { DisplayMarkdownDialog } from '@bfc/ui-shared';
import formatMessage from 'format-message';
import { Stack, StackItem } from 'office-ui-fabric-react/lib/Stack';
import { Link } from 'office-ui-fabric-react/lib/Link';

import { projectReadmeState, locationState } from '../../recoilModel/atoms';
import { localBotsDataSelector } from '../../recoilModel/selectors/project';

const labelStyle = css`
font-size: 12px;
color: #828282;
`;

const valueStyle = css`
font-size: 14px;
`;

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

export const BotProjectInfo: React.FC<RouteComponentProps<{
projectId: string;
}>> = (props) => {
const { projectId = '' } = props;
const botProjects = useRecoilValue(localBotsDataSelector);
const botProject = botProjects.find((b) => b.projectId === projectId);
const readme = useRecoilValue(projectReadmeState(projectId));
const location = useRecoilValue(locationState(projectId));
const [readmeHidden, setReadmeHidden] = useState<boolean>(true);

return (
<div>
<h3 css={headerStyle}>{formatMessage('Bot Details')}</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' } }}>
<div css={labelStyle}>{formatMessage('Read Me')}</div>
{readme && (
<Fragment>
<Link
onClick={() => {
setReadmeHidden(false);
}}
>
{formatMessage('View project readme')}
</Link>
<DisplayMarkdownDialog
content={readme}
hidden={readmeHidden}
title={'Project Readme'}
onDismiss={() => {
setReadmeHidden(true);
}}
/>
</Fragment>
)}
</StackItem>
</Stack>
</div>
);
};

export default BotProjectInfo;
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { RouteComponentProps } from '@reach/router';
import { JsonEditor } from '@bfc/code-editor';
import { Toggle } from 'office-ui-fabric-react/lib/Toggle';
import { DialogSetting } from '@bfc/shared';
import { FontSizes, FontWeights } from 'office-ui-fabric-react/lib/Styling';
import { NeutralColors } from '@uifabric/fluent-theme';
import { defaultToolbarButtonStyles } from '@bfc/ui-shared';

import TelemetryClient from '../../telemetry/TelemetryClient';
Expand All @@ -25,7 +23,7 @@ import { createBotSettingUrl, navigateTo } from '../../utils/navigation';
import { mergePropertiesManagedByRootBot } from '../../recoilModel/dispatchers/utils/project';

import { openDeleteBotModal } from './DeleteBotButton';
import BotProjectSettingsTableView from './BotProjectSettingsTableView';
import { BotProjectSettingsTabView } from './BotProjectsSettingsTabView';

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

Expand All @@ -45,18 +43,6 @@ const container = css`
height: 100%;
`;

const botNameStyle = css`
font-size: ${FontSizes.xLarge};
font-weight: ${FontWeights.semibold};
color: ${NeutralColors.black};
`;

const mainContentHeader = css`
display: flex;
justify-content: space-between;
margin-bottom: 15px;
`;

// -------------------- BotProjectSettings -------------------- //

const BotProjectSettings: React.FC<RouteComponentProps<{ projectId: string; skillId: string }>> = (props) => {
Expand All @@ -68,8 +54,6 @@ const BotProjectSettings: React.FC<RouteComponentProps<{ projectId: string; skil
const botProject = botProjects.find((b) => b.projectId === currentProjectId);
const { deleteBot } = useRecoilValue(dispatcherState);

const isRootBot = !!botProject?.isRootBot;
const botName = botProject?.name;
const settings = useRecoilValue(settingsState(currentProjectId));
const mergedSettings = mergePropertiesManagedByRootBot(currentProjectId, rootBotProjectId, settings);

Expand Down Expand Up @@ -205,19 +189,6 @@ const BotProjectSettings: React.FC<RouteComponentProps<{ projectId: string; skil
>
<Suspense fallback={<LoadingSpinner />}>
<div css={container}>
<div css={mainContentHeader}>
<div css={botNameStyle}>
{`${botName} (${isRootBot ? formatMessage('Root Bot') : formatMessage('Skill')})`}
</div>
<Toggle
inlineLabel
checked={isAdvancedSettingsEnabled}
className={'advancedSettingsView'}
defaultChecked={false}
label={formatMessage('Advanced Settings View (json)')}
onChange={() => setAdvancedSettingsEnabled(!isAdvancedSettingsEnabled)}
/>
</div>
{isAdvancedSettingsEnabled ? (
<JsonEditor
key={'settingsjson'}
Expand All @@ -227,8 +198,19 @@ const BotProjectSettings: React.FC<RouteComponentProps<{ projectId: string; skil
onChange={handleChange}
/>
) : (
<BotProjectSettingsTableView projectId={currentProjectId} scrollToSectionId={props.location?.hash} />
<BotProjectSettingsTabView projectId={currentProjectId} scrollToSectionId={props.location?.hash} />
)}
<Toggle
inlineLabel
checked={isAdvancedSettingsEnabled}
className={'advancedSettingsView'}
defaultChecked={false}
label={formatMessage('Advanced Settings View (json)')}
styles={{ root: { position: 'absolute', left: '700px', top: '30px' } }}
onChange={() => {
setAdvancedSettingsEnabled(!isAdvancedSettingsEnabled);
}}
/>
</div>
</Suspense>
</Page>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { RouteComponentProps } from '@reach/router';
import { localBotsDataSelector } from '../../recoilModel/selectors/project';
import { useFeatureFlag } from '../../utils/hooks';

import { BotProjectInfo } from './BotProjectInfo';
import { SkillHostEndPoint } from './SkillHostEndPoint';
import { AppIdAndPassword } from './AppIdAndPassword';
import { ExternalService } from './ExternalService';
Expand Down Expand Up @@ -46,6 +47,7 @@ export const BotProjectSettingsTableView: React.FC<RouteComponentProps<{

return (
<div css={container}>
<BotProjectInfo projectId={projectId} />
{isRootBot && <SkillHostEndPoint projectId={projectId} />}
<AppIdAndPassword projectId={projectId} />
<ExternalService projectId={projectId} scrollToSectionId={scrollToSectionId} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

/** @jsx jsx */
import { jsx, css } from '@emotion/core';
import { useRecoilValue } from 'recoil';
import React, { useEffect, useState } from 'react';
import { RouteComponentProps } from '@reach/router';
import { Pivot, PivotItem } from 'office-ui-fabric-react/lib/components/Pivot';
import formatMessage from 'format-message';

import { localBotsDataSelector } from '../../recoilModel/selectors/project';
import { useFeatureFlag } from '../../utils/hooks';

import { SkillHostEndPoint } from './SkillHostEndPoint';
import { BotProjectInfo } from './BotProjectInfo';
import { AppIdAndPassword } from './AppIdAndPassword';
import { ExternalService } from './ExternalService';
import { BotLanguage } from './BotLanguage';
import { RuntimeSettings } from './RuntimeSettings';
import { PublishTargets } from './PublishTargets';
import AdapterSection from './adapters/AdapterSection';

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

const container = css`
display: flex;
flex-direction: column;
max-width: 1000px;
height: 100%;
`;

const publishTargetsWrap = (isLastComponent) => css`
margin-bottom: ${isLastComponent ? '120px' : 0};
`;

const idsInTab: Record<PivotItemKey, string[]> = {
Basics: ['runtimeSettings'],
LuisQna: [],
Connections: ['connections', 'addNewPublishProfile'],
SkillConfig: [],
Language: [],
};

enum PivotItemKey {
Basics = 'Basics',
LuisQna = 'LuisQna',
Connections = 'Connections',
SkillConfig = 'SkillConfig',
Language = 'Language',
}

// -------------------- BotProjectSettingsTableView -------------------- //

export const BotProjectSettingsTabView: React.FC<RouteComponentProps<{
projectId: string;
scrollToSectionId: string;
}>> = (props) => {
const { projectId = '', scrollToSectionId = '' } = props;
const botProjects = useRecoilValue(localBotsDataSelector);
const botProject = botProjects.find((b) => b.projectId === projectId);
const isRootBot = !!botProject?.isRootBot;
const useAdapters = useFeatureFlag('NEW_CREATION_FLOW');
const [selectedKey, setSelectedKey] = useState(PivotItemKey.Basics);

useEffect(() => {
if (scrollToSectionId) {
const htmlIdTagName = scrollToSectionId.replace('#', '');
for (const key in PivotItemKey) {
if (idsInTab[key].includes(htmlIdTagName)) {
setSelectedKey(key as PivotItemKey);
}
}
}
}, [scrollToSectionId]);

return (
<div css={container}>
<Pivot
selectedKey={String(selectedKey)}
onLinkClick={(item) => {
item?.props.itemKey && setSelectedKey(item.props.itemKey as PivotItemKey);
}}
>
<PivotItem data-testid="basicsTab" headerText={formatMessage('Basics')} itemKey={PivotItemKey.Basics}>
<BotProjectInfo projectId={projectId} />
<AppIdAndPassword projectId={projectId} />
<RuntimeSettings projectId={projectId} scrollToSectionId={scrollToSectionId} />
</PivotItem>
<PivotItem data-testid="luisQnaTab" headerText={formatMessage('LUIS and QnA')} itemKey={PivotItemKey.LuisQna}>
<ExternalService projectId={projectId} scrollToSectionId={scrollToSectionId} />
</PivotItem>
<PivotItem
data-testid="connectionsTab"
headerText={formatMessage('Connections')}
itemKey={PivotItemKey.Connections}
>
<div css={publishTargetsWrap(!isRootBot)}>
<PublishTargets projectId={projectId} scrollToSectionId={scrollToSectionId} />
{isRootBot && useAdapters && <AdapterSection projectId={projectId} scrollToSectionId={scrollToSectionId} />}
</div>
</PivotItem>
<PivotItem
data-testid="skillsTab"
headerText={formatMessage('Skill Configuration')}
itemKey={PivotItemKey.SkillConfig}
>
{isRootBot && <SkillHostEndPoint projectId={projectId} />}
</PivotItem>
<PivotItem data-testid="languageTab" headerText={formatMessage('Language')} itemKey={PivotItemKey.Language}>
<BotLanguage projectId={projectId} />
</PivotItem>
</Pivot>
</div>
);
};

export default BotProjectSettingsTabView;
Loading