Repository navigation
refactor: [M3-7687] - Linodes Restricted User Experience 2/2 #10227
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a9f7edd
refactor: [M3-7687] - Linodes Restricted User Experience 2/2
jaalah fced8ed
Added changeset: Overall improvement to Linodes restricted experience.
jaalah a544c82
Review updates
jaalah e095f63
Get latest
jaalah 6d7d1dc
Update packages/manager/.changeset/pr-10227-tech-stories-170898686636β¦
jaalah-akamai 74ef4a4
Card view
jaalah b83b7fa
Merge branch 'M3-7687-v2' of github.com:jaalah-akamai/manager into M3β¦
jaalah 5c64517
Remove overly broad tests
jaalah a4a3552
Revert some stuff
jaalah a985ffd
Review update
jaalah 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-10227-tech-stories-1708986866364.md
This file contains hidden or 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": Tech Stories | ||
| --- | ||
|
|
||
| Improve the Linodes restricted user experience ([#10227](https://github.com/linode/manager/pull/10227)) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| import * as React from 'react'; | ||
|
|
||
| import { EntityDetail } from 'src/components/EntityDetail/EntityDetail'; | ||
| import { Notice } from 'src/components/Notice/Notice'; | ||
| import { getRestrictedResourceText } from 'src/features/Account/utils'; | ||
| import { notificationContext as _notificationContext } from 'src/features/NotificationCenter/NotificationContext'; | ||
| import { useIsResourceRestricted } from 'src/hooks/useIsResourceRestricted'; | ||
| import { useVPCConfigInterface } from 'src/hooks/useVPCConfigInterface'; | ||
| import { useInProgressEvents } from 'src/queries/events/events'; | ||
| import { useAllImagesQuery } from 'src/queries/images'; | ||
|
|
@@ -64,6 +67,12 @@ export const LinodeEntityDetail = (props: Props) => { | |
| vpcLinodeIsAssignedTo, | ||
| } = useVPCConfigInterface(linode.id); | ||
|
|
||
| const isLinodesGrantReadOnly = useIsResourceRestricted({ | ||
| grantLevel: 'read_only', | ||
| grantType: 'linode', | ||
| id: linode.id, | ||
| }); | ||
|
|
||
| const imageVendor = | ||
| images?.find((i) => i.id === linode.image)?.vendor ?? null; | ||
|
|
||
|
|
@@ -83,55 +92,67 @@ export const LinodeEntityDetail = (props: Props) => { | |
| const trimmedIPv6 = linode.ipv6?.replace('/128', '') || null; | ||
|
|
||
| return ( | ||
| <EntityDetail | ||
| body={ | ||
| <LinodeEntityDetailBody | ||
| configInterfaceWithVPC={configInterfaceWithVPC} | ||
| displayVPCSection={showVPCs} | ||
| gbRAM={linode.specs.memory / 1024} | ||
| gbStorage={linode.specs.disk / 1024} | ||
| ipv4={linode.ipv4} | ||
| ipv6={trimmedIPv6} | ||
| isVPCOnlyLinode={isVPCOnlyLinode} | ||
| linodeId={linode.id} | ||
| linodeLabel={linode.label} | ||
| numCPUs={linode.specs.vcpus} | ||
| numVolumes={numberOfVolumes} | ||
| region={linode.region} | ||
| vpcLinodeIsAssignedTo={vpcLinodeIsAssignedTo} | ||
| /> | ||
| } | ||
| footer={ | ||
| <LinodeEntityDetailFooter | ||
| linodeCreated={linode.created} | ||
| linodeId={linode.id} | ||
| linodeLabel={linode.label} | ||
| linodePlan={linodePlan} | ||
| linodeRegionDisplay={linodeRegionDisplay} | ||
| linodeTags={linode.tags} | ||
| openTagDrawer={openTagDrawer} | ||
| /> | ||
| } | ||
| header={ | ||
| <LinodeEntityDetailHeader | ||
| backups={linode.backups} | ||
| configs={configs} | ||
| enableVPCLogic={showVPCs} | ||
| handlers={handlers} | ||
| image={linode.image ?? 'Unknown Image'} | ||
| imageVendor={imageVendor} | ||
| isSummaryView={isSummaryView} | ||
| linodeId={linode.id} | ||
| linodeLabel={linode.label} | ||
| linodeRegionDisplay={linodeRegionDisplay} | ||
| linodeStatus={linode.status} | ||
| openNotificationMenu={notificationContext.openMenu} | ||
| progress={progress} | ||
| transitionText={transitionText} | ||
| type={type ?? null} | ||
| variant={variant} | ||
| <> | ||
| {isLinodesGrantReadOnly && ( | ||
| <Notice | ||
| text={getRestrictedResourceText({ | ||
| resourceType: 'Linodes', | ||
| })} | ||
| important | ||
| variant="warning" | ||
|
Contributor
Author
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. New page level notice |
||
| /> | ||
| } | ||
| /> | ||
| )} | ||
| <EntityDetail | ||
| body={ | ||
| <LinodeEntityDetailBody | ||
| configInterfaceWithVPC={configInterfaceWithVPC} | ||
| displayVPCSection={showVPCs} | ||
| gbRAM={linode.specs.memory / 1024} | ||
| gbStorage={linode.specs.disk / 1024} | ||
| ipv4={linode.ipv4} | ||
| ipv6={trimmedIPv6} | ||
| isVPCOnlyLinode={isVPCOnlyLinode} | ||
| linodeId={linode.id} | ||
| linodeLabel={linode.label} | ||
| numCPUs={linode.specs.vcpus} | ||
| numVolumes={numberOfVolumes} | ||
| region={linode.region} | ||
| vpcLinodeIsAssignedTo={vpcLinodeIsAssignedTo} | ||
| /> | ||
| } | ||
| footer={ | ||
| <LinodeEntityDetailFooter | ||
| isLinodesGrantReadOnly={isLinodesGrantReadOnly} | ||
| linodeCreated={linode.created} | ||
| linodeId={linode.id} | ||
| linodeLabel={linode.label} | ||
| linodePlan={linodePlan} | ||
| linodeRegionDisplay={linodeRegionDisplay} | ||
| linodeTags={linode.tags} | ||
| openTagDrawer={openTagDrawer} | ||
| /> | ||
| } | ||
| header={ | ||
| <LinodeEntityDetailHeader | ||
| backups={linode.backups} | ||
| configs={configs} | ||
| enableVPCLogic={showVPCs} | ||
| handlers={handlers} | ||
| image={linode.image ?? 'Unknown Image'} | ||
| imageVendor={imageVendor} | ||
| isSummaryView={isSummaryView} | ||
| linodeId={linode.id} | ||
| linodeLabel={linode.label} | ||
| linodeRegionDisplay={linodeRegionDisplay} | ||
| linodeStatus={linode.status} | ||
| openNotificationMenu={notificationContext.openMenu} | ||
| progress={progress} | ||
| transitionText={transitionText} | ||
| type={type ?? null} | ||
| variant={variant} | ||
| /> | ||
| } | ||
| /> | ||
| </> | ||
| ); | ||
| }; | ||
This file contains hidden or 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.
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.
These are conditional props to disable the empty state landing page button