Skip to content

Commit

Permalink
PullRequest: 592 feat: view permission
Browse files Browse the repository at this point in the history
Merge branch 'feat/dev-4.3.3-view-permission of [email protected]:oceanbase/oceanbase-developer-center.git into dev-4.3.3

https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/592


Signed-off-by: 晓康 <[email protected]>


* feat: view permission
* update table permission label
* api debug
* code optimization
  • Loading branch information
yezaoshu committed Dec 6, 2024
1 parent 2cc96fe commit fb6ae38
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 231 deletions.
27 changes: 10 additions & 17 deletions src/component/Task/ApplyTablePermission/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ const CreateModal: React.FC<IProps> = (props) => {
if (hasEdit) {
Modal.confirm({
zIndex: 1003,
title: formatMessage({
id: 'src.component.Task.ApplyTablePermission.CreateModal.11B637AA',
defaultMessage: '确认取消申请表权限吗?',
}),
title: '确认取消申请表/视图权限吗?',
centered: true,
onOk: () => {
modalStore.changeApplyTablePermissionModal(false);
Expand Down Expand Up @@ -299,9 +296,9 @@ const CreateModal: React.FC<IProps> = (props) => {
// 目前一个工单只会关联一个库
const databaseId = tables?.[0]?.databaseId;
if (projectId && databaseId) {
tableSelecterRef.current?.loadTables(databaseId).then(() => {
tableSelecterRef.current?.expandTable(databaseId);
});
await tableSelecterRef.current?.loadDatabases();
await tableSelecterRef.current?.loadTables(databaseId);
tableSelecterRef.current?.expandTable(databaseId);
}
form.setFieldsValue(formData);
}, [applyTablePermissionData, form]);
Expand All @@ -328,8 +325,10 @@ const CreateModal: React.FC<IProps> = (props) => {
};
if (projectId && databaseId) {
// 默认获取要申请权限的库下面的表,并且展开
tableSelecterRef.current?.loadTables(databaseId).then(() => {
tableSelecterRef.current?.expandTable(databaseId);
tableSelecterRef.current?.loadDatabases()?.then(() => {
tableSelecterRef.current?.loadTables(databaseId).then(() => {
tableSelecterRef.current?.expandTable(databaseId);
});
});
}
// 默认选中要申请的表、权限类型
Expand Down Expand Up @@ -374,10 +373,7 @@ const CreateModal: React.FC<IProps> = (props) => {
destroyOnClose
className={styles.createModal}
width={816}
title={formatMessage({
id: 'src.component.Task.ApplyTablePermission.CreateModal.7DDD3557',
defaultMessage: '申请表权限',
})}
title={`申请表/视图权限`}
footer={
<Space>
<Button
Expand Down Expand Up @@ -444,10 +440,7 @@ const CreateModal: React.FC<IProps> = (props) => {
</Form.Item>
<Form.Item
name="tables"
label={formatMessage({
id: 'src.component.Task.ApplyTablePermission.CreateModal.8A62AFC4',
defaultMessage: '表',
})}
label={`表/视图`}
required
rules={[
{
Expand Down
15 changes: 3 additions & 12 deletions src/component/Task/ApplyTablePermission/DetailContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ const getConnectionColumns = () => {
},
{
dataIndex: 'tableName',
title: formatMessage({
id: 'src.component.Task.ApplyTablePermission.DetailContent.658E0B9E',
defaultMessage: '表',
}),
title: '表/视图',
ellipsis: true,
width: 240,
},
Expand Down Expand Up @@ -106,10 +103,7 @@ const TaskContent: React.FC<IProps> = (props) => {
defaultMessage: '任务类型',
})}
>
{formatMessage({
id: 'src.component.Task.ApplyTablePermission.DetailContent.6C1A740A',
defaultMessage: '申请表权限',
})}
{`申请表/视图权限`}
</Descriptions.Item>
</Descriptions>
<Divider
Expand All @@ -129,10 +123,7 @@ const TaskContent: React.FC<IProps> = (props) => {
</Descriptions.Item>
</Descriptions>
<SimpleTextItem
label={formatMessage({
id: 'src.component.Task.ApplyTablePermission.DetailContent.3FE43B61',
defaultMessage: '表',
})}
label={`表/视图`}
content={
<DisplayTable
rowKey="tableName"
Expand Down
1 change: 1 addition & 0 deletions src/component/Task/component/TableSelecter/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
.nodeName {
overflow: hidden;
text-overflow: ellipsis;
margin-left: 4px;
}

.hasIconTree {
Expand Down
Loading

0 comments on commit fb6ae38

Please sign in to comment.