diff --git a/packages/manager/.changeset/pr-10259-upcoming-features-1709654629410.md b/packages/manager/.changeset/pr-10259-upcoming-features-1709654629410.md new file mode 100644 index 00000000000..7b9923bfbd5 --- /dev/null +++ b/packages/manager/.changeset/pr-10259-upcoming-features-1709654629410.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Change Business Partner to Parent User ([#10259](https://github.com/linode/manager/pull/10259)) diff --git a/packages/manager/cypress/e2e/core/account/account-login-history.spec.ts b/packages/manager/cypress/e2e/core/account/account-login-history.spec.ts index c06eb3c2959..797e97edccf 100644 --- a/packages/manager/cypress/e2e/core/account/account-login-history.spec.ts +++ b/packages/manager/cypress/e2e/core/account/account-login-history.spec.ts @@ -12,6 +12,7 @@ import { } from 'support/intercepts/feature-flags'; import { mockGetProfile } from 'support/intercepts/profile'; import { makeFeatureFlagData } from 'support/util/feature-flags'; +import { PARENT_USER } from 'src/features/Account/constants'; describe('Account login history', () => { /* @@ -130,7 +131,7 @@ describe('Account login history', () => { cy.findByLabelText('Account Logins').should('not.exist'); cy.findByText( - "You don't have permissions to edit this Account. Please contact your business partner to request the necessary permissions." + `You don't have permissions to edit this Account. Please contact your ${PARENT_USER} to request the necessary permissions.` ); }); diff --git a/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts b/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts index ea9654cc200..e7cc216163a 100644 --- a/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts +++ b/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts @@ -22,6 +22,7 @@ import { ui } from 'support/ui'; import { shuffleArray } from 'support/util/arrays'; import { makeFeatureFlagData } from 'support/util/feature-flags'; import { randomLabel } from 'support/util/random'; +import { PARENT_USER } from 'src/features/Account/constants'; // Message shown when user has unrestricted account acess. const unrestrictedAccessMessage = @@ -561,8 +562,8 @@ describe('User permission management', () => { /** * Confirm the Users & Grants and User Permissions pages flow for a child account viewing a proxy user. - * Confirm that "Business partner settings" and "User settings" sections are present on the Users & Grants page. - * Confirm that proxy accounts are listed under "Business partner settings". + * Confirm that "Parent User Settings" and "User Settings" sections are present on the Users & Grants page. + * Confirm that proxy accounts are listed under "Parent User Settings". * Confirm that clicking the "Manage Access" button navigates to the proxy user's User Permissions page at /account/users/:user/permissions. * Confirm that no "Profile" tab is present on the proxy user's User Permissions page. * Confirm that proxy accounts default to "Read Write" Billing Access and have disabled "Read Only" and "None" options. @@ -601,14 +602,14 @@ describe('User permission management', () => { mockGetUser(mockRestrictedProxyUser); mockGetUserGrants(mockRestrictedProxyUser.username, mockUserGrants); - // Navigate to Users & Grants page and confirm "Business partner settings" and "User settings" sections are visible. + // Navigate to Users & Grants page and confirm "Parent User Settings" and "User Settings" sections are visible. cy.visitWithLogin('/account/users'); cy.wait('@getUsers'); - cy.findByText('Business partner settings').should('be.visible'); - cy.findByText('User settings').should('be.visible'); + cy.findByText(`${PARENT_USER} Settings`).should('be.visible'); + cy.findByText('User Settings').should('be.visible'); - // Find mock restricted proxy user under "Business partner settings", click its "Manage Access" button. - cy.findByLabelText('List of Business Partners') + // Find mock restricted proxy user under "Parent User Settings", click its "Manage Access" button. + cy.findByLabelText('List of Parent Users') .should('be.visible') .within(() => { cy.findByText(mockRestrictedProxyUser.username) @@ -630,7 +631,9 @@ describe('User permission management', () => { ); cy.wait(['@getClientStream', '@getFeatureFlags']); - cy.findByText('Business Partner Permissions').should('be.visible'); + cy.findByText('Parent User Permissions', { exact: false }).should( + 'be.visible' + ); // Confirm that no "Profile" tab is present on the proxy user's User Permissions page. expect(cy.findByText('User Profile').should('not.exist')); diff --git a/packages/manager/cypress/e2e/core/account/user-profile.spec.ts b/packages/manager/cypress/e2e/core/account/user-profile.spec.ts index a7ffc031bc6..3f56aab2206 100644 --- a/packages/manager/cypress/e2e/core/account/user-profile.spec.ts +++ b/packages/manager/cypress/e2e/core/account/user-profile.spec.ts @@ -9,6 +9,7 @@ import { import { randomString } from 'support/util/random'; import { ui } from 'support/ui'; import { mockUpdateProfile } from 'support/intercepts/profile'; +import { PARENT_USER } from 'src/features/Account/constants'; describe('User Profile', () => { /* @@ -276,7 +277,7 @@ describe('User Profile', () => { .trigger('mouseover'); // Click the button first, then confirm the tooltip is shown. ui.tooltip - .findByText('You can\u{2019}t delete a business partner user.') + .findByText(`You can\u{2019}t delete a ${PARENT_USER}.`) .should('be.visible'); }); }); diff --git a/packages/manager/cypress/e2e/core/account/user-verification-banner.spec.ts b/packages/manager/cypress/e2e/core/account/user-verification-banner.spec.ts index 08c95ad28bc..23279de91af 100644 --- a/packages/manager/cypress/e2e/core/account/user-verification-banner.spec.ts +++ b/packages/manager/cypress/e2e/core/account/user-verification-banner.spec.ts @@ -225,7 +225,7 @@ describe('User verification banner', () => { mockGetUserGrants(mockRestrictedProxyUser.username, mockUserGrants); mockGetSecurityQuestions(mockSecurityQuestions).as('getSecurityQuestions'); - // Navigate to Users & Grants page and confirm "Business partner settings" and "User settings" sections are visible. + // Navigate to Users & Grants page and confirm "Partner user settings" and "User settings" sections are visible. cy.visitWithLogin('/account/users'); cy.wait(['@getUsers', '@getSecurityQuestions']); diff --git a/packages/manager/src/features/Account/constants.ts b/packages/manager/src/features/Account/constants.ts index 59b82996e97..0d41b0493e0 100644 --- a/packages/manager/src/features/Account/constants.ts +++ b/packages/manager/src/features/Account/constants.ts @@ -1,4 +1,4 @@ -export const BUSINESS_PARTNER = 'business partner'; +export const PARENT_USER = 'parent user'; export const ADMINISTRATOR = 'account administrator'; export const grantTypeMap = { @@ -17,12 +17,9 @@ export const grantTypeMap = { export const PARENT_PROXY_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT = 'Remove indirect customers before closing the account.'; -export const CHILD_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT = - 'Contact your business partner to close your account.'; +export const CHILD_USER_CLOSE_ACCOUNT_TOOLTIP_TEXT = `Contact your ${PARENT_USER} to close your account.`; -// TODO: Parent/Child: Requires updated copy... -export const PARENT_SESSION_EXPIRED = - 'Session expired. Please log in again to your business partner account.'; +export const PARENT_SESSION_EXPIRED = `Session expired. Please log in again to your ${PARENT_USER} account.`; export const RESTRICTED_FIELD_TOOLTIP = 'This account type cannot update this field.'; diff --git a/packages/manager/src/features/Account/utils.ts b/packages/manager/src/features/Account/utils.ts index 6fcd095801e..3d70d71b204 100644 --- a/packages/manager/src/features/Account/utils.ts +++ b/packages/manager/src/features/Account/utils.ts @@ -1,6 +1,6 @@ import { getStorage, setStorage } from 'src/utilities/storage'; -import { ADMINISTRATOR, BUSINESS_PARTNER } from './constants'; +import { ADMINISTRATOR, PARENT_USER } from './constants'; import type { GlobalGrantTypes, GrantLevel, Token } from '@linode/api-v4'; import type { GrantTypeMap } from 'src/features/Account/types'; @@ -55,7 +55,7 @@ export const getRestrictedResourceText = ({ ? 'this ' + resourceType.replace(/s$/, '') : resourceType; - const contactPerson = isChildUser ? BUSINESS_PARTNER : ADMINISTRATOR; + const contactPerson = isChildUser ? PARENT_USER : ADMINISTRATOR; let message = `You don't have permissions to ${action} ${resource}.`; diff --git a/packages/manager/src/features/Users/UserPermissions.tsx b/packages/manager/src/features/Users/UserPermissions.tsx index f217a186abe..1eb8de0be9a 100644 --- a/packages/manager/src/features/Users/UserPermissions.tsx +++ b/packages/manager/src/features/Users/UserPermissions.tsx @@ -11,10 +11,10 @@ import { import { APIError } from '@linode/api-v4/lib/types'; import { Paper } from '@mui/material'; import Grid from '@mui/material/Unstable_Grid2'; +import { QueryClient } from '@tanstack/react-query'; import { WithSnackbarProps, withSnackbar } from 'notistack'; import { compose, flatten, lensPath, omit, set } from 'ramda'; import * as React from 'react'; -import { QueryClient } from '@tanstack/react-query'; import { compose as recompose } from 'recompose'; import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel'; @@ -41,7 +41,7 @@ import { WithQueryClientProps, withQueryClient, } from 'src/containers/withQueryClient.container'; -import { grantTypeMap } from 'src/features/Account/constants'; +import { PARENT_USER, grantTypeMap } from 'src/features/Account/constants'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; import { getAPIErrorFor } from 'src/utilities/getAPIErrorFor'; import { scrollErrorIntoView } from 'src/utilities/scrollErrorIntoView'; @@ -436,8 +436,14 @@ class UserPermissions extends React.Component { sx={{ margin: 0, width: 'auto' }} > - - {isProxyUser ? 'Business Partner' : 'General'} Permissions + + {isProxyUser ? PARENT_USER : 'General'} Permissions diff --git a/packages/manager/src/features/Users/UserProfile.tsx b/packages/manager/src/features/Users/UserProfile.tsx index 94dea27e373..ee44438146e 100644 --- a/packages/manager/src/features/Users/UserProfile.tsx +++ b/packages/manager/src/features/Users/UserProfile.tsx @@ -14,9 +14,9 @@ import { useAccountUser } from 'src/queries/accountUsers'; import { useProfile } from 'src/queries/profile'; import { getAPIErrorFor } from 'src/utilities/getAPIErrorFor'; +import { PARENT_USER, RESTRICTED_FIELD_TOOLTIP } from '../Account/constants'; import { UserDeleteConfirmationDialog } from './UserDeleteConfirmationDialog'; import { StyledTitle, StyledWrapper } from './UserProfile.styles'; -import { RESTRICTED_FIELD_TOOLTIP } from '../Account/constants'; interface UserProfileProps { accountErrors?: APIError[]; @@ -199,7 +199,7 @@ export const UserProfile = (props: UserProfileProps) => { profile?.username === originalUsername ? 'You can\u{2019}t delete the currently active user.' : isProxyUserProfile - ? 'You can\u{2019}t delete a business partner user.' + ? `You can\u{2019}t delete a ${PARENT_USER}.` : undefined } buttonType="outlined" diff --git a/packages/manager/src/features/Users/UsersLanding.tsx b/packages/manager/src/features/Users/UsersLanding.tsx index d3cf29dff1b..f2d9ecdb3b8 100644 --- a/packages/manager/src/features/Users/UsersLanding.tsx +++ b/packages/manager/src/features/Users/UsersLanding.tsx @@ -9,6 +9,7 @@ import { PaginationFooter } from 'src/components/PaginationFooter/PaginationFoot import { Table } from 'src/components/Table'; import { TableBody } from 'src/components/TableBody'; import { Typography } from 'src/components/Typography'; +import { PARENT_USER } from 'src/features/Account/constants'; import { useFlags } from 'src/hooks/useFlags'; import { useOrder } from 'src/hooks/useOrder'; import { usePagination } from 'src/hooks/usePagination'; @@ -97,17 +98,18 @@ export const UsersLanding = () => { sx={(theme) => ({ marginBottom: theme.spacing(2), marginTop: theme.spacing(3), + textTransform: 'capitalize', [theme.breakpoints.down('md')]: { marginLeft: theme.spacing(1), }, })} variant="h3" > - Business partner settings + {PARENT_USER} Settings )} {showProxyUserTable && ( - +
{ })} variant="h3" > - User settings + User Settings )}