fix(plugin-workflow): client minor fixes (#3062)

This commit is contained in:
Junyi 2023-11-19 19:24:34 +08:00 committed by GitHub
parent eac8559104
commit fbe3d2d9a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 13 deletions

View File

@ -41,6 +41,7 @@ export const Action: ComposedAction = observer(
onClick,
style,
openSize,
disabled: propsDisabled,
...others
} = useProps(props);
const { wrapSSR, componentCls, hashId } = useStyles();
@ -56,7 +57,7 @@ export const Action: ComposedAction = observer(
const record = useRecord();
const designerProps = fieldSchema['x-designer-props'];
const openMode = fieldSchema?.['x-component-props']?.['openMode'];
const disabled = form.disabled || field.disabled || field.data?.disabled || props.disabled;
const disabled = form.disabled || field.disabled || field.data?.disabled || propsDisabled;
const linkageRules = fieldSchema?.['x-linkage-rules'] || [];
const { designable } = useDesignable();
const tarComponent = useComponent(component) || component;

View File

@ -2,7 +2,7 @@ import { CloseOutlined, LoadingOutlined } from '@ant-design/icons';
import { useFormLayout } from '@formily/antd-v5';
import { connect, mapProps, mapReadPretty } from '@formily/react';
import { isValid } from '@formily/shared';
import { Button, Input } from 'antd';
import { Button, Input, Space } from 'antd';
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Icon, hasIcon, icons } from '../../../icon';
@ -15,7 +15,7 @@ function IconField(props: any) {
const { t } = useTranslation();
return (
<div>
<Input.Group compact>
<Space.Compact>
<PopoverWithStopPropagation
placement={'bottom'}
open={visible}
@ -57,7 +57,7 @@ function IconField(props: any) {
}}
></Button>
)}
</Input.Group>
</Space.Compact>
</div>
);
}

View File

@ -9,7 +9,7 @@ import {
useResourceActionContext,
} from '@nocobase/client';
import { str2moment } from '@nocobase/utils/client';
import { Breadcrumb, Dropdown, Space, Tag } from 'antd';
import { Breadcrumb, Dropdown, Result, Space, Spin, Tag } from 'antd';
import React, { useCallback, useEffect, useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { CanvasContent } from './CanvasContent';
@ -58,7 +58,7 @@ function JobModal() {
schema={{
type: 'void',
properties: {
[`${job?.id}-modal`]: {
[`${job?.id}-${job?.updatedAt}-modal`]: {
type: 'void',
'x-decorator': 'Form',
'x-decorator-props': {
@ -218,10 +218,9 @@ export function ExecutionCanvas() {
if (!data?.data) {
if (loading) {
return <div>{lang('Loading')}</div>;
} else {
return <div>{lang('Load failed')}</div>;
return <Spin />;
}
return <Result status="404" title="Not found" />;
}
const { jobs = [], workflow: { nodes = [], revisions = [], ...workflow } = {}, ...execution } = data?.data ?? {};

View File

@ -10,7 +10,7 @@ import {
useResourceContext,
} from '@nocobase/client';
import { str2moment } from '@nocobase/utils/client';
import { App, Breadcrumb, Button, Dropdown, Switch, message } from 'antd';
import { App, Breadcrumb, Button, Dropdown, Result, Spin, Switch, message } from 'antd';
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Link, useNavigate } from 'react-router-dom';
@ -60,7 +60,10 @@ export function WorkflowCanvas() {
}, [data?.data]);
if (!data?.data) {
return <div>{loading ? lang('Loading') : lang('Load failed')}</div>;
if (loading) {
return <Spin />;
}
return <Result status="404" title="Not found" />;
}
const { nodes = [], revisions = [], ...workflow } = data?.data ?? {};

View File

@ -522,7 +522,7 @@ export function SchemaConfigButton(props) {
const [visible, setVisible] = useState(false);
return (
<>
<Button type="primary" onClick={() => setVisible(true)}>
<Button type="primary" onClick={() => setVisible(true)} disabled={false}>
{workflow.executed ? lang('View user interface') : lang('Configure user interface')}
</Button>
<ActionContextProvider value={{ visible, setVisible, formValueChanged: false }}>

View File

@ -25,4 +25,4 @@ export const WorkflowTodoBlockInitializer: FC<any> = ({ insert, ...rest }) => {
}}
/>
);
}
};