Skip to content
Merged
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
2 changes: 2 additions & 0 deletions packages/base/src/locale/en-US/dmsDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export default {
text: 'Enable scan task for DB instance'
},

enableMaskingTask: 'Enable data masking task',

batchImportDataSource: {
buttonText: 'Batch import DB instances',
title: 'Batch import DB instances',
Expand Down
2 changes: 2 additions & 0 deletions packages/base/src/locale/zh-CN/dmsDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export default {
text: '为数据源开启扫描任务'
},

enableMaskingTask: '为数据源开启脱敏任务',

batchImportDataSource: {
buttonText: '批量导入数据源',
title: '批量导入数据源',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Do not modify this file in the dms-ui repository
*/

import { IListDBServiceV2 } from '@actiontech/shared/lib/api/base/service/common';

type Props = {
visible: boolean;
projectUID: string;
initialDbService: IListDBServiceV2 | null;
onClose: () => void;
onSuccess: () => void;
};

const CreateTaskModal: React.FC<Props> = () => {
return null;
};

export default CreateTaskModal;
Original file line number Diff line number Diff line change
Expand Up @@ -1162,101 +1162,6 @@ exports[`page/DataSource/AddDataSource render add database snap 1`] = `
</div>
</section>
</section>
<section
class="css-1114g56"
>
<section
class="css-bspaai"
>
<h1
class="ant-typography css-1eepp70"
>
数据脱敏配置
</h1>
<div
class="ant-form-item has-label-tip css-1jlm9cy ant-form-item-has-success"
>
<div
class="ant-row ant-form-item-row"
>
<div
class="ant-col ant-col-12 ant-form-item-label ant-form-item-label-left"
>
<label
class="ant-form-item-no-colon"
for="is_enable_masking"
title=""
>
<div
class="label-cont-custom"
>
<div>
SQL工作台是否开启脱敏配置
</div>
<div
class="tip-content-box"
>
<div
class="ant-space ant-space-horizontal ant-space-align-center"
>
<div
class="ant-space-item"
style="margin-right: 8px;"
>
开启后,将对SQL工作台的查询结果进行脱敏
</div>
<div
class="ant-space-item"
>
<a
href="/project/700300/data-mask-rule-overview"
target="_blank"
>
查看脱敏规则
</a>
</div>
</div>
</div>
</div>
</label>
</div>
<div
class="ant-col ant-col-11 ant-col-push-1 ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<button
aria-checked="false"
class="ant-switch basic-switch-wrapper css-g6dhbn"
id="is_enable_masking"
role="switch"
type="button"
>
<div
class="ant-switch-handle"
/>
<span
class="ant-switch-inner"
>
<span
class="ant-switch-inner-checked"
/>
<span
class="ant-switch-inner-unchecked"
/>
</span>
</button>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</form>
</section>
</div>
Expand Down Expand Up @@ -2246,101 +2151,6 @@ exports[`page/DataSource/AddDataSource render conenctable modal when current ser
</div>
</section>
</section>
<section
class="css-1114g56"
>
<section
class="css-bspaai"
>
<h1
class="ant-typography css-1eepp70"
>
数据脱敏配置
</h1>
<div
class="ant-form-item has-label-tip css-1jlm9cy ant-form-item-has-success"
>
<div
class="ant-row ant-form-item-row"
>
<div
class="ant-col ant-col-12 ant-form-item-label ant-form-item-label-left"
>
<label
class="ant-form-item-no-colon"
for="is_enable_masking"
title=""
>
<div
class="label-cont-custom"
>
<div>
SQL工作台是否开启脱敏配置
</div>
<div
class="tip-content-box"
>
<div
class="ant-space ant-space-horizontal ant-space-align-center"
>
<div
class="ant-space-item"
style="margin-right: 8px;"
>
开启后,将对SQL工作台的查询结果进行脱敏
</div>
<div
class="ant-space-item"
>
<a
href="/project/700300/data-mask-rule-overview"
target="_blank"
>
查看脱敏规则
</a>
</div>
</div>
</div>
</div>
</label>
</div>
<div
class="ant-col ant-col-11 ant-col-push-1 ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<button
aria-checked="false"
class="ant-switch basic-switch-wrapper css-g6dhbn"
id="is_enable_masking"
role="switch"
type="button"
>
<div
class="ant-switch-handle"
/>
<span
class="ant-switch-inner"
>
<span
class="ant-switch-inner-checked"
/>
<span
class="ant-switch-inner-unchecked"
/>
</span>
</button>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</form>
</section>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ describe('page/DataSource/AddDataSource', () => {
db_type: 'mysql',
desc: undefined,
host: '1.1.1.1',
is_enable_masking: false,
maintenance_times: [],
name: 'name-database',
password: 'root',
Expand Down Expand Up @@ -430,7 +429,6 @@ describe('page/DataSource/AddDataSource', () => {
db_type: 'mysql',
desc: undefined,
host: '1.1.1.1',
is_enable_masking: false,
maintenance_times: [],
name: 'name-database',
password: 'root',
Expand Down Expand Up @@ -615,30 +613,4 @@ describe('page/DataSource/AddDataSource', () => {
EmitterKey.DMS_Reset_DataSource_Form
);
});

it('check enable masking have href', async () => {
customRender();
expect(screen.getByText('查看脱敏规则')).toBeInTheDocument();
expect(screen.getByText('查看脱敏规则')).toHaveAttribute(
'href',
`/project/${projectID}/data-mask-rule-overview`
);
});

it('check enable masking have href when project is undefined', async () => {
mockUseCurrentProject({ projectID: undefined });
const { baseElement } = customRender();
await act(async () => jest.advanceTimersByTime(3000));
expect(screen.queryByText('查看脱敏规则')).not.toBeInTheDocument();
const projectEle = getBySelector('#project');
expect(projectEle).not.toBeDisabled();
fireEvent.mouseDown(projectEle, baseElement);
await act(async () => jest.advanceTimersByTime(300));
fireEvent.click(screen.getByText('test_project_1'));
await act(async () => jest.advanceTimersByTime(3000));
expect(screen.getByText('查看脱敏规则')).toHaveAttribute(
'href',
`/project/${mockProjectList[0].uid}/data-mask-rule-overview`
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ const AddDataSource = () => {
}
},
// #endif
additional_params: values.asyncParams,
// #if [dms]
is_enable_masking: values.is_enable_masking
// #endif
additional_params: values.asyncParams
};
// #if [sqle && ee]
if (dbService.sqle_config) {
Expand Down
Loading
Loading