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
fix: Display error w/o token on auth failure #6576
Merged
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b517a91
Display error w/o token on auth failure
GeoffCoxMSFT fa6089f
Merge branch 'main' into gcox/fix6359
GeoffCoxMSFT 728980e
Merge branch 'main' into gcox/fix6359
GeoffCoxMSFT e26cbc4
Merge branch 'main' into gcox/fix6359
GeoffCoxMSFT 7b15a5f
Merge branch 'main' into gcox/fix6359
GeoffCoxMSFT 497418c
Merge branch 'gcox/fix6359' of https://github.com/microsoft/BotFramew…
GeoffCoxMSFT a822e0d
Fixed mounted checks
GeoffCoxMSFT 3a69c85
Merge branch 'main' into gcox/fix6359
GeoffCoxMSFT e192125
Merge branch 'main' into gcox/fix6359
benbrown 2139053
Merge branch 'main' into gcox/fix6359
GeoffCoxMSFT 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,12 @@ const AddResourcesSectionName = styled(Text)` | |
| font-size: ${FluentTheme.fonts.mediumPlus.fontSize}; | ||
| `; | ||
|
|
||
| const labelTooltipStyles = { | ||
| root: { | ||
| userSelect: 'none', | ||
| }, | ||
| }; | ||
|
|
||
| const iconStyle = (required) => { | ||
| return { | ||
| root: { | ||
|
|
@@ -124,7 +130,7 @@ const onRenderLabel = (props) => { | |
| {' '} | ||
| {props.label}{' '} | ||
| </div> | ||
| <TooltipHost content={props.ariaLabel}> | ||
| <TooltipHost content={props.ariaLabel} styles={labelTooltipStyles}> | ||
| <Icon iconName="Info" styles={iconStyle(props.required)} /> | ||
| </TooltipHost> | ||
| </div> | ||
|
|
@@ -229,6 +235,7 @@ export const AzureProvisionDialog: React.FC = () => { | |
| const extensionState = { ...defaultExtensionState, ...getItem(profileName) }; | ||
|
|
||
| const [subscriptions, setSubscriptions] = useState<Subscription[] | undefined>(); | ||
| const [subscriptionsErrorMessage, setSubscriptionsErrorMessage] = useState<string>(); | ||
| const [deployLocations, setDeployLocations] = useState<DeployLocation[]>([]); | ||
| const [luisLocations, setLuisLocations] = useState<DeployLocation[]>([]); | ||
|
|
||
|
|
@@ -376,11 +383,24 @@ export const AzureProvisionDialog: React.FC = () => { | |
|
|
||
| useEffect(() => { | ||
| if (token) { | ||
| getSubscriptions(token).then((data) => { | ||
| if (isMounted.current) { | ||
| setSubscriptions(data); | ||
| } | ||
| }); | ||
| setSubscriptionsErrorMessage(undefined); | ||
| getSubscriptions(token) | ||
| .then((data) => { | ||
| if (isMounted.current) { | ||
| setSubscriptions(data); | ||
| if (data.length === 0) { | ||
| setSubscriptionsErrorMessage( | ||
| formatMessage( | ||
| 'Your subscription list is empty, please add your subscription, or login with another account.' | ||
| ) | ||
| ); | ||
| } | ||
| } | ||
| }) | ||
| .catch((err) => { | ||
| setSubscriptionsErrorMessage(err.message); | ||
| }); | ||
|
|
||
| getResources(); | ||
| } | ||
| }, [token]); | ||
|
|
@@ -407,7 +427,7 @@ export const AzureProvisionDialog: React.FC = () => { | |
| loadResourceGroups(); | ||
| }, [token, currentSubscription]); | ||
|
|
||
| const subscriptionOption = useMemo(() => { | ||
| const subscriptionOptions = useMemo(() => { | ||
| return subscriptions?.map((t) => ({ key: t.subscriptionId, text: t.displayName })); | ||
| }, [subscriptions]); | ||
|
|
||
|
|
@@ -563,6 +583,7 @@ export const AzureProvisionDialog: React.FC = () => { | |
| !currentResourceGroupName || | ||
| !currentHostName || | ||
| !currentLocation || | ||
| subscriptionsErrorMessage || | ||
| errorResourceGroupName || | ||
| errorHostName !== '' | ||
| ); | ||
|
|
@@ -599,10 +620,12 @@ export const AzureProvisionDialog: React.FC = () => { | |
| </div> | ||
| <div style={{ flex: 1, height: '100%' }}> | ||
| <Suspense fallback={<Spinner label={formatMessage('Loading')} />}> | ||
| {subscriptionOption?.length > 0 && choice.key === 'create' && ( | ||
| {choice.key === 'create' && ( | ||
| <form style={{ width: '100%' }}> | ||
| <Dropdown | ||
| required | ||
| ariaLabel={formatMessage( | ||
| 'The Azure AD directory includes the tenant’s users, groups, and apps and is used to perform identity and access management functions for tenant resources.' | ||
| )} | ||
| disabled={allTenants.length === 1 || currentConfig?.tenantId} | ||
| errorMessage={loginErrorMsg} | ||
| label={formatMessage('Azure Directory')} | ||
|
|
@@ -612,22 +635,17 @@ export const AzureProvisionDialog: React.FC = () => { | |
| onChange={(_e, o) => { | ||
| setSelectedTenant(o.key as string); | ||
| }} | ||
| onRenderLabel={onRenderLabel} | ||
| /> | ||
| <Dropdown | ||
| required | ||
| ariaLabel={formatMessage('All resources in an Azure subscription are billed together')} | ||
| defaultSelectedKey={currentSubscription} | ||
| disabled={currentConfig?.subscriptionId} | ||
| errorMessage={ | ||
| currentUser && subscriptionOption?.length < 1 | ||
| ? formatMessage( | ||
| 'Your subscription list is empty, please add your subscription, or login with another account.' | ||
| ) | ||
| : undefined | ||
| } | ||
| errorMessage={subscriptionsErrorMessage} | ||
| label={formatMessage('Subscription')} | ||
| options={subscriptionOption} | ||
| options={subscriptionOptions} | ||
| placeholder={formatMessage('Select one')} | ||
| selectedKey={currentSubscription} | ||
| styles={{ root: { paddingBottom: '8px' } }} | ||
| onChange={(_e, o: IDropdownOption) => { | ||
| setCurrentSubscription(o.key as string); | ||
|
|
@@ -766,7 +784,7 @@ export const AzureProvisionDialog: React.FC = () => { | |
| items={optionalListItems} | ||
| selectedKeys={selectedResourceKeys} | ||
| onSelectionChanged={(keys) => { | ||
| const newSelection = listItems.filter((item) => item.required === true || keys.includes(item.key)); | ||
| const newSelection = optionalListItems.filter((item) => keys.includes(item.key)); | ||
| setEnabledResources(newSelection); | ||
| }} | ||
| /> | ||
|
|
@@ -885,7 +903,7 @@ export const AzureProvisionDialog: React.FC = () => { | |
| onClick={() => { | ||
| setPage(PageTypes.ReviewResource); | ||
| setTitle(DialogTitle.REVIEW); | ||
| let selectedResources = enabledResources.slice(); | ||
| let selectedResources = requireResources.concat(enabledResources); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: [...arr1, ...arr2] |
||
| selectedResources = selectedResources.map((item) => { | ||
| let region = currentConfig?.region || currentLocation; | ||
| if (item.key.includes('luis')) { | ||
|
|
||
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.