Skip to content

Commit cb70499

Browse files
committed
move account related views into separate directory
1 parent 14e624b commit cb70499

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

frontend/javascripts/admin/auth/auth_token_view.tsx renamed to frontend/javascripts/admin/account/account_auth_token_view.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { getAuthToken, revokeAuthToken } from "admin/rest_api";
33
import { Button, Descriptions, Popover, Spin, Typography } from "antd";
44
import { useWkSelector } from "libs/react_hooks";
55
import { useEffect, useState } from "react";
6-
import { AccountSettingsTitle } from "./profile_view";
6+
import { AccountSettingsTitle } from "./account_profile_view";
77

88
const { Text } = Typography;
99

10-
function AuthTokenView() {
10+
function AccountAuthTokenView() {
1111
const activeUser = useWkSelector((state) => state.activeUser);
1212
const [isLoading, setIsLoading] = useState<boolean>(true);
1313
const [currentToken, setCurrentToken] = useState<string>("");
@@ -91,4 +91,4 @@ function AuthTokenView() {
9191
);
9292
}
9393

94-
export default AuthTokenView;
94+
export default AccountAuthTokenView;

frontend/javascripts/admin/auth/change_password_view.tsx renamed to frontend/javascripts/admin/account/account_password_view.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useState } from "react";
77
import { type RouteComponentProps, withRouter } from "react-router-dom";
88
import { logoutUserAction } from "viewer/model/actions/user_actions";
99
import Store from "viewer/store";
10-
import { AccountSettingsTitle } from "./profile_view";
10+
import { AccountSettingsTitle } from "./account_profile_view";
1111
const FormItem = Form.Item;
1212
const { Password } = Input;
1313

@@ -17,7 +17,7 @@ type Props = {
1717

1818
const MIN_PASSWORD_LENGTH = 8;
1919

20-
function ChangePasswordView({ history }: Props) {
20+
function AccountPasswordView({ history }: Props) {
2121
const [form] = Form.useForm();
2222
const [isResetPasswordVisible, setResetPasswordVisible] = useState(false);
2323

@@ -205,4 +205,4 @@ function ChangePasswordView({ history }: Props) {
205205
);
206206
}
207207

208-
export default withRouter<RouteComponentProps, any>(ChangePasswordView);
208+
export default withRouter<RouteComponentProps, any>(AccountPasswordView);

frontend/javascripts/admin/auth/profile_view.tsx renamed to frontend/javascripts/admin/account/account_profile_view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function AccountSettingsTitle({
2727
);
2828
}
2929

30-
function ProfileView() {
30+
function AccountProfileView() {
3131
const activeUser = useWkSelector((state) => state.activeUser);
3232
const activeOrganization = useWkSelector((state) => state.activeOrganization);
3333
const { selectedTheme } = activeUser || { selectedTheme: "auto" };
@@ -115,4 +115,4 @@ function ProfileView() {
115115
);
116116
}
117117

118-
export default ProfileView;
118+
export default AccountProfileView;

frontend/javascripts/admin/auth/account_settings_view.tsx renamed to frontend/javascripts/admin/account/account_settings_view.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { SafetyOutlined, SettingOutlined, UserOutlined } from "@ant-design/icons
22
import { Breadcrumb, Layout, Menu } from "antd";
33
import type { MenuItemGroupType } from "antd/es/menu/interface";
44
import { Route, Switch, useHistory, useLocation } from "react-router-dom";
5-
import AuthTokenView from "./auth_token_view";
6-
import ChangePasswordView from "./change_password_view";
7-
import ProfileView from "./profile_view";
5+
import AccountAuthTokenView from "./account_auth_token_view";
6+
import AccountPasswordView from "./account_password_view";
7+
import AccountProfileView from "./account_profile_view";
88

99
const { Sider, Content } = Layout;
1010

@@ -68,10 +68,10 @@ function AccountSettingsView() {
6868
</Breadcrumb.Item>
6969
</Breadcrumb>
7070
<Switch>
71-
<Route path="/account/profile" component={ProfileView} />
72-
<Route path="/account/password" component={ChangePasswordView} />
73-
<Route path="/account/token" component={AuthTokenView} />
74-
<Route path="/account" component={ProfileView} />
71+
<Route path="/account/profile" component={AccountProfileView} />
72+
<Route path="/account/password" component={AccountPasswordView} />
73+
<Route path="/account/token" component={AccountAuthTokenView} />
74+
<Route path="/account" component={AccountProfileView} />
7575
</Switch>
7676
</Content>
7777
</Layout>

frontend/javascripts/router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import {
6161
getDatasetIdFromNameAndOrganization,
6262
getOrganizationForDataset,
6363
} from "admin/api/disambiguate_legacy_routes";
64-
import AccountSettingsView from "admin/auth/account_settings_view";
64+
import AccountSettingsView from "admin/account/account_settings_view";
6565
import VerifyEmailView from "admin/auth/verify_email_view";
6666
import { DatasetURLImport } from "admin/dataset/dataset_url_import";
6767
import TimeTrackingOverview from "admin/statistic/time_tracking_overview";

0 commit comments

Comments
 (0)