Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature](base/setting/pushNotification): tidy file #185

Merged
merged 29 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bf09d72
upgrade system title
anny1021 Jan 22, 2024
34ed5f6
upgrade tab pushNotification
anny1021 Jan 22, 2024
2a6fc18
Merge branch 'main' into feature_base_setting
anny1021 Jan 23, 2024
1e79e90
upgrade processConnection
anny1021 Jan 23, 2024
d54c4aa
case BasicTitle
anny1021 Jan 23, 2024
e2f6c0f
case ConfigModifyBtn
anny1021 Jan 23, 2024
cbb48fe
case ConfigSubmitButtonField
anny1021 Jan 23, 2024
7c8ba26
case ConfigSwitch
anny1021 Jan 23, 2024
ecb7c70
case ConfigTestBtn
anny1021 Jan 23, 2024
d9b159c
case ConfigTestPopoverForm
anny1021 Jan 23, 2024
edbcff8
delete no used code
anny1021 Jan 23, 2024
7cf4f33
case LarkSetting components
anny1021 Jan 23, 2024
f8a4454
init case LarkSetting
anny1021 Jan 23, 2024
68b254e
formatter code
anny1021 Jan 23, 2024
aea7be7
case LarkSetting
anny1021 Jan 23, 2024
5a8a26a
case ConfigExtraButtons
anny1021 Jan 23, 2024
789f8ce
case ConfigField
anny1021 Jan 23, 2024
1c50464
case SMTPSetting
anny1021 Jan 24, 2024
4e05f2e
case ConfigExtraButtons
anny1021 Jan 24, 2024
b9c96cb
case ConfigField
anny1021 Jan 24, 2024
1a4beab
case Wechat
anny1021 Jan 24, 2024
0bfc537
case ConfigExtraButtons
anny1021 Jan 24, 2024
5796c34
case ConfigField
anny1021 Jan 24, 2024
34a37a2
case WebhookSetting
anny1021 Jan 24, 2024
7a8fa10
remove test only code
anny1021 Jan 24, 2024
91491b7
upgrade snap
anny1021 Jan 24, 2024
c0336d1
case store/system
anny1021 Jan 24, 2024
e906a93
case pushNotification
anny1021 Jan 24, 2024
46b4d20
Merge branch 'main' into feature_base_setting
anny1021 Jan 25, 2024
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
152 changes: 78 additions & 74 deletions packages/base/src/page/System/GlobalSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,187 +14,191 @@
import { integerValidate } from '@actiontech/shared/lib/utils/Common';
import useHideConfigInputNode from '../../../../../shared/lib/components/ConfigItem/hooks/useHideConfigInputNode';
import { ConfigFieldMapMeta } from '@actiontech/shared/lib/components/ConfigItem/index.type';
import SystemBasicTitle from '../components/BasicTitle';

const GlobalSetting = () => {
const { t } = useTranslation();
const [messageApi, messageContextHolder] = message.useMessage();
const [
orderExpiredHoursFieldVisible,
{
setTrue: showOrderExpiredHoursField,
setFalse: hideOrderExpiredHoursField
}
] = useBoolean();
const [
operationRecordExpiredHoursField,
{
setTrue: showOperationRecordExpiredHoursField,
setFalse: hideOperationRecordExpiredHoursField
}
] = useBoolean();
const [urlFieldVisible, { setTrue: showUrlField, setFalse: hideUrlField }] =
useBoolean();
const hideFieldsAction = () => {
if (orderExpiredHoursFieldVisible) hideOrderExpiredHoursField();
if (operationRecordExpiredHoursField)
hideOperationRecordExpiredHoursField();
if (urlFieldVisible) hideUrlField();
};
const hasOneFieldVisible = useMemo(
() =>
orderExpiredHoursFieldVisible ||
operationRecordExpiredHoursField ||
urlFieldVisible,
[
orderExpiredHoursFieldVisible,
operationRecordExpiredHoursField,
urlFieldVisible
]
);

useHideConfigInputNode(hasOneFieldVisible, hideFieldsAction);

const integerValidator = (value: string) => {
if (!integerValidate(value)) {
messageApi.error(t('common.form.rule.integer'));
return false;
}
return true;
};

const fieldMetaMap = new Map<
keyof IUpdateSystemVariablesReqV1,
ConfigFieldMapMeta
>([
[
'workflow_expired_hours',
{
hideField: hideOrderExpiredHoursField
}
],
[
'operation_record_expired_hours',
{
hideField: hideOperationRecordExpiredHoursField
}
],
[
'url',
{
hideField: hideUrlField
}
]
]);

const {
data: globalConfig,
loading: getConfigLoading,
refresh
} = useRequest(() =>
configuration.getSystemVariablesV1().then((res) => res?.data?.data ?? {})
);

const [submitLoading, { setTrue: startSubmit, setFalse: submitFinish }] =
useBoolean();

const submitGlobalConfig = (
value: string | number,
fieldName: keyof IUpdateSystemVariablesReqV1
) => {
const fieldMeta = fieldMetaMap.get(fieldName);

startSubmit();
configuration
.updateSystemVariablesV1({
...globalConfig,
[fieldName]: value
})
.then((res) => {
if (res.data.code === ResponseCode.SUCCESS) {
refresh();
fieldMeta?.hideField?.();
}
})
.finally(() => {
submitFinish();
});
};

return (
<section className="system-form-wrapper">
<div className="config-title-wrapper has-border">
{t('dmsSystem.tabPaneTitle.globalConfiguration')}
</div>
<Spin spinning={getConfigLoading || submitLoading}>
{messageContextHolder}
<ConfigItem
label={
<LabelContent>{`${t('dmsSystem.global.orderExpiredHours')}(${t(
'common.time.hour'
)})`}</LabelContent>
}
descNode={String(globalConfig?.workflow_expired_hours ?? '-')}
fieldVisible={orderExpiredHoursFieldVisible}
showField={showOrderExpiredHoursField}
hideField={hideOrderExpiredHoursField}
inputNode={
<EditInputNumber
fieldValue={globalConfig?.workflow_expired_hours ?? 2160}
validator={(value: number) => integerValidator(String(value))}
hideField={hideOrderExpiredHoursField}
onSubmit={(value: number) => {
submitGlobalConfig(value, 'workflow_expired_hours');
}}
/>
}
/>
<ConfigItem
label={
<LabelContent>{`${t(
'dmsSystem.global.operationRecordExpiredHours'
)}(${t('common.time.hour')})`}</LabelContent>
}
descNode={String(globalConfig?.operation_record_expired_hours ?? '-')}
fieldVisible={operationRecordExpiredHoursField}
showField={showOperationRecordExpiredHoursField}
hideField={hideOperationRecordExpiredHoursField}
inputNode={
<EditInputNumber
fieldValue={globalConfig?.operation_record_expired_hours ?? 2160}
validator={(value: number) => integerValidator(String(value))}
hideField={hideOperationRecordExpiredHoursField}
onSubmit={(value: number) => {
submitGlobalConfig(value, 'operation_record_expired_hours');
}}
/>
}
/>
<ConfigItem
label={
<LabelContent
tips={`${t('dmsSystem.global.urlAddressPrefixTips')}, ${t(
'dmsSystem.global.urlAddressFormatTips'
)} `}
>
{t('dmsSystem.global.urlAddressPrefix')}
</LabelContent>
}
descNode={!!globalConfig?.url ? globalConfig.url : '-'}
fieldVisible={urlFieldVisible}
showField={showUrlField}
hideField={hideUrlField}
inputNode={
<EditInput
fieldValue={globalConfig?.url ?? ''}
hideField={hideUrlField}
onSubmit={(value: string) => {
submitGlobalConfig(value, 'url');
}}
/>
}
/>
</Spin>
</section>
<SystemBasicTitle title={t('dmsSystem.tabPaneTitle.globalConfiguration')}>
<>
<Spin spinning={getConfigLoading || submitLoading}>

Check warning on line 127 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 127 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
{messageContextHolder}
<ConfigItem
label={
<LabelContent>{`${t('dmsSystem.global.orderExpiredHours')}(${t(
'common.time.hour'
)})`}</LabelContent>
}
descNode={String(globalConfig?.workflow_expired_hours ?? '-')}

Check warning on line 135 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 135 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
fieldVisible={orderExpiredHoursFieldVisible}
showField={showOrderExpiredHoursField}
hideField={hideOrderExpiredHoursField}
inputNode={
<EditInputNumber
fieldValue={globalConfig?.workflow_expired_hours ?? 2160}

Check warning on line 141 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 141 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
validator={(value: number) => integerValidator(String(value))}

Check warning on line 142 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 142 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
hideField={hideOrderExpiredHoursField}
onSubmit={(value: number) => {

Check warning on line 144 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
submitGlobalConfig(value, 'workflow_expired_hours');

Check warning on line 145 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}}
/>
}
/>
<ConfigItem
label={
<LabelContent>{`${t(
'dmsSystem.global.operationRecordExpiredHours'
)}(${t('common.time.hour')})`}</LabelContent>
}
descNode={String(
globalConfig?.operation_record_expired_hours ?? '-'

Check warning on line 157 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 157 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
)}
fieldVisible={operationRecordExpiredHoursField}
showField={showOperationRecordExpiredHoursField}
hideField={hideOperationRecordExpiredHoursField}
inputNode={
<EditInputNumber
fieldValue={
globalConfig?.operation_record_expired_hours ?? 2160

Check warning on line 165 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 165 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}
validator={(value: number) => integerValidator(String(value))}

Check warning on line 167 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 167 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
hideField={hideOperationRecordExpiredHoursField}
onSubmit={(value: number) => {

Check warning on line 169 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
submitGlobalConfig(value, 'operation_record_expired_hours');

Check warning on line 170 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}}
/>
}
/>
<ConfigItem
label={
<LabelContent
tips={`${t('dmsSystem.global.urlAddressPrefixTips')}, ${t(
'dmsSystem.global.urlAddressFormatTips'
)} `}
>
{t('dmsSystem.global.urlAddressPrefix')}
</LabelContent>
}
descNode={!!globalConfig?.url ? globalConfig.url : '-'}

Check warning on line 185 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 185 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
fieldVisible={urlFieldVisible}
showField={showUrlField}
hideField={hideUrlField}
inputNode={
<EditInput
fieldValue={globalConfig?.url ?? ''}

Check warning on line 191 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 191 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
hideField={hideUrlField}
onSubmit={(value: string) => {

Check warning on line 193 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
submitGlobalConfig(value, 'url');

Check warning on line 194 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}}
/>
}
/>
</Spin>
</>
</SystemBasicTitle>
);

Check warning on line 202 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
};

Check warning on line 203 in packages/base/src/page/System/GlobalSetting/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Expand Down
58 changes: 27 additions & 31 deletions packages/base/src/page/System/License/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { useBoolean, useRequest } from 'ahooks';
import { Space } from 'antd';
import { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import EmitterKey from '../../../data/EmitterKey';

import { updateSystemModalStatus } from '../../../store/system';
import dms from '@actiontech/shared/lib/api/base/service/dms';
import EventEmitter from '../../../utils/EventEmitter';
import { Row } from 'antd';
import { BasicButton, BasicToolTips } from '@actiontech/shared';
import { LicenseColumn } from './index.data';
import { IconTipGray } from '@actiontech/shared/lib/Icon';
import { ActiontechTable } from '@actiontech/shared/lib/components/ActiontechTable';
import EmitterKey from '../../../data/EmitterKey';

import { Space } from 'antd';
import { BasicButton } from '@actiontech/shared';
import { ModalName } from '../../../data/ModalName';
import SystemBasicTitle from '../components/BasicTitle';
import ImportLicense from './Modal/ImportLicense';
import dms from '@actiontech/shared/lib/api/base/service/dms';
import { LicenseColumn } from './index.data';
import { ActiontechTable } from '@actiontech/shared/lib/components/ActiontechTable';

const License = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -54,19 +55,11 @@ const License = () => {
}, [refreshLicenseList]);

return (
<section className="system-form-wrapper">
<Row
className="config-title-wrapper has-border"
justify={'space-between'}
align={'middle'}
>
<Space>
{t('dmsSystem.tabPaneTitle.license')}
{/* todo: 此处提示语待产品给出后调整 */}
<BasicToolTips title={t('dmsSystem.license.productName')}>
<IconTipGray />
</BasicToolTips>
</Space>
<SystemBasicTitle
title={t('dmsSystem.tabPaneTitle.license')}
// todo: 此处提示语待产品给出后调整
titleTip={t('dmsSystem.license.productName')}
titleExtra={
<Space key="button-wrapper">
<BasicButton
type="primary"
Expand All @@ -79,16 +72,19 @@ const License = () => {
{t('dmsSystem.license.import')}
</BasicButton>
</Space>
</Row>
<ActiontechTable
rowKey="name"
columns={LicenseColumn}
dataSource={data?.list}
loading={loading}
className="clear-padding-bottom"
/>
<ImportLicense />
</section>
}
>
<>
<ActiontechTable
rowKey="name"
columns={LicenseColumn}
dataSource={data?.list}
loading={loading}
className="clear-padding-bottom"
/>
<ImportLicense />
</>
</SystemBasicTitle>
);
};

Expand Down
14 changes: 7 additions & 7 deletions packages/base/src/page/System/LoginConnection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useTranslation } from 'react-i18next';
import LDAPSetting from './LDAPSetting';
import Oauth from './Oauth';
import SystemBasicTitle from '../components/BasicTitle';

const LoginConnection = () => {
const { t } = useTranslation();

return (
<section className="system-form-wrapper">
<div className="config-title-wrapper">
{t('dmsSystem.tabPaneTitle.loginConnection')}
</div>
<LDAPSetting />
<Oauth />
</section>
<SystemBasicTitle title={t('dmsSystem.tabPaneTitle.loginConnection')}>
<>
<LDAPSetting />
<Oauth />
</>
</SystemBasicTitle>
);

Check warning on line 16 in packages/base/src/page/System/LoginConnection/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
};

Check warning on line 17 in packages/base/src/page/System/LoginConnection/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

export default LoginConnection;
8 changes: 3 additions & 5 deletions packages/base/src/page/System/PersonalizeSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useMemo } from 'react';
import { ConfigFieldMapMeta } from '@actiontech/shared/lib/components/ConfigItem/index.type';
import useHideConfigInputNode from '@actiontech/shared/lib/components/ConfigItem/hooks/useHideConfigInputNode';
import useSystemConfig from '../../../hooks/useSystemConfig';
import SystemBasicTitle from '../components/BasicTitle';

const PersonalizeSetting: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -87,10 +88,7 @@ const PersonalizeSetting: React.FC = () => {
};

return (
<section className="system-form-wrapper">
<div className="config-title-wrapper has-border">
{t('dmsSystem.tabPaneTitle.personalize')}
</div>
<SystemBasicTitle title={t('dmsSystem.tabPaneTitle.personalize')}>
<Spin spinning={loading}>
<ConfigItem
label={
Expand Down Expand Up @@ -132,7 +130,7 @@ const PersonalizeSetting: React.FC = () => {
}
/>
</Spin>
</section>
</SystemBasicTitle>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { useTranslation } from 'react-i18next';
import { useRef } from 'react';

import { message, Space } from 'antd';
import { BasicToolTips, BasicButton } from '@actiontech/shared';
import ConfigModifyBtn from '../../../components/ConfigModifyBtn';
import { IconTest } from '../../../../../icon/system';

import configuration from '@actiontech/shared/lib/api/sqle/service/configuration';
import { ResponseCode } from '@actiontech/shared/lib/enum';

interface ConfigExtraButtonsProps {
isConfigClosed: boolean;
extraButtonsVisible: boolean;
handleClickModify: () => void;
}

const ConfigExtraButtons = ({
isConfigClosed,
extraButtonsVisible,
handleClickModify
}: ConfigExtraButtonsProps) => {
const { t } = useTranslation();

Check warning on line 23 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [messageApi, messageContextHolder] = message.useMessage();

Check warning on line 24 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

const testTing = useRef(false);

Check warning on line 26 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const testDingTalkConfiguration = () => {
if (testTing.current) {
return;

Check warning on line 29 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 30 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 30 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
testTing.current = true;

Check warning on line 31 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
configuration
.testDingTalkConfigV1()
.then((res) => {
if (res.data.code === ResponseCode.SUCCESS) {
if (res.data.data?.is_ding_talk_send_normal) {
messageApi.success(t('dmsSystem.dingTalk.testSuccess'));

Check warning on line 37 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
} else {
messageApi.error(
res.data.data?.send_error_message ?? t('common.unknownError')

Check warning on line 40 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 40 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
);

Check warning on line 41 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 42 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 42 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 42 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 43 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 43 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
})
.finally(() => {
testTing.current = false;

Check warning on line 46 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
});

Check warning on line 47 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
};

Check warning on line 48 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

return (
<>
{messageContextHolder}
<Space size={12} hidden={isConfigClosed || !extraButtonsVisible}>
<BasicToolTips title={t('common.test')} titleWidth={54}>
<BasicButton
htmlType="submit"
type="text"
className="system-config-button"
loading={testTing.current}
disabled={testTing.current}
icon={<IconTest />}
onClick={testDingTalkConfiguration}
/>
</BasicToolTips>
<ConfigModifyBtn onClick={handleClickModify} />
</Space>
</>
);

Check warning on line 68 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
};

Check warning on line 69 in packages/base/src/page/System/ProcessConnection/DingTalkSetting/components/ConfigExtraButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

export default ConfigExtraButtons;
Loading
Loading