Rename general user settings to account (#12841)
* Rename general user settings to account Everything 'general' is now elsewhere, so this is ready for its new name. * Update snapshots * Rename & update playwright test * Rename class & remove unused CSS class * Change test ID * rethemendex * More tests!! * snapshots * Put the screenshots back in the new place * Fix tests with restoreAllMocks * More screenshot renaming * More test fixes & screenshot updates * More test fixes * un-skip * Typo Co-authored-by: Robin <robin@robin.town> --------- Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
parent
1be4c12fd2
commit
4e4c5c7768
20 changed files with 172 additions and 54 deletions
|
@ -32,7 +32,7 @@ import HelpIcon from "@vector-im/compound-design-tokens/assets/web/icons/help";
|
|||
|
||||
import TabbedView, { Tab, useActiveTabWithDefault } from "../../structures/TabbedView";
|
||||
import { _t, _td } from "../../../languageHandler";
|
||||
import GeneralUserSettingsTab from "../settings/tabs/user/GeneralUserSettingsTab";
|
||||
import AccountUserSettingsTab from "../settings/tabs/user/AccountUserSettingsTab";
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import LabsUserSettingsTab, { showLabsFlags } from "../settings/tabs/user/LabsUserSettingsTab";
|
||||
import AppearanceUserSettingsTab from "../settings/tabs/user/AppearanceUserSettingsTab";
|
||||
|
@ -65,8 +65,8 @@ function titleForTabID(tabId: UserTab): React.ReactNode {
|
|||
strong: (sub: string) => <span className="mx_UserSettingsDialog_title_strong">{sub}</span>,
|
||||
};
|
||||
switch (tabId) {
|
||||
case UserTab.General:
|
||||
return _t("settings|general|dialog_title", undefined, subs);
|
||||
case UserTab.Account:
|
||||
return _t("settings|account|dialog_title", undefined, subs);
|
||||
case UserTab.SessionManager:
|
||||
return _t("settings|sessions|dialog_title", undefined, subs);
|
||||
case UserTab.Appearance:
|
||||
|
@ -103,10 +103,10 @@ export default function UserSettingsDialog(props: IProps): JSX.Element {
|
|||
|
||||
tabs.push(
|
||||
new Tab(
|
||||
UserTab.General,
|
||||
_td("common|general"),
|
||||
UserTab.Account,
|
||||
_td("settings|account|title"),
|
||||
<UserProfileIcon />,
|
||||
<GeneralUserSettingsTab closeSettingsFn={props.onFinished} />,
|
||||
<AccountUserSettingsTab closeSettingsFn={props.onFinished} />,
|
||||
"UserSettingsGeneral",
|
||||
),
|
||||
);
|
||||
|
@ -216,7 +216,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element {
|
|||
return tabs as NonEmptyArray<Tab<UserTab>>;
|
||||
};
|
||||
|
||||
const [activeTabId, _setActiveTabId] = useActiveTabWithDefault(getTabs(), UserTab.General, props.initialTabId);
|
||||
const [activeTabId, _setActiveTabId] = useActiveTabWithDefault(getTabs(), UserTab.Account, props.initialTabId);
|
||||
const setActiveTabId = (tabId: UserTab): void => {
|
||||
_setActiveTabId(tabId);
|
||||
// Clear this so switching away from the tab and back to it will not show the QR code again
|
||||
|
|
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
export enum UserTab {
|
||||
General = "USER_GENERAL_TAB",
|
||||
Account = "USER_ACCOUNT_TAB",
|
||||
Appearance = "USER_APPEARANCE_TAB",
|
||||
Notifications = "USER_NOTIFICATIONS_TAB",
|
||||
Preferences = "USER_PREFERENCES_TAB",
|
||||
|
|
|
@ -37,7 +37,7 @@ function generalTabButton(content: string): JSX.Element {
|
|||
onClick={() => {
|
||||
dispatcher.dispatch({
|
||||
action: Action.ViewUserSettings,
|
||||
initialTabId: UserTab.General,
|
||||
initialTabId: UserTab.Account,
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -62,7 +62,6 @@ const AccountSection: React.FC<AccountSectionProps> = ({
|
|||
>
|
||||
<SettingsSubsectionText>{_t("settings|general|password_change_section")}</SettingsSubsectionText>
|
||||
<ChangePassword
|
||||
className="mx_GeneralUserSettingsTab_section--account_changePassword"
|
||||
rowClassName=""
|
||||
buttonKind="primary"
|
||||
onError={onPasswordChangeError}
|
||||
|
@ -93,7 +92,7 @@ const ManagementSection: React.FC<ManagementSectionProps> = ({ onDeactivateClick
|
|||
);
|
||||
};
|
||||
|
||||
const GeneralUserSettingsTab: React.FC<IProps> = ({ closeSettingsFn }) => {
|
||||
const AccountUserSettingsTab: React.FC<IProps> = ({ closeSettingsFn }) => {
|
||||
const [externalAccountManagementUrl, setExternalAccountManagementUrl] = React.useState<string | undefined>();
|
||||
const [canMake3pidChanges, setCanMake3pidChanges] = React.useState<boolean>(false);
|
||||
const [canSetDisplayName, setCanSetDisplayName] = React.useState<boolean>(false);
|
||||
|
@ -189,7 +188,7 @@ const GeneralUserSettingsTab: React.FC<IProps> = ({ closeSettingsFn }) => {
|
|||
}
|
||||
|
||||
return (
|
||||
<SettingsTab data-testid="mx_GeneralUserSettingsTab">
|
||||
<SettingsTab data-testid="mx_AccountUserSettingsTab">
|
||||
<SettingsSection>
|
||||
<UserProfileSettings
|
||||
externalAccountManagementUrl={externalAccountManagementUrl}
|
||||
|
@ -208,4 +207,4 @@ const GeneralUserSettingsTab: React.FC<IProps> = ({ closeSettingsFn }) => {
|
|||
);
|
||||
};
|
||||
|
||||
export default GeneralUserSettingsTab;
|
||||
export default AccountUserSettingsTab;
|
|
@ -127,7 +127,7 @@ const tasks: UserOnboardingTask[] = [
|
|||
PosthogTrackers.trackInteraction("WebUserOnboardingTaskSetupProfile", ev);
|
||||
defaultDispatcher.dispatch({
|
||||
action: Action.ViewUserSettings,
|
||||
initialTabId: UserTab.General,
|
||||
initialTabId: UserTab.Account,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -2422,6 +2422,10 @@
|
|||
}
|
||||
},
|
||||
"settings": {
|
||||
"account": {
|
||||
"dialog_title": "<strong>Settings:</strong> Account",
|
||||
"title": "Account"
|
||||
},
|
||||
"all_rooms_home": "Show all rooms in Home",
|
||||
"all_rooms_home_description": "All rooms you're in will appear in Home.",
|
||||
"always_show_message_timestamps": "Always show message timestamps",
|
||||
|
@ -2497,7 +2501,6 @@
|
|||
"deactivate_confirm_erase_label": "Hide my messages from new joiners",
|
||||
"deactivate_section": "Deactivate Account",
|
||||
"deactivate_warning": "Deactivating your account is a permanent action — be careful!",
|
||||
"dialog_title": "<strong>Settings:</strong> General",
|
||||
"discovery_email_empty": "Discovery options will appear once you have added an email.",
|
||||
"discovery_email_verification_instructions": "Verify the link in your inbox",
|
||||
"discovery_msisdn_empty": "Discovery options will appear once you have added a phone number.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue