Hide provision throughput checkbox for serverless account (#861)

This commit is contained in:
victor-meng 2021-06-07 21:05:41 -07:00 committed by GitHub
parent ee60f61cfe
commit 16b09df5fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 38 deletions

View File

@ -179,10 +179,12 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
/> />
)} )}
<div className="panelMainContent"> <div className="panelMainContent">
<div> <Stack>
<Stack horizontal> <Stack horizontal>
<span className="mandatoryStar">*</span> <span className="mandatoryStar">*&nbsp;</span>
<Text variant="small">{databaseIdLabel}</Text> <Text className="panelTextBold" variant="small">
{databaseIdLabel}
</Text>
<InfoTooltip>{databaseIdTooltipText}</InfoTooltip> <InfoTooltip>{databaseIdTooltipText}</InfoTooltip>
</Stack> </Stack>
@ -203,6 +205,7 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
styles={{ root: { width: 300 } }} styles={{ root: { width: 300 } }}
/> />
{!isServerlessAccount() && (
<Stack horizontal> <Stack horizontal>
<Checkbox <Checkbox
title="Provision shared throughput" title="Provision shared throughput"
@ -217,6 +220,8 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
/> />
<InfoTooltip>{databaseLevelThroughputTooltipText}</InfoTooltip> <InfoTooltip>{databaseLevelThroughputTooltipText}</InfoTooltip>
</Stack> </Stack>
)}
</Stack>
{!isServerlessAccount() && databaseCreateNewShared && ( {!isServerlessAccount() && databaseCreateNewShared && (
<ThroughputInput <ThroughputInput
@ -229,7 +234,6 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
/> />
)} )}
</div> </div>
</div>
</RightPaneForm> </RightPaneForm>
); );
}; };

View File

@ -10,16 +10,17 @@ exports[`AddDatabasePane Pane should render Default properly 1`] = `
<div <div
className="panelMainContent" className="panelMainContent"
> >
<div> <Stack>
<Stack <Stack
horizontal={true} horizontal={true}
> >
<span <span
className="mandatoryStar" className="mandatoryStar"
> >
* * 
</span> </span>
<Text <Text
className="panelTextBold"
variant="small" variant="small"
> >
Database id Database id
@ -82,6 +83,7 @@ exports[`AddDatabasePane Pane should render Default properly 1`] = `
Provisioned throughput at the database level will be shared across all collections within the database. Provisioned throughput at the database level will be shared across all collections within the database.
</InfoTooltip> </InfoTooltip>
</Stack> </Stack>
</Stack>
<ThroughputInput <ThroughputInput
isDatabase={true} isDatabase={true}
isSharded={true} isSharded={true}
@ -90,6 +92,5 @@ exports[`AddDatabasePane Pane should render Default properly 1`] = `
setThroughputValue={[Function]} setThroughputValue={[Function]}
/> />
</div> </div>
</div>
</RightPaneForm> </RightPaneForm>
`; `;