-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upcoming: [M3-8074] – Add "Disk Encryption" section to Linode Create …
…flow (#10462)
- Loading branch information
1 parent
b64491f
commit 2579ad8
Showing
18 changed files
with
324 additions
and
24 deletions.
There are no files selected for viewing
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/api-v4": Changed | ||
--- | ||
|
||
Add Disk Encryption to AccountCapability type and region Capabilities type ([#10462](https://github.com/linode/manager/pull/10462)) |
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
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": Tests | ||
--- | ||
|
||
Add Cypress test coverage for Disk Encryption in Linode Create flow ([#10462](https://github.com/linode/manager/pull/10462)) |
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10462-upcoming-features-1715896941491.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 Disk Encryption section to Linode Create flow ([#10462](https://github.com/linode/manager/pull/10462)) |
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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useFlags } from 'src/hooks/useFlags'; | ||
import { useAccount } from 'src/queries/account/account'; | ||
|
||
/** | ||
* Hook to determine if the Disk Encryption feature should be visible to the user. | ||
* Based on the user's account capability and the feature flag. | ||
* | ||
* @returns { boolean } - Whether the Disk Encryption feature is enabled for the current user. | ||
*/ | ||
export const useIsDiskEncryptionFeatureEnabled = (): { | ||
isDiskEncryptionFeatureEnabled: boolean; | ||
} => { | ||
const { data: account, error } = useAccount(); | ||
const flags = useFlags(); | ||
|
||
if (error || !flags) { | ||
return { isDiskEncryptionFeatureEnabled: false }; | ||
} | ||
|
||
const hasAccountCapability = account?.capabilities?.includes( | ||
'Disk Encryption' | ||
); | ||
|
||
const isFeatureFlagEnabled = flags.linodeDiskEncryption; | ||
|
||
const isDiskEncryptionFeatureEnabled = Boolean( | ||
hasAccountCapability && isFeatureFlagEnabled | ||
); | ||
|
||
return { isDiskEncryptionFeatureEnabled }; | ||
}; |
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
Oops, something went wrong.