@nocobase/plugin-workflow-manual 0.17.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +9 -0
- package/README.zh-CN.md +9 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/WorkflowTodo.d.ts +5 -0
- package/dist/client/WorkflowTodoBlockInitializer.d.ts +2 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +13 -0
- package/dist/client/instruction/AssigneesSelect.d.ts +6 -0
- package/dist/client/instruction/DetailsBlockProvider.d.ts +2 -0
- package/dist/client/instruction/FormBlockInitializer.d.ts +2 -0
- package/dist/client/instruction/FormBlockProvider.d.ts +2 -0
- package/dist/client/instruction/ModeConfig.d.ts +5 -0
- package/dist/client/instruction/SchemaConfig.d.ts +49 -0
- package/dist/client/instruction/forms/create.d.ts +3 -0
- package/dist/client/instruction/forms/custom.d.ts +5 -0
- package/dist/client/instruction/forms/update.d.ts +3 -0
- package/dist/client/instruction/index.d.ts +83 -0
- package/dist/client/instruction/utils.d.ts +1 -0
- package/dist/externalVersion.js +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +30 -0
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/index.js +39 -0
- package/dist/locale/zh-CN.json +30 -0
- package/dist/server/ManualInstruction.d.ts +28 -0
- package/dist/server/ManualInstruction.js +150 -0
- package/dist/server/Plugin.d.ts +6 -0
- package/dist/server/Plugin.js +73 -0
- package/dist/server/actions.d.ts +2 -0
- package/dist/server/actions.js +94 -0
- package/dist/server/collecions/jobs.d.ts +19 -0
- package/dist/server/collecions/jobs.js +39 -0
- package/dist/server/collecions/users.d.ts +15 -0
- package/dist/server/collecions/users.js +37 -0
- package/dist/server/collecions/users_jobs.d.ts +3 -0
- package/dist/server/collecions/users_jobs.js +70 -0
- package/dist/server/forms/create.d.ts +5 -0
- package/dist/server/forms/create.js +41 -0
- package/dist/server/forms/index.d.ts +6 -0
- package/dist/server/forms/index.js +38 -0
- package/dist/server/forms/update.d.ts +6 -0
- package/dist/server/forms/update.js +41 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/package.json +33 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
- package/src/client/WorkflowTodo.tsx +618 -0
- package/src/client/WorkflowTodoBlockInitializer.tsx +30 -0
- package/src/client/index.ts +44 -0
- package/src/client/instruction/AssigneesSelect.tsx +39 -0
- package/src/client/instruction/DetailsBlockProvider.tsx +85 -0
- package/src/client/instruction/FormBlockInitializer.tsx +72 -0
- package/src/client/instruction/FormBlockProvider.tsx +84 -0
- package/src/client/instruction/ModeConfig.tsx +85 -0
- package/src/client/instruction/SchemaConfig.tsx +538 -0
- package/src/client/instruction/forms/create.tsx +112 -0
- package/src/client/instruction/forms/custom.tsx +403 -0
- package/src/client/instruction/forms/update.tsx +150 -0
- package/src/client/instruction/index.tsx +157 -0
- package/src/client/instruction/utils.ts +19 -0
- package/src/index.ts +2 -0
- package/src/locale/en-US.json +30 -0
- package/src/locale/index.ts +12 -0
- package/src/locale/zh-CN.json +30 -0
- package/src/server/ManualInstruction.ts +151 -0
- package/src/server/Plugin.ts +48 -0
- package/src/server/__tests__/collections/categories.ts +15 -0
- package/src/server/__tests__/collections/comments.ts +24 -0
- package/src/server/__tests__/collections/posts.ts +40 -0
- package/src/server/__tests__/collections/replies.ts +9 -0
- package/src/server/__tests__/collections/tags.ts +15 -0
- package/src/server/__tests__/instruction.test.ts +1154 -0
- package/src/server/actions.ts +100 -0
- package/src/server/collecions/jobs.ts +17 -0
- package/src/server/collecions/users.ts +15 -0
- package/src/server/collecions/users_jobs.ts +50 -0
- package/src/server/forms/create.ts +23 -0
- package/src/server/forms/index.ts +13 -0
- package/src/server/forms/update.ts +23 -0
- package/src/server/index.ts +1 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { TableOutlined } from '@ant-design/icons';
|
|
3
|
+
|
|
4
|
+
import { SchemaInitializerItem, useSchemaInitializer, useSchemaInitializerItem } from '@nocobase/client';
|
|
5
|
+
|
|
6
|
+
export const WorkflowTodoBlockInitializer: FC<any> = () => {
|
|
7
|
+
const itemConfig = useSchemaInitializerItem();
|
|
8
|
+
const { insert } = useSchemaInitializer();
|
|
9
|
+
return (
|
|
10
|
+
<SchemaInitializerItem
|
|
11
|
+
icon={<TableOutlined />}
|
|
12
|
+
{...itemConfig}
|
|
13
|
+
onClick={() => {
|
|
14
|
+
insert({
|
|
15
|
+
type: 'void',
|
|
16
|
+
'x-decorator': 'WorkflowTodo.Decorator',
|
|
17
|
+
'x-decorator-props': {},
|
|
18
|
+
'x-component': 'CardItem',
|
|
19
|
+
'x-designer': 'TableBlockDesigner',
|
|
20
|
+
properties: {
|
|
21
|
+
todos: {
|
|
22
|
+
type: 'void',
|
|
23
|
+
'x-component': 'WorkflowTodo',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Plugin } from '@nocobase/client';
|
|
2
|
+
import WorkflowPlugin from '@nocobase/plugin-workflow/client';
|
|
3
|
+
|
|
4
|
+
import Manual from './instruction';
|
|
5
|
+
|
|
6
|
+
import { WorkflowTodo } from './WorkflowTodo';
|
|
7
|
+
import { WorkflowTodoBlockInitializer } from './WorkflowTodoBlockInitializer';
|
|
8
|
+
import { NAMESPACE } from '../locale';
|
|
9
|
+
import { addActionButton, addBlockButton } from './instruction/SchemaConfig';
|
|
10
|
+
import { addCustomFormField } from './instruction/forms/custom';
|
|
11
|
+
|
|
12
|
+
export default class extends Plugin {
|
|
13
|
+
async afterAdd() {
|
|
14
|
+
// await this.app.pm.add()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// You can get and modify the app instance here
|
|
18
|
+
async load() {
|
|
19
|
+
this.addComponents();
|
|
20
|
+
|
|
21
|
+
// this.app.addProvider(Provider);
|
|
22
|
+
const workflow = this.app.pm.get('workflow') as WorkflowPlugin;
|
|
23
|
+
const manualInstruction = new Manual();
|
|
24
|
+
workflow.instructions.register(manualInstruction.type, manualInstruction);
|
|
25
|
+
|
|
26
|
+
this.app.schemaInitializerManager.add(addBlockButton);
|
|
27
|
+
this.app.schemaInitializerManager.add(addActionButton);
|
|
28
|
+
this.app.schemaInitializerManager.add(addCustomFormField);
|
|
29
|
+
|
|
30
|
+
const blockInitializers = this.app.schemaInitializerManager.get('BlockInitializers');
|
|
31
|
+
blockInitializers.add('otherBlocks.workflowTodos', {
|
|
32
|
+
title: `{{t("Workflow todos", { ns: "${NAMESPACE}" })}}`,
|
|
33
|
+
Component: 'WorkflowTodoBlockInitializer',
|
|
34
|
+
icon: 'CheckSquareOutlined',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
addComponents() {
|
|
39
|
+
this.app.addComponents({
|
|
40
|
+
WorkflowTodo,
|
|
41
|
+
WorkflowTodoBlockInitializer,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RemoteSelect, Variable } from '@nocobase/client';
|
|
3
|
+
import { useWorkflowVariableOptions } from '@nocobase/plugin-workflow/client';
|
|
4
|
+
|
|
5
|
+
function isUserKeyField(field) {
|
|
6
|
+
if (field.isForeignKey) {
|
|
7
|
+
return field.target === 'users';
|
|
8
|
+
}
|
|
9
|
+
return field.collectionName === 'users' && field.name === 'id';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function AssigneesSelect({ multiple = false, value = [], onChange }) {
|
|
13
|
+
const scope = useWorkflowVariableOptions({ types: [isUserKeyField] });
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Variable.Input
|
|
17
|
+
scope={scope}
|
|
18
|
+
value={value[0]}
|
|
19
|
+
onChange={(next) => {
|
|
20
|
+
onChange([next]);
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<RemoteSelect
|
|
24
|
+
fieldNames={{
|
|
25
|
+
label: 'nickname',
|
|
26
|
+
value: 'id',
|
|
27
|
+
}}
|
|
28
|
+
service={{
|
|
29
|
+
resource: 'users',
|
|
30
|
+
}}
|
|
31
|
+
manual={false}
|
|
32
|
+
value={value[0]}
|
|
33
|
+
onChange={(v) => {
|
|
34
|
+
onChange(v != null ? [v] : []);
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
</Variable.Input>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useRef, useMemo, useContext } from 'react';
|
|
2
|
+
import { createForm } from '@formily/core';
|
|
3
|
+
import { useField } from '@formily/react';
|
|
4
|
+
import {
|
|
5
|
+
BlockRequestContext,
|
|
6
|
+
CollectionProvider,
|
|
7
|
+
FormBlockContext,
|
|
8
|
+
RecordProvider,
|
|
9
|
+
useAPIClient,
|
|
10
|
+
useAssociationNames,
|
|
11
|
+
} from '@nocobase/client';
|
|
12
|
+
import { parse } from '@nocobase/utils/client';
|
|
13
|
+
import { useFlowContext } from '@nocobase/plugin-workflow/client';
|
|
14
|
+
|
|
15
|
+
function useFlowContextData(dataSource) {
|
|
16
|
+
const { execution, nodes } = useFlowContext();
|
|
17
|
+
|
|
18
|
+
const nodesKeyMap = useMemo(() => {
|
|
19
|
+
return nodes.reduce((map, node) => Object.assign(map, { [node.id]: node.key }), {});
|
|
20
|
+
}, [nodes]);
|
|
21
|
+
|
|
22
|
+
const data = useMemo(
|
|
23
|
+
() => ({
|
|
24
|
+
$context: execution?.context,
|
|
25
|
+
$jobsMapByNodeKey: (execution?.jobs ?? []).reduce(
|
|
26
|
+
(map, job) => Object.assign(map, { [nodesKeyMap[job.nodeId]]: job.result }),
|
|
27
|
+
{},
|
|
28
|
+
),
|
|
29
|
+
}),
|
|
30
|
+
[execution?.context, execution?.jobs, nodesKeyMap],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const result = useMemo(() => parse(dataSource)(data), [data, dataSource]);
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function DetailsBlockProvider(props) {
|
|
38
|
+
const field = useField();
|
|
39
|
+
const formBlockRef = useRef(null);
|
|
40
|
+
const { appends, updateAssociationValues } = useAssociationNames();
|
|
41
|
+
const values = useFlowContextData(props.dataSource);
|
|
42
|
+
|
|
43
|
+
const form = useMemo(
|
|
44
|
+
() =>
|
|
45
|
+
createForm({
|
|
46
|
+
values,
|
|
47
|
+
readPretty: true,
|
|
48
|
+
}),
|
|
49
|
+
[values],
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const params = {
|
|
53
|
+
appends,
|
|
54
|
+
};
|
|
55
|
+
const service = {
|
|
56
|
+
loading: false,
|
|
57
|
+
data: {
|
|
58
|
+
data: values,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
const api = useAPIClient();
|
|
62
|
+
const resource = api.resource(props.collection);
|
|
63
|
+
const __parent = useContext(BlockRequestContext);
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<CollectionProvider collection={props.collection}>
|
|
67
|
+
<RecordProvider record={values} parent={false}>
|
|
68
|
+
<BlockRequestContext.Provider value={{ block: 'form', field, service, resource, __parent }}>
|
|
69
|
+
<FormBlockContext.Provider
|
|
70
|
+
value={{
|
|
71
|
+
params,
|
|
72
|
+
form,
|
|
73
|
+
field,
|
|
74
|
+
service,
|
|
75
|
+
updateAssociationValues,
|
|
76
|
+
formBlockRef,
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{props.children}
|
|
80
|
+
</FormBlockContext.Provider>
|
|
81
|
+
</BlockRequestContext.Provider>
|
|
82
|
+
</RecordProvider>
|
|
83
|
+
</CollectionProvider>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CollectionProvider,
|
|
5
|
+
SchemaInitializerItem,
|
|
6
|
+
SchemaInitializerItemType,
|
|
7
|
+
createFormBlockSchema,
|
|
8
|
+
useRecordCollectionDataSourceItems,
|
|
9
|
+
useSchemaInitializer,
|
|
10
|
+
useSchemaInitializerItem,
|
|
11
|
+
useSchemaTemplateManager,
|
|
12
|
+
} from '@nocobase/client';
|
|
13
|
+
|
|
14
|
+
import { JOB_STATUS, traverseSchema } from '@nocobase/plugin-workflow/client';
|
|
15
|
+
|
|
16
|
+
import { NAMESPACE } from '../../locale';
|
|
17
|
+
|
|
18
|
+
function InternalFormBlockInitializer({ schema, ...others }) {
|
|
19
|
+
const { getTemplateSchemaByMode } = useSchemaTemplateManager();
|
|
20
|
+
const { insert } = useSchemaInitializer();
|
|
21
|
+
const items = useRecordCollectionDataSourceItems('FormItem') as SchemaInitializerItemType[];
|
|
22
|
+
async function onConfirm({ item }) {
|
|
23
|
+
const template = item.template ? await getTemplateSchemaByMode(item) : null;
|
|
24
|
+
const result = createFormBlockSchema({
|
|
25
|
+
actionInitializers: 'AddActionButton',
|
|
26
|
+
actions: {
|
|
27
|
+
resolve: {
|
|
28
|
+
type: 'void',
|
|
29
|
+
title: `{{t("Continue the process", { ns: "${NAMESPACE}" })}}`,
|
|
30
|
+
'x-decorator': 'ManualActionStatusProvider',
|
|
31
|
+
'x-decorator-props': {
|
|
32
|
+
value: JOB_STATUS.RESOLVED,
|
|
33
|
+
},
|
|
34
|
+
'x-component': 'Action',
|
|
35
|
+
'x-component-props': {
|
|
36
|
+
type: 'primary',
|
|
37
|
+
useAction: '{{ useSubmit }}',
|
|
38
|
+
},
|
|
39
|
+
'x-designer': 'ManualActionDesigner',
|
|
40
|
+
'x-designer-props': {},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
...schema,
|
|
44
|
+
template,
|
|
45
|
+
});
|
|
46
|
+
delete result['x-acl-action-props'];
|
|
47
|
+
delete result['x-acl-action'];
|
|
48
|
+
const [formKey] = Object.keys(result.properties);
|
|
49
|
+
result.properties[formKey].properties.actions['x-decorator'] = 'ActionBarProvider';
|
|
50
|
+
result.properties[formKey].properties.actions['x-component-props'].style = {
|
|
51
|
+
marginTop: '1.5em',
|
|
52
|
+
flexWrap: 'wrap',
|
|
53
|
+
};
|
|
54
|
+
traverseSchema(result, (node) => {
|
|
55
|
+
if (node['x-uid']) {
|
|
56
|
+
delete node['x-uid'];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
insert(result);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return <SchemaInitializerItem {...others} onClick={onConfirm} items={items} />;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function FormBlockInitializer() {
|
|
66
|
+
const itemConfig = useSchemaInitializerItem();
|
|
67
|
+
return (
|
|
68
|
+
<CollectionProvider collection={itemConfig.schema?.collection}>
|
|
69
|
+
<InternalFormBlockInitializer {...itemConfig} />
|
|
70
|
+
</CollectionProvider>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createForm } from '@formily/core';
|
|
2
|
+
import { RecursionField, useField, useFieldSchema } from '@formily/react';
|
|
3
|
+
import {
|
|
4
|
+
BlockRequestContext,
|
|
5
|
+
CollectionProvider,
|
|
6
|
+
FormActiveFieldsProvider,
|
|
7
|
+
FormBlockContext,
|
|
8
|
+
FormV2,
|
|
9
|
+
RecordProvider,
|
|
10
|
+
useAPIClient,
|
|
11
|
+
useAssociationNames,
|
|
12
|
+
useDesignable,
|
|
13
|
+
useRecord,
|
|
14
|
+
} from '@nocobase/client';
|
|
15
|
+
import React, { useContext, useMemo, useRef } from 'react';
|
|
16
|
+
|
|
17
|
+
export function FormBlockProvider(props) {
|
|
18
|
+
const userJob = useRecord();
|
|
19
|
+
const fieldSchema = useFieldSchema();
|
|
20
|
+
const field = useField();
|
|
21
|
+
const formBlockRef = useRef(null);
|
|
22
|
+
const { appends, updateAssociationValues } = useAssociationNames();
|
|
23
|
+
const [formKey] = Object.keys(fieldSchema.toJSON().properties ?? {});
|
|
24
|
+
const values = userJob?.result?.[formKey];
|
|
25
|
+
|
|
26
|
+
const { findComponent } = useDesignable();
|
|
27
|
+
const Component = findComponent(field.component?.[0]) || React.Fragment;
|
|
28
|
+
|
|
29
|
+
const form = useMemo(
|
|
30
|
+
() =>
|
|
31
|
+
createForm({
|
|
32
|
+
initialValues: values,
|
|
33
|
+
}),
|
|
34
|
+
[values],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const params = useMemo(() => {
|
|
38
|
+
return {
|
|
39
|
+
appends,
|
|
40
|
+
...props.params,
|
|
41
|
+
};
|
|
42
|
+
}, [appends, props.params]);
|
|
43
|
+
const service = useMemo(() => {
|
|
44
|
+
return {
|
|
45
|
+
loading: false,
|
|
46
|
+
data: {
|
|
47
|
+
data: values,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}, [values]);
|
|
51
|
+
const api = useAPIClient();
|
|
52
|
+
const resource = api.resource(props.collection);
|
|
53
|
+
const __parent = useContext(BlockRequestContext);
|
|
54
|
+
|
|
55
|
+
const formBlockValue = useMemo(() => {
|
|
56
|
+
return {
|
|
57
|
+
params,
|
|
58
|
+
form,
|
|
59
|
+
field,
|
|
60
|
+
service,
|
|
61
|
+
updateAssociationValues,
|
|
62
|
+
formBlockRef,
|
|
63
|
+
};
|
|
64
|
+
}, [field, form, params, service, updateAssociationValues]);
|
|
65
|
+
|
|
66
|
+
return !userJob.status || values ? (
|
|
67
|
+
<CollectionProvider collection={props.collection}>
|
|
68
|
+
<RecordProvider record={values} parent={false}>
|
|
69
|
+
<FormActiveFieldsProvider name="form">
|
|
70
|
+
<BlockRequestContext.Provider value={{ block: 'form', props, field, service, resource, __parent }}>
|
|
71
|
+
<FormBlockContext.Provider value={formBlockValue}>
|
|
72
|
+
<Component {...field.componentProps}>
|
|
73
|
+
<FormV2.Templates style={{ marginBottom: 18 }} form={form} />
|
|
74
|
+
<div ref={formBlockRef}>
|
|
75
|
+
<RecursionField schema={fieldSchema} onlyRenderProperties />
|
|
76
|
+
</div>
|
|
77
|
+
</Component>
|
|
78
|
+
</FormBlockContext.Provider>
|
|
79
|
+
</BlockRequestContext.Provider>
|
|
80
|
+
</FormActiveFieldsProvider>
|
|
81
|
+
</RecordProvider>
|
|
82
|
+
</CollectionProvider>
|
|
83
|
+
) : null;
|
|
84
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
2
|
+
import { FormLayout } from '@formily/antd-v5';
|
|
3
|
+
import { Form, Radio, Tooltip } from 'antd';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { css, FormItem } from '@nocobase/client';
|
|
7
|
+
import { useLang } from '../../locale';
|
|
8
|
+
|
|
9
|
+
function parseMode(v) {
|
|
10
|
+
if (!v) {
|
|
11
|
+
return 'single';
|
|
12
|
+
}
|
|
13
|
+
if (v >= 1) {
|
|
14
|
+
return 'all';
|
|
15
|
+
}
|
|
16
|
+
if (v <= -1) {
|
|
17
|
+
return 'any';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const dir = Math.sign(v);
|
|
21
|
+
if (dir > 0) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function ModeConfig({ value, onChange }) {
|
|
27
|
+
const mode = parseMode(value);
|
|
28
|
+
const negotiationFieldset = (
|
|
29
|
+
<fieldset>
|
|
30
|
+
<FormLayout layout="vertical">
|
|
31
|
+
<FormItem label={useLang('Negotiation')}>
|
|
32
|
+
<Radio.Group value={value} onChange={onChange}>
|
|
33
|
+
<Radio value={1}>
|
|
34
|
+
<Tooltip title={useLang('Everyone should pass')} placement="bottom">
|
|
35
|
+
<span>{useLang('All pass')}</span>
|
|
36
|
+
<QuestionCircleOutlined style={{ color: '#999' }} />
|
|
37
|
+
</Tooltip>
|
|
38
|
+
</Radio>
|
|
39
|
+
<Radio value={-1}>
|
|
40
|
+
<Tooltip title={useLang('Anyone pass')} placement="bottom">
|
|
41
|
+
<span>{useLang('Any pass')}</span>
|
|
42
|
+
<QuestionCircleOutlined style={{ color: '#999' }} />
|
|
43
|
+
</Tooltip>
|
|
44
|
+
</Radio>
|
|
45
|
+
</Radio.Group>
|
|
46
|
+
</FormItem>
|
|
47
|
+
</FormLayout>
|
|
48
|
+
</fieldset>
|
|
49
|
+
);
|
|
50
|
+
return (
|
|
51
|
+
<fieldset
|
|
52
|
+
className={css`
|
|
53
|
+
.ant-radio-group {
|
|
54
|
+
.anticon {
|
|
55
|
+
margin-left: 0.5em;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`}
|
|
59
|
+
>
|
|
60
|
+
<Form.Item>
|
|
61
|
+
<Radio.Group
|
|
62
|
+
value={Boolean(value)}
|
|
63
|
+
onChange={({ target: { value: v } }) => {
|
|
64
|
+
console.log(v);
|
|
65
|
+
onChange(Number(v));
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<Radio value={true}>
|
|
69
|
+
<Tooltip title={useLang('Each user has own task')} placement="bottom">
|
|
70
|
+
<span>{useLang('Separately')}</span>
|
|
71
|
+
<QuestionCircleOutlined style={{ color: '#999' }} />
|
|
72
|
+
</Tooltip>
|
|
73
|
+
</Radio>
|
|
74
|
+
<Radio value={false}>
|
|
75
|
+
<Tooltip title={useLang('Everyone shares one task')} placement="bottom">
|
|
76
|
+
<span>{useLang('Collaboratively')}</span>
|
|
77
|
+
<QuestionCircleOutlined style={{ color: '#999' }} />
|
|
78
|
+
</Tooltip>
|
|
79
|
+
</Radio>
|
|
80
|
+
</Radio.Group>
|
|
81
|
+
</Form.Item>
|
|
82
|
+
{value ? negotiationFieldset : null}
|
|
83
|
+
</fieldset>
|
|
84
|
+
);
|
|
85
|
+
}
|