This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 375
feat: Updating to Tab UI for bot settings page #6592
Merged
Merged
Changes from 42 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 620c8fb
Read in and display a readme.md file for the project
benbrown 1be5eb0
Merge branch 'main' into benbrown/readmes
benbrown c5788b2
remove errant constant
benbrown 6f3d46a
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown fd85954
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown 415bda8
adding bot project tab view
pavolumMsft a9411c4
Updating botProjectInfo
pavolumMsft b3e0ea2
Adding support for deep linking into settings page
pavolumMsft 83d3336
Merging latest form main and resolving conflict
pavolumMsft d4f6571
Main merge clean up
pavolumMsft 7062fc9
Fixing skills settings dependency
pavolumMsft 7bab94a
Adding bottons for luis and qna provision in settings page
pavolumMsft a15430a
Updating setting after qna and luis provisioning
pavolumMsft 6ad4e83
Merge branch 'main' into benbrown/readmes
pavolum a388c4e
Naming changes for readme modal
pavolumMsft 3bf7cfa
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
pavolumMsft 6bfcdf5
removing unused isBack option
pavolumMsft b2f243e
address feedback
benbrown 3821132
Adding formatMesage
pavolumMsft b679759
Removing unused ref
pavolumMsft cbc2cc3
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown 77ed140
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown ac01860
Temp remove template tag and text
pavolumMsft 7aa06a7
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
pavolumMsft 4b61a62
Removing unused variables and deps
pavolumMsft 6858230
removing unsed imports
pavolumMsft 3f02de5
Resolving merge conflicts
pavolumMsft 17cb268
Adding testIds to tabs in settings page and updating broken integrati…
pavolumMsft c86c43c
Merge branch 'main' into benbrown/readmes
pavolum 80d219d
Fixing Luis deploy test to work with tab experience
pavolumMsft a80a2e4
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
pavolumMsft 1dbdf31
Merging and resolving conflicts
pavolumMsft 9b7bba9
Fixing import in test
pavolumMsft 9fefd80
Fixing header unit test
pavolumMsft 182ad9f
Merge branch 'main' into benbrown/readmes
pavolum ac28eb2
use iconUrl field instead of icon. Fix for https://github.com/microso…
benbrown b426df2
Merge branch 'main' into benbrown/readmes
beyackle 7376c45
read in icon and include it as a data url
benbrown 90f0909
Merge branch 'benbrown/fixicon' into benbrown/readmes
benbrown 8322ca4
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
benbrown 2f13e3c
Merge branch 'benbrown/readmes' of https://github.com/microsoft/BotFr…
benbrown ebb499a
Merge branch 'main' into benbrown/readmes
pavolum 03bfbdf
Simplyfing array inclusion check
pavolumMsft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
Composer/packages/client/src/pages/botProject/BotProjectInfo.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
Composer/packages/client/src/pages/botProject/BotProjectsSettingsTabView.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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].indexOf(htmlIdTagName) !== -1) { | ||
| 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; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.