mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:47:10 +00:00
fix(plugin-workflow): fix locale key in storage (#4704)
This commit is contained in:
parent
2d2f1c8cc8
commit
173dfbfe21
@ -7,9 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { css } from '@nocobase/client';
|
import { css, useAPIClient } from '@nocobase/client';
|
||||||
import { InputNumber, Select } from 'antd';
|
import { InputNumber, Select } from 'antd';
|
||||||
import React from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { Cron } from 'react-js-cron';
|
import { Cron } from 'react-js-cron';
|
||||||
import { useWorkflowTranslation } from '../../locale';
|
import { useWorkflowTranslation } from '../../locale';
|
||||||
import CronZhCN from './locale/Cron.zh-CN';
|
import CronZhCN from './locale/Cron.zh-CN';
|
||||||
@ -65,20 +65,24 @@ function CommonRepeatField({ value, onChange }) {
|
|||||||
|
|
||||||
export function RepeatField({ value = null, onChange }) {
|
export function RepeatField({ value = null, onChange }) {
|
||||||
const { t } = useWorkflowTranslation();
|
const { t } = useWorkflowTranslation();
|
||||||
|
const api = useAPIClient();
|
||||||
const typeValue = getRepeatTypeValue(value);
|
const typeValue = getRepeatTypeValue(value);
|
||||||
function onTypeChange(v) {
|
const onTypeChange = useCallback(
|
||||||
if (v === 'none') {
|
(v) => {
|
||||||
onChange(null);
|
if (v === 'none') {
|
||||||
return;
|
onChange(null);
|
||||||
}
|
return;
|
||||||
if (v === 'cron') {
|
}
|
||||||
onChange('0 * * * * *');
|
if (v === 'cron') {
|
||||||
return;
|
onChange('0 * * * * *');
|
||||||
}
|
return;
|
||||||
onChange(v);
|
}
|
||||||
}
|
onChange(v);
|
||||||
|
},
|
||||||
|
[onChange],
|
||||||
|
);
|
||||||
|
|
||||||
const locale = languages[localStorage.getItem('NOCOBASE_LOCALE') || 'en-US'];
|
const locale = languages[localStorage.getItem(api.auth.locale) || 'en-US'];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<fieldset
|
<fieldset
|
||||||
|
Loading…
Reference in New Issue
Block a user