-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upcoming: [M3-8420] β Add conditionally-displayed reboot notice on Volume Create page #10868
Merged
dwiley-akamai
merged 9 commits into
linode:develop
from
dwiley-akamai:M3-8420-reboot-warning-volume-create
Sep 10, 2024
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dc4aae7
Conditionally display client update required copy in Volume Create flβ¦
DevDW bd5298c
Sort imports
DevDW 70aa5a6
Align items to baseline, remove conditional
DevDW b53e86d
Only display client library update notice if checkbox has been checkeβ¦
DevDW 641e94c
E2E coverage for scenarios on Volume Create page
DevDW 55ee22d
Added changeset: Add conditional client library update required rebooβ¦
DevDW 98146d1
Tighten up disabled logic for Create Volume button
DevDW fa29499
Merge in latest develop; resolve conflicts
DevDW ac9fefa
E2E coverage for case where selected linode supports BSE
DevDW 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
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10868-upcoming-features-1725546685590.md
This file contains 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,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Add conditional client library update required reboot notice to Volume Create page ([#10868](https://github.com/linode/manager/pull/10868)) |
This file contains 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 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 | ||||
---|---|---|---|---|---|---|
|
@@ -11,6 +11,7 @@ import { Button } from 'src/components/Button/Button'; | |||||
import { DocumentTitleSegment } from 'src/components/DocumentTitle'; | ||||||
import { | ||||||
BLOCK_STORAGE_CHOOSE_REGION_COPY, | ||||||
BLOCK_STORAGE_CLIENT_LIBRARY_UPDATE_REQUIRED_COPY, | ||||||
BLOCK_STORAGE_ENCRYPTION_GENERAL_DESCRIPTION, | ||||||
BLOCK_STORAGE_ENCRYPTION_OVERHEAD_CAVEAT, | ||||||
BLOCK_STORAGE_ENCRYPTION_UNAVAILABLE_IN_REGION_COPY, | ||||||
|
@@ -23,6 +24,7 @@ import { LandingHeader } from 'src/components/LandingHeader'; | |||||
import { Notice } from 'src/components/Notice/Notice'; | ||||||
import { Paper } from 'src/components/Paper'; | ||||||
import { RegionSelect } from 'src/components/RegionSelect/RegionSelect'; | ||||||
import { Stack } from 'src/components/Stack'; | ||||||
import { TextField } from 'src/components/TextField'; | ||||||
import { TooltipIcon } from 'src/components/TooltipIcon'; | ||||||
import { Typography } from 'src/components/Typography'; | ||||||
|
@@ -35,6 +37,7 @@ import { | |||||
useAccountAgreements, | ||||||
useMutateAccountAgreements, | ||||||
} from 'src/queries/account/agreements'; | ||||||
import { useLinodeQuery } from 'src/queries/linodes/linodes'; | ||||||
import { useGrants, useProfile } from 'src/queries/profile/profile'; | ||||||
import { useRegionsQuery } from 'src/queries/regions/regions'; | ||||||
import { | ||||||
|
@@ -240,6 +243,15 @@ export const VolumeCreate = () => { | |||||
|
||||||
const { config_id, linode_id } = values; | ||||||
|
||||||
const { data: linode } = useLinodeQuery( | ||||||
linode_id ?? -1, | ||||||
isBlockStorageEncryptionFeatureEnabled | ||||||
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. Late to this PR, but noticed a minor issue that can be resolved in a later change: To prevent an API call for
Suggested change
|
||||||
); | ||||||
|
||||||
const linodeSupportsBlockStorageEncryption = Boolean( | ||||||
linode?.capabilities?.includes('blockstorage_encryption') | ||||||
); | ||||||
|
||||||
const linodeError = touched.linode_id ? errors.linode_id : undefined; | ||||||
|
||||||
const { showGDPRCheckbox } = getGDPRDetails({ | ||||||
|
@@ -283,6 +295,11 @@ export const VolumeCreate = () => { | |||||
} | ||||||
}; | ||||||
|
||||||
const shouldDisplayClientLibraryCopy = | ||||||
isBlockStorageEncryptionFeatureEnabled && | ||||||
values.linode_id !== null && | ||||||
!linodeSupportsBlockStorageEncryption; | ||||||
|
||||||
return ( | ||||||
<> | ||||||
<DocumentTitleSegment segment="Create a Volume" /> | ||||||
|
@@ -363,47 +380,57 @@ export const VolumeCreate = () => { | |||||
)} | ||||||
</Box> | ||||||
<Box | ||||||
alignItems="flex-end" | ||||||
alignItems="baseline" | ||||||
className={classes.linodeConfigSelectWrapper} | ||||||
display="flex" | ||||||
> | ||||||
<Box | ||||||
alignItems="flex-end" | ||||||
className={classes.linodeSelect} | ||||||
display="flex" | ||||||
> | ||||||
<LinodeSelect | ||||||
optionsFilter={(linode: Linode) => { | ||||||
const linodeRegion = linode.region; | ||||||
const valuesRegion = values.region; | ||||||
|
||||||
/** When values.region is empty, all Linodes with | ||||||
* block storage support will be displayed, regardless | ||||||
* of their region. However, if a region is selected, | ||||||
* only Linodes from the chosen region with block storage | ||||||
* support will be shown. */ | ||||||
return isNilOrEmpty(valuesRegion) | ||||||
? regionsWithBlockStorage.includes(linodeRegion) | ||||||
: regionsWithBlockStorage.includes(linodeRegion) && | ||||||
linodeRegion === valuesRegion; | ||||||
}} | ||||||
sx={{ | ||||||
[theme.breakpoints.down('sm')]: { | ||||||
width: 320, | ||||||
}, | ||||||
width: '400px', | ||||||
}} | ||||||
clearable | ||||||
disabled={doesNotHavePermission} | ||||||
errorText={linodeError} | ||||||
onBlur={handleBlur} | ||||||
onSelectionChange={handleLinodeChange} | ||||||
value={values.linode_id} | ||||||
/> | ||||||
{renderSelectTooltip( | ||||||
'If you select a Linode, the Volume will be automatically created in that Linodeβs region and attached upon creation.' | ||||||
)} | ||||||
</Box> | ||||||
<Stack> | ||||||
<Box | ||||||
alignItems="flex-end" | ||||||
className={classes.linodeSelect} | ||||||
display="flex" | ||||||
> | ||||||
<LinodeSelect | ||||||
optionsFilter={(linode: Linode) => { | ||||||
const linodeRegion = linode.region; | ||||||
const valuesRegion = values.region; | ||||||
|
||||||
/** When values.region is empty, all Linodes with | ||||||
* block storage support will be displayed, regardless | ||||||
* of their region. However, if a region is selected, | ||||||
* only Linodes from the chosen region with block storage | ||||||
* support will be shown. */ | ||||||
return isNilOrEmpty(valuesRegion) | ||||||
? regionsWithBlockStorage.includes(linodeRegion) | ||||||
: regionsWithBlockStorage.includes(linodeRegion) && | ||||||
linodeRegion === valuesRegion; | ||||||
}} | ||||||
sx={{ | ||||||
[theme.breakpoints.down('sm')]: { | ||||||
width: 320, | ||||||
}, | ||||||
width: '400px', | ||||||
}} | ||||||
clearable | ||||||
disabled={doesNotHavePermission} | ||||||
errorText={linodeError} | ||||||
onBlur={handleBlur} | ||||||
onSelectionChange={handleLinodeChange} | ||||||
value={values.linode_id} | ||||||
/> | ||||||
{renderSelectTooltip( | ||||||
'If you select a Linode, the Volume will be automatically created in that Linodeβs region and attached upon creation.' | ||||||
)} | ||||||
</Box> | ||||||
{shouldDisplayClientLibraryCopy && | ||||||
values.encryption === 'enabled' && ( | ||||||
<Notice spacingBottom={0} spacingTop={16} variant="warning"> | ||||||
<Typography maxWidth="416px"> | ||||||
{BLOCK_STORAGE_CLIENT_LIBRARY_UPDATE_REQUIRED_COPY} | ||||||
</Typography> | ||||||
</Notice> | ||||||
)} | ||||||
</Stack> | ||||||
<ConfigSelect | ||||||
disabled={doesNotHavePermission || config_id === null} | ||||||
error={touched.config_id ? errors.config_id : undefined} | ||||||
|
@@ -473,6 +500,12 @@ export const VolumeCreate = () => { | |||||
</Paper> | ||||||
<Box display="flex" justifyContent="flex-end"> | ||||||
<Button | ||||||
disabled={ | ||||||
disabled || | ||||||
(isBlockStorageEncryptionFeatureEnabled && | ||||||
!linodeSupportsBlockStorageEncryption && | ||||||
values.encryption === 'enabled') | ||||||
} | ||||||
tooltipText={ | ||||||
!isLoading && isInvalidPrice | ||||||
? PRICES_RELOAD_ERROR_NOTICE_TEXT | ||||||
|
@@ -481,7 +514,6 @@ export const VolumeCreate = () => { | |||||
buttonType="primary" | ||||||
className={classes.button} | ||||||
data-qa-deploy-linode | ||||||
disabled={disabled} | ||||||
loading={isSubmitting} | ||||||
style={{ marginLeft: 12 }} | ||||||
type="submit" | ||||||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When manually testing, rebooting a linode without the bse capability didn't result in an upgraded qemu version/bse capability for me - not sure if that's expected in dev. I might have missed it, but wasn't seeing anywhere in tests where we were confirming that a user with a bse capability on the linode would no longer see the checkbox. Did we want to confirm this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised the reboot --> upgrade question in the project channel, not sure if that is fully in place yet.
Added test coverage for the case where the linode supports BSE