Skip to content

Commit 9505202

Browse files
BrunoQuaresmakylecarbs
authored andcommitted
chore: Rename Preferences to Settings (#1487)
1 parent 6f78aed commit 9505202

File tree

11 files changed

+17
-17
lines changed

11 files changed

+17
-17
lines changed

site/src/AppRouter.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import React from "react"
22
import { Route, Routes } from "react-router-dom"
33
import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame"
4-
import { PreferencesLayout } from "./components/PreferencesLayout/PreferencesLayout"
54
import { RequireAuth } from "./components/RequireAuth/RequireAuth"
5+
import { SettingsLayout } from "./components/SettingsLayout/SettingsLayout"
66
import { IndexPage } from "./pages"
77
import { NotFoundPage } from "./pages/404Page/404Page"
88
import { CliAuthenticationPage } from "./pages/CliAuthPage/CliAuthPage"
99
import { HealthzPage } from "./pages/HealthzPage/HealthzPage"
1010
import { LoginPage } from "./pages/LoginPage/LoginPage"
1111
import { OrgsPage } from "./pages/OrgsPage/OrgsPage"
12-
import { AccountPage } from "./pages/PreferencesPages/AccountPage/AccountPage"
13-
import { SSHKeysPage } from "./pages/PreferencesPages/SSHKeysPage/SSHKeysPage"
1412
import { SettingsPage } from "./pages/SettingsPage/SettingsPage"
13+
import { AccountPage } from "./pages/SettingsPages/AccountPage/AccountPage"
14+
import { SSHKeysPage } from "./pages/SettingsPages/SSHKeysPage/SSHKeysPage"
1515
import { CreateWorkspacePage } from "./pages/TemplatesPages/OrganizationPage/TemplatePage/CreateWorkspacePage"
1616
import { TemplatePage } from "./pages/TemplatesPages/OrganizationPage/TemplatePage/TemplatePage"
1717
import { TemplatesPage } from "./pages/TemplatesPages/TemplatesPage"
@@ -131,7 +131,7 @@ export const AppRouter: React.FC = () => (
131131
}
132132
/>
133133

134-
<Route path="preferences" element={<PreferencesLayout />}>
134+
<Route path="settings" element={<SettingsLayout />}>
135135
<Route path="account" element={<AccountPage />} />
136136
<Route path="ssh-keys" element={<SSHKeysPage />} />
137137
</Route>

site/src/components/PreferencesAccountForm/PreferencesAccountForm.tsx renamed to site/src/components/SettingsAccountForm/SettingsAccountForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Language = {
1717
emailLabel: "Email",
1818
emailInvalid: "Please enter a valid email address.",
1919
emailRequired: "Please enter an email address.",
20-
updatePreferences: "Update preferences",
20+
updateSettings: "Update settings",
2121
}
2222

2323
const validationSchema = Yup.object({
@@ -73,7 +73,7 @@ export const AccountForm: React.FC<AccountFormProps> = ({
7373

7474
<div>
7575
<LoadingButton color="primary" loading={isLoading} type="submit" variant="contained">
76-
{isLoading ? "" : Language.updatePreferences}
76+
{isLoading ? "" : Language.updateSettings}
7777
</LoadingButton>
7878
</div>
7979
</Stack>

site/src/components/PreferencesLayout/PreferencesLayout.tsx renamed to site/src/components/SettingsLayout/SettingsLayout.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ import { TabPanel } from "../TabPanel/TabPanel"
88
export const Language = {
99
accountLabel: "Account",
1010
sshKeysLabel: "SSH Keys",
11-
preferencesLabel: "Preferences",
11+
settingsLabel: "Settings",
1212
}
1313

1414
const menuItems = [
15-
{ label: Language.accountLabel, path: "/preferences/account" },
16-
{ label: Language.sshKeysLabel, path: "/preferences/ssh-keys" },
15+
{ label: Language.accountLabel, path: "/settings/account" },
16+
{ label: Language.sshKeysLabel, path: "/settings/ssh-keys" },
1717
]
1818

19-
export const PreferencesLayout: React.FC = () => {
19+
export const SettingsLayout: React.FC = () => {
2020
return (
2121
<AuthAndFrame>
2222
<Box display="flex" flexDirection="column">
2323
<Margins>
24-
<TabPanel title={Language.preferencesLabel} menuItems={menuItems}>
24+
<TabPanel title={Language.settingsLabel} menuItems={menuItems}>
2525
<Outlet />
2626
</TabPanel>
2727
</Margins>

site/src/components/UserDropdown/UserDropdown.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ describe("UserDropdown", () => {
6363
throw new Error("Anchor tag not found for the account menu item")
6464
}
6565

66-
expect(link.getAttribute("href")).toBe("/preferences/account")
66+
expect(link.getAttribute("href")).toBe("/settings/account")
6767
})
6868
})

site/src/components/UserDropdown/UsersDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const UserDropdown: React.FC<UserDropdownProps> = ({ user, onSignOut }: U
6868

6969
<Divider />
7070

71-
<Link to="/preferences/account" className={styles.link}>
71+
<Link to="/settings/account" className={styles.link}>
7272
<MenuItem className={styles.menuItem} onClick={onPopoverClose}>
7373
<ListItemIcon className={styles.icon}>
7474
<AccountIcon />

site/src/pages/PreferencesPages/AccountPage/AccountPage.test.tsx renamed to site/src/pages/SettingsPages/AccountPage/AccountPage.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { fireEvent, screen, waitFor } from "@testing-library/react"
22
import React from "react"
33
import * as API from "../../../api/api"
44
import { GlobalSnackbar } from "../../../components/GlobalSnackbar/GlobalSnackbar"
5-
import * as AccountForm from "../../../components/PreferencesAccountForm/PreferencesAccountForm"
5+
import * as AccountForm from "../../../components/SettingsAccountForm/SettingsAccountForm"
66
import { renderWithAuth } from "../../../testHelpers/renderHelpers"
77
import * as AuthXService from "../../../xServices/auth/authXService"
88
import { AccountPage, Language } from "./AccountPage"
@@ -25,7 +25,7 @@ const fillAndSubmitForm = async () => {
2525
await waitFor(() => screen.findByLabelText("Email"))
2626
fireEvent.change(screen.getByLabelText("Email"), { target: { value: newData.email } })
2727
fireEvent.change(screen.getByLabelText("Username"), { target: { value: newData.username } })
28-
fireEvent.click(screen.getByText(AccountForm.Language.updatePreferences))
28+
fireEvent.click(screen.getByText(AccountForm.Language.updateSettings))
2929
}
3030

3131
describe("AccountPage", () => {

site/src/pages/PreferencesPages/AccountPage/AccountPage.tsx renamed to site/src/pages/SettingsPages/AccountPage/AccountPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useActor } from "@xstate/react"
22
import React, { useContext } from "react"
33
import { isApiError, mapApiErrorToFieldErrors } from "../../../api/errors"
4-
import { AccountForm } from "../../../components/PreferencesAccountForm/PreferencesAccountForm"
54
import { Section } from "../../../components/Section/Section"
5+
import { AccountForm } from "../../../components/SettingsAccountForm/SettingsAccountForm"
66
import { XServiceContext } from "../../../xServices/StateContext"
77

88
export const Language = {

site/src/xServices/auth/authXService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as TypesGen from "../../api/typesGenerated"
44
import { displayError, displaySuccess } from "../../components/GlobalSnackbar/utils"
55

66
export const Language = {
7-
successProfileUpdate: "Updated preferences.",
7+
successProfileUpdate: "Updated settings.",
88
successRegenerateSSHKey: "SSH Key regenerated successfully",
99
errorRegenerateSSHKey: "Error on regenerate the SSH Key",
1010
}

0 commit comments

Comments
 (0)