Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/dev/code_review_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"repo": "dms-ui",
"pr_branch": "dms-ui/feat-950",
"target_branch": "main",
"local_head": "eec07faf90cc15671e0e29f56885c542c57c8671"
}
1 change: 1 addition & 0 deletions packages/base/src/data/EmitterKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ enum EmitterKey {
Reset_Test_Data_Source_Connect = 'DMS_Reset_Test_Data_Source_Connect',
DMS_Reset_DataSource_Form = 'DMS_Reset_DataSource_Form',
DMS_Submit_DataSource_Form = 'DMS_Submit_DataSource_Form',
DMS_Open_DataSource_Connect_Error_Modal = 'DMS_Open_DataSource_Connect_Error_Modal',
DMS_Refresh_Member_List = 'DMS_REFRESH_MEMBER_LIST',
DMS_Refresh_Project_List = 'DMS_REFRESH_PROJECT_LIST',
DMS_SYNC_TASK_RESET_FORM = 'DMS_SYNC_TASK_RESET_FORM',
Expand Down
5 changes: 3 additions & 2 deletions packages/base/src/hooks/useStaticTips/index.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ type IStaticEnumDictionary<T extends string> = {
[key in T]: string;
};

/** AC-012 / S1 §5.6:过滤选项仅连通三态文案,与列表列「连通性测试成功/失败」对齐;不含权限语义 */
export const databaseTestConnectionStatusDictionary: IStaticEnumDictionary<ListDBServicesFilterLastConnectionTestStatusEnum> =
{
[ListDBServicesFilterLastConnectionTestStatusEnum.connect_failed]: t(
'dmsDataSource.batchTestConnection.connectFailed'
'dmsDataSource.databaseList.connectFailed'
),
[ListDBServicesFilterLastConnectionTestStatusEnum.connect_success]: t(
'dmsDataSource.batchTestConnection.connectSucceed'
'dmsDataSource.databaseList.connectSucceed'
)
};
14 changes: 13 additions & 1 deletion packages/base/src/locale/en-US/dmsDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,19 @@ export default {
'Whether to enable data mask configuration for SQL workbench',
dataMaskConfigTips:
'After enabling, the query results of the SQL workbench will be masked',
checkDataMaskButton: 'View data mask rule'
checkDataMaskButton: 'View data mask rule',
checkPrivileges: 'Check feature privileges',
privilegeResultTitle: 'Feature privilege check result',
privilegeStatusAvailable: 'Available',
privilegeStatusPartial: 'Partially available',
privilegeStatusUnavailable: 'Unavailable',
privilegeStatusUnsupported: 'Auto check not supported',
privilegeUnsupportedAutoCheck: 'Auto check not supported',
privilegeNotBlockSave:
'Insufficient feature privileges do not block create/save',
privilegePrecheckFailed: 'Privilege check pre-connection failed',
privilegePrecheckHint:
'To verify connectivity, use "Test data source connectivity"'
},

testConnectModal: {
Expand Down
12 changes: 11 additions & 1 deletion packages/base/src/locale/en-US/dmsProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@ export default {
testConnectFail:
'Test connectivity failed {{count}}, data source is {{name}}',
requestAuditErrorMessage:
'The current import information has validation failures, please modify it according to the hints in the downloaded file, and import again'
'The current import information has validation failures, please modify it according to the hints in the downloaded file, and import again',
dataSourceConnectError: 'Data source connectivity test failed',
returnModify: 'Return to modify',
continueSubmit: 'Continue to submit',
checkResultTitle: 'Pre-import check result',
connectivityColumn: 'Connectivity result',
privilegeColumn: 'Feature privilege result',
connectivitySuccess: 'Connectivity test succeeded',
connectivityFailed: 'Connectivity test failed',
privilegeNotBlockImport:
'Insufficient feature privileges do not block import'
},
backToList: 'Back to project list',
businessDescription: {
Expand Down
12 changes: 11 additions & 1 deletion packages/base/src/locale/zh-CN/dmsDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ export default {
lineNumberLimitTips: '当预计影响行数超过指定值则不回滚',
dataSourceConnectError: '数据源连通性测试失败',
returnModify: '返回修改',
continueSubmit: '继续提交'
continueSubmit: '继续提交',
checkPrivileges: '检查功能权限',
privilegeResultTitle: '功能权限检查结果',
privilegeStatusAvailable: '可用',
privilegeStatusPartial: '部分可用',
privilegeStatusUnavailable: '不可用',
privilegeStatusUnsupported: '暂不支持自动检查',
privilegeUnsupportedAutoCheck: '暂不支持自动检查',
privilegeNotBlockSave: '功能权限不足不影响创建/保存',
privilegePrecheckFailed: '权限检查前置连接失败',
privilegePrecheckHint: '如需验证连通性,请使用「测试数据源连通性」'
},

testConnectModal: {
Expand Down
8 changes: 7 additions & 1 deletion packages/base/src/locale/zh-CN/dmsProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ export default {
'当前导入信息存在校验失败,请结合下载文件中的提示进行修改,并重新导入',
dataSourceConnectError: '数据源连通性测试失败',
returnModify: '返回修改',
continueSubmit: '继续提交'
continueSubmit: '继续提交',
checkResultTitle: '导入前校验结果',
connectivityColumn: '连通结果',
privilegeColumn: '功能权限结果',
connectivitySuccess: '连通性测试成功',
connectivityFailed: '连通性测试失败',
privilegeNotBlockImport: '功能权限不足不影响导入'
},
backToList: '返回项目列表',
businessDescription: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,19 +582,55 @@ exports[`page/DataSource/AddDataSource render add database snap 1`] = `
>
<div
class="ant-space ant-space-vertical"
style="width: 100%;"
>
<div
class="ant-space-item"
style="margin-bottom: 8px;"
style="margin-bottom: 12px;"
>
<button
class="ant-btn ant-btn-default basic-button-wrapper css-10ae2zl"
type="button"
<div
class="ant-space ant-space-horizontal ant-space-align-start"
style="flex-wrap: wrap; margin-bottom: -8px;"
>
<span>
测试数据源连通性
</span>
</button>
<div
class="ant-space-item"
style="margin-right: 8px; padding-bottom: 8px;"
>
<div
class="ant-space ant-space-vertical"
>
<div
class="ant-space-item"
style="margin-bottom: 8px;"
>
<button
class="ant-btn ant-btn-default basic-button-wrapper css-10ae2zl"
type="button"
>
<span>
测试数据源连通性
</span>
</button>
</div>
<div
class="ant-space-item"
/>
</div>
</div>
<div
class="ant-space-item"
style="padding-bottom: 8px;"
>
<button
class="ant-btn ant-btn-default basic-button-wrapper css-10ae2zl"
type="button"
>
<span>
检查功能权限
</span>
</button>
</div>
</div>
</div>
<div
class="ant-space-item"
Expand Down Expand Up @@ -1828,19 +1864,55 @@ exports[`page/DataSource/AddDataSource render conenctable modal when current ser
>
<div
class="ant-space ant-space-vertical"
style="width: 100%;"
>
<div
class="ant-space-item"
style="margin-bottom: 8px;"
style="margin-bottom: 12px;"
>
<button
class="ant-btn ant-btn-default basic-button-wrapper css-10ae2zl"
type="button"
<div
class="ant-space ant-space-horizontal ant-space-align-start"
style="flex-wrap: wrap; margin-bottom: -8px;"
>
<span>
测试数据源连通性
</span>
</button>
<div
class="ant-space-item"
style="margin-right: 8px; padding-bottom: 8px;"
>
<div
class="ant-space ant-space-vertical"
>
<div
class="ant-space-item"
style="margin-bottom: 8px;"
>
<button
class="ant-btn ant-btn-default basic-button-wrapper css-10ae2zl"
type="button"
>
<span>
测试数据源连通性
</span>
</button>
</div>
<div
class="ant-space-item"
/>
</div>
</div>
<div
class="ant-space-item"
style="padding-bottom: 8px;"
>
<button
class="ant-btn ant-btn-default basic-button-wrapper css-10ae2zl"
type="button"
>
<span>
检查功能权限
</span>
</button>
</div>
</div>
</div>
<div
class="ant-space-item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ import { DataSourceFormField } from '../Form/index.type';
import { DmsApi } from '@actiontech/shared/lib/api';
import { DataSourceFormContextProvide } from '../../context';
import useCheckConnectable from '../../hooks/useCheckConnectable';
import useCheckPrivileges from '../../hooks/useCheckPrivileges';
const AddDataSource = () => {
const { t } = useTranslation();
const navigate = useTypedNavigate();
const [form] = useForm<DataSourceFormField>();
const { onCheckConnectable, loading, connectAble, connectErrorMessage } =
useCheckConnectable(form);
const {
privilegeLoading,
privilegeResult,
privilegeChecked,
onCheckPrivileges,
resetPrivilegeResult
} = useCheckPrivileges(form);
const [resultVisible, { setTrue: showResult, setFalse: hideResult }] =
useBoolean();
const [submitLoading, { setTrue: startSubmit, setFalse: submitFinish }] =
Expand Down Expand Up @@ -94,8 +102,9 @@ const AddDataSource = () => {
const resetAndHideResult = useCallback(() => {
hideResult();
form.resetFields();
resetPrivilegeResult();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [form]);
}, [form, resetPrivilegeResult]);
const onReset = () => {
EventEmitter.emit(EmitterKey.DMS_Reset_DataSource_Form);
};
Expand All @@ -110,6 +119,11 @@ const AddDataSource = () => {
connectAble,
connectErrorMessage,
onCheckConnectable,
privilegeLoading,
privilegeResult,
privilegeChecked,
onCheckPrivileges,
resetPrivilegeResult,
submitLoading
}}
>
Expand Down
Loading
Loading