Repository navigation
upcoming: [M3-7857] - Account Management Copy Updates & Improvements #10270
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
Changes from all commits
4083fce
d46ca3b
882c435
3b2e2b7
d0bd01b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Upcoming Features | ||
| --- | ||
|
|
||
| Parent/Child Account Management Copy Updates & Improvements ([#10270](https://github.com/linode/manager/pull/10270)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,8 @@ import { useProfile } from 'src/queries/profile'; | |
| import CloseAccountDialog from './CloseAccountDialog'; | ||
| import { | ||
| CHILD_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT, | ||
| PARENT_PROXY_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT, | ||
| PARENT_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT, | ||
| PROXY_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT, | ||
| } from './constants'; | ||
|
|
||
| const CloseAccountSetting = () => { | ||
|
|
@@ -22,10 +23,21 @@ const CloseAccountSetting = () => { | |
| const isCloseAccountDisabled = Boolean( | ||
| flags.parentChildAccountAccess && profile?.user_type !== 'default' | ||
| ); | ||
| const closeAccountButtonTooltipText = | ||
| isCloseAccountDisabled && profile?.user_type === 'child' | ||
| ? CHILD_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT | ||
| : PARENT_PROXY_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT; | ||
|
|
||
| let closeAccountButtonTooltipText; | ||
| const userType = profile?.user_type; | ||
| const caseKey = isCloseAccountDisabled ? userType : 'default'; | ||
|
|
||
| switch (caseKey) { | ||
|
Comment on lines
+29
to
+31
Contributor
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. Slightly unfortunate to also have a |
||
| case 'child': | ||
| closeAccountButtonTooltipText = CHILD_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT; | ||
| break; | ||
| case 'proxy': | ||
| closeAccountButtonTooltipText = PROXY_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT; | ||
| break; | ||
| default: | ||
| closeAccountButtonTooltipText = PARENT_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT; | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,8 @@ import { Token } from '@linode/api-v4/lib/profile'; | |
| import Grid from '@mui/material/Unstable_Grid2'; | ||
| import * as React from 'react'; | ||
|
|
||
| import AddNewLink from 'src/components/AddNewLink'; | ||
| import { Box } from 'src/components/Box'; | ||
| import { Button } from 'src/components/Button/Button'; | ||
| import { DateTimeDisplay } from 'src/components/DateTimeDisplay'; | ||
| import { PaginationFooter } from 'src/components/PaginationFooter/PaginationFooter'; | ||
| import { Table } from 'src/components/Table'; | ||
|
|
@@ -17,6 +17,7 @@ import { TableRowLoading } from 'src/components/TableRowLoading/TableRowLoading' | |
| import { StyledTableSortCell } from 'src/components/TableSortCell/StyledTableSortCell'; | ||
| import { TableSortCell } from 'src/components/TableSortCell/TableSortCell'; | ||
| import { Typography } from 'src/components/Typography'; | ||
| import { PROXY_USER_RESTRICTED_TOOLTIP_TEXT } from 'src/features/Account/constants'; | ||
| import { SecretTokenDialog } from 'src/features/Profile/SecretTokenDialog/SecretTokenDialog'; | ||
| import { useFlags } from 'src/hooks/useFlags'; | ||
| import { useOrder } from 'src/hooks/useOrder'; | ||
|
|
@@ -205,16 +206,16 @@ export const APITokenTable = (props: Props) => { | |
| </Grid> | ||
| <StyledAddNewWrapper> | ||
| {type === 'Personal Access Token' && ( | ||
| <AddNewLink | ||
| disabledReason={ | ||
| isProxyUser | ||
| ? 'You can only create tokens for your own company.' | ||
| : undefined | ||
| <Button | ||
|
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. Changed this to a |
||
| tooltipText={ | ||
| isProxyUser ? PROXY_USER_RESTRICTED_TOOLTIP_TEXT : undefined | ||
|
Contributor
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. This tooltip now reads "You can't perform this action on child accounts." instead of "You canβt create access tokens for child accounts. Instead, switch to your account and create the token there." -- just verifying this is an intentional change.
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. Yes - let me update PR π |
||
| } | ||
| buttonType="primary" | ||
| disabled={isProxyUser} | ||
| label="Create a Personal Access Token" | ||
| onClick={() => setIsCreateOpen(true)} | ||
| /> | ||
| > | ||
| Create a Personal Access Token | ||
| </Button> | ||
| )} | ||
| </StyledAddNewWrapper> | ||
| </StyledRootContainer> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGran | |
| import { useAccount } from 'src/queries/account'; | ||
| import { useGrants, useProfile } from 'src/queries/profile'; | ||
| import { sendSwitchAccountEvent } from 'src/utilities/analytics'; | ||
| import { getStorage } from 'src/utilities/storage'; | ||
| import { getStorage, setStorage } from 'src/utilities/storage'; | ||
|
|
||
| interface MenuLink { | ||
| display: string; | ||
|
|
@@ -120,7 +120,10 @@ export const UserMenu = React.memo(() => { | |
|
|
||
| React.useEffect(() => { | ||
| // Run after we've switched to a proxy user. | ||
| if (isProxyUser) { | ||
| if (isProxyUser && !getStorage('proxy_user')) { | ||
| // Flag for proxy user to display success toast once. | ||
| setStorage('proxy_user', 'true'); | ||
|
jaalah-akamai marked this conversation as resolved.
|
||
|
|
||
| enqueueSnackbar(`Account switched to ${companyNameOrEmail}.`, { | ||
| variant: 'success', | ||
| }); | ||
|
|
@@ -270,7 +273,7 @@ export const UserMenu = React.memo(() => { | |
| > | ||
| <Stack data-qa-user-menu minWidth={250} spacing={2}> | ||
| {canSwitchBetweenParentOrProxyAccount && ( | ||
| <Typography>You are currently logged in as:</Typography> | ||
| <Typography>Current account:</Typography> | ||
|
Contributor
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. For posterity: this was an ask by UX, so it's an update to stay true to the mocks. It does feel a bit different from other Cloud Manager helper text in language/tone. (To me, "Current user" seems like a console statement just printed to the screen π .) Perhaps we can revisit in the future with feedback from stakeholders (Product, resellers). |
||
| )} | ||
| <Typography | ||
| color={(theme) => theme.textColors.headlineStatic} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.