Remove networking warning message for sql, gremlin, and tables api (#1388)

This commit is contained in:
victor-meng 2023-02-06 12:51:04 -08:00 committed by GitHub
parent 850f1dfb97
commit 80dd161a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 10 deletions

View File

@ -234,6 +234,29 @@ exports[`AddCollectionPanel should render Default properly 1`] = `
type="text" type="text"
value="" value=""
/> />
<Stack
className="panelGroupSpacing"
>
<CustomizedDefaultButton
disabled={false}
hidden={false}
onClick={[Function]}
styles={
Object {
"label": Object {
"fontSize": 12,
},
"root": Object {
"height": 30,
"padding": 0,
"width": 250,
},
}
}
>
Add hierarchical partition key (preview)
</CustomizedDefaultButton>
</Stack>
</Stack> </Stack>
<Stack> <Stack>
<Stack <Stack

View File

@ -10,7 +10,7 @@ const PortalIPs: { [key: string]: string[] } = {
usnat: ["7.28.202.68"], usnat: ["7.28.202.68"],
}; };
export const getNetworkSettingsWarningMessage = (clientIpAddress: string): string => { export const getNetworkSettingsWarningMessage = (): string => {
const accountProperties = userContext.databaseAccount?.properties; const accountProperties = userContext.databaseAccount?.properties;
if (!accountProperties) { if (!accountProperties) {
@ -40,13 +40,7 @@ export const getNetworkSettingsWarningMessage = (clientIpAddress: string): strin
if (numberOfMatches !== portalIPs.length) { if (numberOfMatches !== portalIPs.length) {
return "The Network settings for this account are preventing access from Data Explorer. Please allow access from Azure Portal to proceed."; return "The Network settings for this account are preventing access from Data Explorer. Please allow access from Azure Portal to proceed.";
} }
return "";
} else {
if (!clientIpAddress || ipRules.some((ipRule) => ipRule.ipAddressOrRange === clientIpAddress)) {
return "";
}
return "The Network settings for this account are preventing access from Data Explorer. Please add your current IP to the firewall rules to proceed.";
} }
return "";
}; };

View File

@ -382,7 +382,7 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
} }
} }
const warningMessage = getNetworkSettingsWarningMessage(inputs.clientIpAddress); const warningMessage = getNetworkSettingsWarningMessage();
useTabs.getState().setNetworkSettingsWarning(warningMessage); useTabs.getState().setNetworkSettingsWarning(warningMessage);
if (inputs.features) { if (inputs.features) {