Skip to content

Commit

Permalink
Merge pull request #320 from actiontech/feature/issue-ee-943-2
Browse files Browse the repository at this point in the history
Feature/issue ee 943 2
  • Loading branch information
Rain-1214 authored Sep 21, 2023
2 parents 0355871 + ef3a8c5 commit 5a8de31
Show file tree
Hide file tree
Showing 18 changed files with 627 additions and 134 deletions.
2 changes: 1 addition & 1 deletion craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = {
const res = {};
for (let i = 0; i < 10; i++) {
res[`/v${i}`] = {
target: 'http://10.186.62.87:10000',
target: 'http://192.168.22.81:10000',
secure: false,
changeOrigin: true,
ws: true,
Expand Down
1 change: 1 addition & 0 deletions src/components/EditText/EditText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const EditText: React.FC<EditTextProps> = (props) => {

return (
<Typography.Paragraph
className="clear-margin-bottom"
{...otherProps}
editable={{
...editable,
Expand Down
6 changes: 3 additions & 3 deletions src/components/EditText/__snapshots__/EditText.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`EditText should call onEnd with user input when user press enter key 1`] = `
<div>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
test
<div
Expand Down Expand Up @@ -40,7 +40,7 @@ exports[`EditText should call onEnd with user input when user press enter key 1`
exports[`EditText should call onEnd with user input when user press enter key 2`] = `
<div>
<div
class="ant-typography ant-typography-edit-content ant-typography-div"
class="ant-typography ant-typography-edit-content clear-margin-bottom ant-typography-div"
>
<textarea
class="ant-input"
Expand Down Expand Up @@ -75,7 +75,7 @@ exports[`EditText should call onEnd with user input when user press enter key 2`
exports[`EditText should call onEnd with user input when user press enter key 3`] = `
<div>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
test
<div
Expand Down
17 changes: 17 additions & 0 deletions src/locale/zh-CN/sqlManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,25 @@ export default {

actions: {
batchAssignment: '批量指派',
batchAssignmentSuccessTips: '批量指派负责人成功',
signalAssignmentSuccessTips: '指派负责人成功',
signalUpdateStatusSuccessTips: '更新SQL状态成功',
batchSolve: '批量解决',
batchSolveTips: '是否确认将所选SQL设为已解决?',
batchSolveSuccessTips: '批量解决SQL成功',
batchIgnore: '批量忽略',
batchIgnoreTips: '是否确认将所选SQL设为已忽略?',
batchIgnoreSuccessTips: '批量忽略SQL成功',
},

assignMember: {
label: '指派负责人',
},
updateStatus: {
triggerText: '变更状态',
label: '变更当前SQL状态',
solve: '解决',
ignore: '忽略',
},
},
};
1 change: 0 additions & 1 deletion src/page/Order/AuditResult/AuditResultInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const AuditResultInfo: React.FC<AuditResultColumnProps> = ({
</div>
);
};

const renderAuditColumn = () => {
if (auditResultNum === 1)
return <AuditResultErrorMessage auditResult={auditResult} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
<div
aria-label="Edit"
Expand Down Expand Up @@ -1053,7 +1053,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
have a describe
<div
Expand Down Expand Up @@ -1610,7 +1610,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
this is a test
<div
Expand Down Expand Up @@ -3280,7 +3280,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
<div
aria-label="Edit"
Expand Down Expand Up @@ -3432,7 +3432,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
have a describe
<div
Expand Down Expand Up @@ -3989,7 +3989,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
this is a test
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
<div
aria-label="Edit"
Expand Down Expand Up @@ -1554,7 +1554,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
have a describe
<div
Expand Down Expand Up @@ -2111,7 +2111,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
this is a test
<div
Expand Down
6 changes: 3 additions & 3 deletions src/page/Order/Create/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
<div
aria-label="Edit"
Expand Down Expand Up @@ -1851,7 +1851,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
have a describe
<div
Expand Down Expand Up @@ -2408,7 +2408,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
this is a test
<div
Expand Down
6 changes: 3 additions & 3 deletions src/page/Order/Detail/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4721,7 +4721,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
<div
aria-label="Edit"
Expand Down Expand Up @@ -4873,7 +4873,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
have a describe
<div
Expand Down Expand Up @@ -5430,7 +5430,7 @@ use aaab;
class="ant-table-cell"
>
<div
class="ant-typography"
class="ant-typography clear-margin-bottom"
>
this is a test
<div
Expand Down
101 changes: 101 additions & 0 deletions src/page/SQLManagement/SQLPanel/AssignMember.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { Button, Col, Form, Popover, Row, Select, Space, Spin } from 'antd';
import { ReactNode, useEffect, useState } from 'react';
import useMember from '../../../hooks/useMember';
import { useTranslation } from 'react-i18next';

const AssignMember: React.FC<{
children: ReactNode;
projectName: string;
onConfirm: (values: string[]) => Promise<void> | undefined;
disabled: boolean;
}> = ({ children, projectName, onConfirm, disabled }) => {
const { t } = useTranslation();
const [form] = Form.useForm<{ members: string[] }>();
const [open, setOpen] = useState(false);
const { generateMemberSelectOption, updateMemberList, loading } = useMember();

const submit = async () => {
const values = await form.validateFields();
onConfirm(values.members)?.finally(() => {
setOpen(false);
form.resetFields();
});
};

useEffect(() => {
if (open) {
updateMemberList(projectName);
}
}, [open, projectName, updateMemberList]);
return (
<Popover
trigger={['click']}
open={open}
onOpenChange={(open) => {
if (open) {
setOpen(true);
} else {
setOpen(false);
form.resetFields();
}
}}
content={
<Spin spinning={loading}>
<Space direction="vertical" className="full-width-element">
<Form form={form}>
<Form.Item
style={{ marginBottom: 0 }}
name="members"
label={t('sqlManagement.table.assignMember.label')}
rules={[
{
required: true,
},
]}
>
<Select
style={{ width: 200 }}
showSearch
allowClear
mode="multiple"
>
{generateMemberSelectOption()}
</Select>
</Form.Item>
</Form>
<Row>
<Col span={24} style={{ textAlign: 'right' }}>
<Space>
<Button
size="small"
onClick={() => {
setOpen(false);
}}
>
{t('common.cancel')}
</Button>
<Button type="primary" size="small" onClick={submit}>
{t('common.ok')}
</Button>
</Space>
</Col>
</Row>
</Space>
</Spin>
}
>
<div
onClick={() => {
if (disabled) {
return;
}
setOpen(true);
}}
>
{children}
</div>
</Popover>
);
};

export default AssignMember;
6 changes: 5 additions & 1 deletion src/page/SQLManagement/SQLPanel/FilterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import useInstance from '../../../hooks/useInstance';
import { useEffect } from 'react';
import moment from 'moment';
import useStaticStatus from './hooks/useStaticStatus';
import { getInstanceTipListV1FunctionalModuleEnum } from '../../../api/instance/index.enum';

const FilterForm: React.FC<SQLPanelFilterFormProps> = ({
form,
Expand All @@ -41,7 +42,10 @@ const FilterForm: React.FC<SQLPanelFilterFormProps> = ({
return current && current > moment().endOf('day');
};
useEffect(() => {
updateInstanceList({ project_name: projectName });
updateInstanceList({
project_name: projectName,
functional_module: getInstanceTipListV1FunctionalModuleEnum.sql_manage,
});
}, [projectName, updateInstanceList]);
return (
<Form<SQLPanelFilterFormFields> form={form} onFinish={submit}>
Expand Down
Loading

0 comments on commit 5a8de31

Please sign in to comment.