From bc92cb91ebeb6ed223156cf8293bb32ccd38f48e Mon Sep 17 00:00:00 2001 From: "Craig Boger (from Dev Box)" Date: Mon, 30 Dec 2024 15:51:56 -0800 Subject: [PATCH] Change to only selecting region for cosmos client. Not setting up separate read and write clients. --- .../Panes/SettingsPane/SettingsPane.tsx | 32 ++----------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx index 2817b19e5..6a9989b13 100644 --- a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx +++ b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx @@ -150,11 +150,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ ? LocalStorageUtility.getEntryString(StorageKey.ReadRegion) : userContext?.databaseAccount?.properties?.readLocations?.[0]?.locationName, ); - const [writeRegion, setWriteRegion] = useState( - LocalStorageUtility.hasItem(StorageKey.WriteRegion) - ? LocalStorageUtility.getEntryString(StorageKey.WriteRegion) - : userContext?.databaseAccount?.properties?.writeLocations?.[0]?.locationName, - ); const [retryAttempts, setRetryAttempts] = useState( LocalStorageUtility.hasItem(StorageKey.RetryAttempts) ? LocalStorageUtility.getEntryNumber(StorageKey.RetryAttempts) @@ -197,10 +192,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ key: location.locationName, text: location.locationName, })); - const writeRegionOptions = userContext?.databaseAccount?.properties?.writeLocations?.map((location) => ({ - key: location.locationName, - text: location.locationName, - })); const shouldShowCopilotSampleDBOption = userContext.apiType === "SQL" && useQueryCopilot.getState().copilotEnabled && @@ -289,7 +280,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ LocalStorageUtility.setEntryBoolean(StorageKey.RUThresholdEnabled, ruThresholdEnabled); LocalStorageUtility.setEntryBoolean(StorageKey.QueryTimeoutEnabled, queryTimeoutEnabled); LocalStorageUtility.setEntryString(StorageKey.ReadRegion, readRegion); - LocalStorageUtility.setEntryString(StorageKey.WriteRegion, writeRegion); LocalStorageUtility.setEntryNumber(StorageKey.RetryAttempts, retryAttempts); LocalStorageUtility.setEntryNumber(StorageKey.RetryInterval, retryInterval); LocalStorageUtility.setEntryNumber(StorageKey.MaxWaitTimeInSeconds, MaxWaitTimeInSeconds); @@ -442,11 +432,6 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({ setReadRegion(option.text); }; - const handleOnWriteRegionOptionChange = (ev: React.FormEvent, option: IDropdownOption): void => { - // TODO: Region Validation? - setWriteRegion(option.text); - }; - const handleOnQueryRetryAttemptsSpinButtonChange = (ev: React.MouseEvent, newValue?: string): void => { const retryAttempts = Number(newValue); if (!isNaN(retryAttempts)) { @@ -711,12 +696,12 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({
- Select region for read and write operations. + Changes region the Cosmos Client uses to access account.
- Read Region + Select Region - Changes the account endpoint used to perform read operations. + Changes the account endpoint used to perform client operations.
= ({ options={readRegionOptions} styles={{ root: { marginBottom: "10px" } }} /> -
- Write Region - - Changes the account endpoint used to perform write operations. - -
-