This is an automated email from the ASF dual-hosted git repository.
jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris-manager.git
The following commit(s) were added to refs/heads/master by this push:
new 004c5e4 [fix] fix space administrator cannot remove or add
administrators to the space and fix login page form label (#18)
004c5e4 is described below
commit 004c5e4a5963b8bff4c26a8b4a40cbc684868785
Author: zhengbowen <[email protected]>
AuthorDate: Thu Mar 24 17:26:22 2022 +0800
[fix] fix space administrator cannot remove or add administrators to the
space and fix login page form label (#18)
fix space administrator cannot remove or add administrators to the space
and fix login page form label
---
frontend/public/locales/en-us.json | 3 +++
frontend/public/locales/zh-cn.json | 3 +++
frontend/src/components/sidebar/sidebar.tsx | 4 ++--
frontend/src/routes/admin/people/role/list/list.tsx | 4 ++--
.../src/routes/admin/people/role/member/member.tsx | 4 ++--
frontend/src/routes/admin/people/user/user.tsx | 4 ++--
frontend/src/routes/container.tsx | 2 +-
frontend/src/routes/passport/login.tsx | 6 +++---
frontend/src/routes/space/detail/space-detail.tsx | 21 +++++++++++++++++----
frontend/src/routes/space/list/list.tsx | 6 ------
10 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/frontend/public/locales/en-us.json
b/frontend/public/locales/en-us.json
index 418dd52..48eb538 100644
--- a/frontend/public/locales/en-us.json
+++ b/frontend/public/locales/en-us.json
@@ -1,8 +1,11 @@
{
"username": "Username",
"password": "Password",
+ "Username or Mail": "Username or Mail",
"OldPassword":"Old Password",
"PleaseEnterTheOldPassword":"Please enter the old password",
+ "Please input the username or email": "Please input the username or email",
+ "Please input the password": "Please input the password",
"NewPassword":"New Password",
"ContainAtLeast2Types":"Contain at least 2 types of English uppercase,
lowercase English, numbers and special symbols",
"PleaseEnterTheNewPassword":"Please enter the new password",
diff --git a/frontend/public/locales/zh-cn.json
b/frontend/public/locales/zh-cn.json
index a4b3a83..40b8383 100644
--- a/frontend/public/locales/zh-cn.json
+++ b/frontend/public/locales/zh-cn.json
@@ -1,8 +1,11 @@
{
"username": "用户名",
"password": "密码",
+ "Username or Mail": "用户名或邮箱",
"OldPassword":"旧密码",
"PleaseEnterTheOldPassword":"请输入旧密码",
+ "Please input the username or email": "请输入用户名或邮箱",
+ "Please input the password": "请输入密码",
"NewPassword":"新密码",
"ContainAtLeast2Types":"至少包含英文大写、英文小写、数字和特殊符号中的2种",
"PleaseEnterTheNewPassword":"请输入新密码",
diff --git a/frontend/src/components/sidebar/sidebar.tsx
b/frontend/src/components/sidebar/sidebar.tsx
index 6cc564c..3a4ae11 100644
--- a/frontend/src/components/sidebar/sidebar.tsx
+++ b/frontend/src/components/sidebar/sidebar.tsx
@@ -147,9 +147,9 @@ export function Sidebar(props: any) {
<Menu.Item key="/meta" icon={<TableOutlined />}>
<Link to={`/meta`}>{t`data`}</Link>
</Menu.Item>
- <Menu.Item key="/query" icon={<ConsoleSqlOutlined
/>}>
+ {/* <Menu.Item key="/query"
icon={<ConsoleSqlOutlined />}>
<Link to={`/query`}>{t`Query`}</Link>
- </Menu.Item>
+ </Menu.Item> */}
{(isSuperAdmin || isSpaceAdmin) && (
<Menu.Item key="/admin"
icon={<AppstoreOutlined />}>
<Link to={`/admin`}>{t`Space
Manager`}</Link>
diff --git a/frontend/src/routes/admin/people/role/list/list.tsx
b/frontend/src/routes/admin/people/role/list/list.tsx
index f5c62c9..c623923 100644
--- a/frontend/src/routes/admin/people/role/list/list.tsx
+++ b/frontend/src/routes/admin/people/role/list/list.tsx
@@ -116,7 +116,7 @@ export function RoleList(props: any) {
<span style={{ color: '#aaa' }}>
{t`roleTopMessage`}
</span>
- <Button
+ {/* <Button
key="1"
type="primary"
onClick={() => {
@@ -125,7 +125,7 @@ export function RoleList(props: any) {
}}
>
{t`create`}
- </Button>
+ </Button> */}
</Row>
<Table
diff --git a/frontend/src/routes/admin/people/role/member/member.tsx
b/frontend/src/routes/admin/people/role/member/member.tsx
index e2ea2e8..fd6e203 100644
--- a/frontend/src/routes/admin/people/role/member/member.tsx
+++ b/frontend/src/routes/admin/people/role/member/member.tsx
@@ -125,7 +125,7 @@ export function RoleMembers(props: any) {
<>
<Row justify="space-between" style={{ marginBottom: 20 }}>
<span style={{ fontWeight: 700, fontSize: 20
}}>{showName(members?.name)}</span>
- <Button
+ {/* <Button
key="1"
type="primary"
onClick={() => {
@@ -133,7 +133,7 @@ export function RoleMembers(props: any) {
}}
>
{t`addMembers`}
- </Button>
+ </Button> */}
</Row>
<Table
pagination={false}
diff --git a/frontend/src/routes/admin/people/user/user.tsx
b/frontend/src/routes/admin/people/user/user.tsx
index e0c45fc..e4442f9 100644
--- a/frontend/src/routes/admin/people/user/user.tsx
+++ b/frontend/src/routes/admin/people/user/user.tsx
@@ -107,11 +107,11 @@ export function User() {
return (
<>
- <Row justify="end" style={{ marginBottom: 20 }}>
+ {/* <Row justify="end" style={{ marginBottom: 20 }}>
<Button type="primary" onClick={() => setModalVisible(true)}>
{t`addMembers`}
</Button>
- </Row>
+ </Row> */}
<Table
pagination={false}
dataSource={spaceMembers}
diff --git a/frontend/src/routes/container.tsx
b/frontend/src/routes/container.tsx
index 6792a7d..449a266 100644
--- a/frontend/src/routes/container.tsx
+++ b/frontend/src/routes/container.tsx
@@ -60,7 +60,7 @@ export function Container(props: any) {
<Route path="/configuration/be"
component={BEConfiguration} />
<Route path="/configuration"
component={Configuration} />
<Route path="/node-dashboard"
component={NodeDashboard} />
- <Route path="/query" component={Query} />
+ {/* <Route path="/query" component={Query}
/> */}
<Route path="/details/:queryId"
component={QueryDetails} />
<Route path="/user-setting"
component={UserSetting} />
<Route path="/visual-query"
component={VisualQuery} />
diff --git a/frontend/src/routes/passport/login.tsx
b/frontend/src/routes/passport/login.tsx
index c3aabc6..121d0d8 100644
--- a/frontend/src/routes/passport/login.tsx
+++ b/frontend/src/routes/passport/login.tsx
@@ -51,12 +51,12 @@ export function Login(props: any) {
onFinish={handleLogin}
>
<h2 style={{ textAlign: 'center' }}>{ t`login`}</h2>
- <Form.Item label={ t`Mail`} required name="username">
- <Input placeholder="请输入用户名" />
+ <Form.Item label={ t`Username or Mail`} required
name="username">
+ <Input placeholder={t`Please input the username or
email`} />
</Form.Item>
<Form.Item label={t`password`} required name="password">
<Input.Password
- placeholder="请输入密码"
+ placeholder={t`Please input the password`}
style={{ width: '100%', borderRadius: 4, padding:
'0.75em' }}
/>
</Form.Item>
diff --git a/frontend/src/routes/space/detail/space-detail.tsx
b/frontend/src/routes/space/detail/space-detail.tsx
index a8a0bbc..363d261 100644
--- a/frontend/src/routes/space/detail/space-detail.tsx
+++ b/frontend/src/routes/space/detail/space-detail.tsx
@@ -27,6 +27,8 @@ import { modal } from
'@src/components/doris-modal/doris-modal';
import { useRecoilValue } from 'recoil';
import { usersQuery } from '../space.recoil';
import { useUserInfo } from '@src/hooks/use-userinfo.hooks';
+import { useAsync } from '@src/hooks/use-async';
+import { isSuccess } from '@src/utils/http';
export function SpaceDetail() {
const { t } = useTranslation();
@@ -37,7 +39,7 @@ export function SpaceDetail() {
const [saveButtonDisable, setSaveButtonDisable] = useState(true);
const [initForm, setInitForm] = useState<any>({});
const history = useHistory();
- const allUsers = useRecoilValue(usersQuery);
+ const { data: allUsers, loading, run: runGetAllUsers } = useAsync<any[]>({
data: [], loading: true });
function getSpaceInfo() {
SpaceAPI.spaceGet(params.spaceId).then(res => {
const { msg, data, code } = res;
@@ -57,9 +59,20 @@ export function SpaceDetail() {
}
});
}
+
+ useEffect(() => {
+ runGetAllUsers(
+ SpaceAPI.getUsers({ include_deactivated: true }).then(res => {
+ if (isSuccess(res)) return res.data;
+ return Promise.reject(res);
+ }),
+ );
+ }, [runGetAllUsers]);
+
useEffect(() => {
+ if (loading) return;
getSpaceInfo();
- }, []);
+ }, [loading]);
function handleDelete() {
const spaceId = params.spaceId;
@@ -89,7 +102,7 @@ export function SpaceDetail() {
console.log(res);
if (res.code === 0) {
message.success(res.msg);
- setSaveButtonDisable(true)
+ setSaveButtonDisable(true);
// history.push('/')
} else {
message.error(res.msg);
@@ -162,7 +175,7 @@ export function SpaceDetail() {
placeholder={t`pleaseSelectUsers`}
optionFilterProp="title"
optionLabelProp="label"
- disabled={!userInfo?.is_super_admin}
+ disabled={!userInfo?.is_super_admin &&
!userInfo.is_admin}
filterOption={(input, option) => {
return (option?.title as
string).toLowerCase().indexOf(input.toLowerCase()) >= 0;
}}
diff --git a/frontend/src/routes/space/list/list.tsx
b/frontend/src/routes/space/list/list.tsx
index 3c06cc1..0488cfd 100644
--- a/frontend/src/routes/space/list/list.tsx
+++ b/frontend/src/routes/space/list/list.tsx
@@ -121,11 +121,6 @@ export const SpaceList = () => {
render: (createTime: string) => <span>{moment(new
Date(createTime)).format('YYYY-MM-DD HH:mm:ss')}</span>,
},
{
- title: t`Status`,
- dataIndex: 'status',
- key: 'status',
- },
- {
title: t`Actions`,
dataIndex: 'status',
key: 'status',
@@ -134,7 +129,6 @@ export const SpaceList = () => {
<FlatBtnGroup showNum={4}>
<FlatBtn onClick={() => enterSpace(record)}>{t`Enter
Space`}</FlatBtn>
<FlatBtn onClick={() =>
deleteSpace(record)}>{t`Delete`}</FlatBtn>
- <FlatBtn
to={`/space/detail/${record.id}`}>{t`Edit`}</FlatBtn>
</FlatBtnGroup>
),
},
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]