balibabu
commited on
Commit
·
6d81859
1
Parent(s):
2e482fd
feat: Arrange the form of generate, categorize, switch, retrieval operators vertically #1739 (#2800)
Browse files### What problem does this PR solve?
feat: Arrange the form of generate, categorize, switch, retrieval
operators vertically #1739
### Type of change
- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
- web/src/pages/flow/flow-drawer/index.less +6 -0
- web/src/pages/flow/flow-drawer/index.tsx +9 -7
- web/src/pages/flow/form/categorize-form/index.tsx +1 -2
- web/src/pages/flow/form/generate-form/index.tsx +1 -2
- web/src/pages/flow/form/retrieval-form/index.tsx +1 -2
- web/src/pages/flow/form/switch-form/index.tsx +1 -16
web/src/pages/flow/flow-drawer/index.less
CHANGED
@@ -1,3 +1,9 @@
|
|
1 |
.title {
|
2 |
flex-basis: 60px;
|
3 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
.title {
|
2 |
flex-basis: 60px;
|
3 |
}
|
4 |
+
|
5 |
+
.formWrapper {
|
6 |
+
:global(.ant-form-item-label) {
|
7 |
+
font-weight: 600;
|
8 |
+
}
|
9 |
+
}
|
web/src/pages/flow/flow-drawer/index.tsx
CHANGED
@@ -118,13 +118,15 @@ const FlowDrawer = ({
|
|
118 |
mask={false}
|
119 |
width={470}
|
120 |
>
|
121 |
-
{
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
|
|
128 |
</Drawer>
|
129 |
);
|
130 |
};
|
|
|
118 |
mask={false}
|
119 |
width={470}
|
120 |
>
|
121 |
+
<section className={styles.formWrapper}>
|
122 |
+
{visible && (
|
123 |
+
<OperatorForm
|
124 |
+
onValuesChange={handleValuesChange}
|
125 |
+
form={form}
|
126 |
+
node={node}
|
127 |
+
></OperatorForm>
|
128 |
+
)}
|
129 |
+
</section>
|
130 |
</Drawer>
|
131 |
);
|
132 |
};
|
web/src/pages/flow/form/categorize-form/index.tsx
CHANGED
@@ -18,12 +18,11 @@ const CategorizeForm = ({ form, onValuesChange, node }: IOperatorForm) => {
|
|
18 |
return (
|
19 |
<Form
|
20 |
name="basic"
|
21 |
-
labelCol={{ span: 6 }}
|
22 |
-
wrapperCol={{ span: 18 }}
|
23 |
autoComplete="off"
|
24 |
form={form}
|
25 |
onValuesChange={handleValuesChange}
|
26 |
initialValues={{ items: [{}] }}
|
|
|
27 |
>
|
28 |
<Form.Item
|
29 |
name={'llm_id'}
|
|
|
18 |
return (
|
19 |
<Form
|
20 |
name="basic"
|
|
|
|
|
21 |
autoComplete="off"
|
22 |
form={form}
|
23 |
onValuesChange={handleValuesChange}
|
24 |
initialValues={{ items: [{}] }}
|
25 |
+
layout={'vertical'}
|
26 |
>
|
27 |
<Form.Item
|
28 |
name={'llm_id'}
|
web/src/pages/flow/form/generate-form/index.tsx
CHANGED
@@ -13,11 +13,10 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
|
13 |
return (
|
14 |
<Form
|
15 |
name="basic"
|
16 |
-
labelCol={{ span: 10 }}
|
17 |
-
wrapperCol={{ span: 14 }}
|
18 |
autoComplete="off"
|
19 |
form={form}
|
20 |
onValuesChange={onValuesChange}
|
|
|
21 |
>
|
22 |
<Form.Item
|
23 |
name={'llm_id'}
|
|
|
13 |
return (
|
14 |
<Form
|
15 |
name="basic"
|
|
|
|
|
16 |
autoComplete="off"
|
17 |
form={form}
|
18 |
onValuesChange={onValuesChange}
|
19 |
+
layout={'vertical'}
|
20 |
>
|
21 |
<Form.Item
|
22 |
name={'llm_id'}
|
web/src/pages/flow/form/retrieval-form/index.tsx
CHANGED
@@ -24,13 +24,12 @@ const RetrievalForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|
24 |
return (
|
25 |
<Form
|
26 |
name="basic"
|
27 |
-
labelCol={{ span: 12 }}
|
28 |
-
wrapperCol={{ span: 12 }}
|
29 |
onFinish={onFinish}
|
30 |
onFinishFailed={onFinishFailed}
|
31 |
autoComplete="off"
|
32 |
onValuesChange={onValuesChange}
|
33 |
form={form}
|
|
|
34 |
>
|
35 |
<SimilaritySlider
|
36 |
isTooltipShown
|
|
|
24 |
return (
|
25 |
<Form
|
26 |
name="basic"
|
|
|
|
|
27 |
onFinish={onFinish}
|
28 |
onFinishFailed={onFinishFailed}
|
29 |
autoComplete="off"
|
30 |
onValuesChange={onValuesChange}
|
31 |
form={form}
|
32 |
+
layout={'vertical'}
|
33 |
>
|
34 |
<SimilaritySlider
|
35 |
isTooltipShown
|
web/src/pages/flow/form/switch-form/index.tsx
CHANGED
@@ -13,14 +13,6 @@ import { useBuildComponentIdSelectOptions } from '../../hooks';
|
|
13 |
import { IOperatorForm, ISwitchForm } from '../../interface';
|
14 |
import { getOtherFieldValues } from '../../utils';
|
15 |
|
16 |
-
const subLabelCol = {
|
17 |
-
span: 11,
|
18 |
-
};
|
19 |
-
|
20 |
-
const subWrapperCol = {
|
21 |
-
span: 13,
|
22 |
-
};
|
23 |
-
|
24 |
const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
25 |
const { t } = useTranslation();
|
26 |
const buildCategorizeToOptions = useBuildFormSelectOptions(
|
@@ -53,13 +45,12 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|
53 |
|
54 |
return (
|
55 |
<Form
|
56 |
-
labelCol={{ span: 8 }}
|
57 |
-
wrapperCol={{ span: 16 }}
|
58 |
form={form}
|
59 |
name="dynamic_form_complex"
|
60 |
autoComplete="off"
|
61 |
initialValues={{ conditions: [{}] }}
|
62 |
onValuesChange={onValuesChange}
|
|
|
63 |
>
|
64 |
<Form.List name="conditions">
|
65 |
{(fields, { add, remove }) => (
|
@@ -125,8 +116,6 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|
125 |
<Form.Item
|
126 |
label={t('flow.componentId')}
|
127 |
name={[subField.name, 'cpn_id']}
|
128 |
-
labelCol={subLabelCol}
|
129 |
-
wrapperCol={subWrapperCol}
|
130 |
>
|
131 |
<Select
|
132 |
placeholder={t('flow.componentId')}
|
@@ -136,8 +125,6 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|
136 |
<Form.Item
|
137 |
label={t('flow.operator')}
|
138 |
name={[subField.name, 'operator']}
|
139 |
-
labelCol={subLabelCol}
|
140 |
-
wrapperCol={subWrapperCol}
|
141 |
>
|
142 |
<Select
|
143 |
placeholder={t('flow.operator')}
|
@@ -147,8 +134,6 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|
147 |
<Form.Item
|
148 |
label={t('flow.value')}
|
149 |
name={[subField.name, 'value']}
|
150 |
-
labelCol={subLabelCol}
|
151 |
-
wrapperCol={subWrapperCol}
|
152 |
>
|
153 |
<Input placeholder={t('flow.value')} />
|
154 |
</Form.Item>
|
|
|
13 |
import { IOperatorForm, ISwitchForm } from '../../interface';
|
14 |
import { getOtherFieldValues } from '../../utils';
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
17 |
const { t } = useTranslation();
|
18 |
const buildCategorizeToOptions = useBuildFormSelectOptions(
|
|
|
45 |
|
46 |
return (
|
47 |
<Form
|
|
|
|
|
48 |
form={form}
|
49 |
name="dynamic_form_complex"
|
50 |
autoComplete="off"
|
51 |
initialValues={{ conditions: [{}] }}
|
52 |
onValuesChange={onValuesChange}
|
53 |
+
layout={'vertical'}
|
54 |
>
|
55 |
<Form.List name="conditions">
|
56 |
{(fields, { add, remove }) => (
|
|
|
116 |
<Form.Item
|
117 |
label={t('flow.componentId')}
|
118 |
name={[subField.name, 'cpn_id']}
|
|
|
|
|
119 |
>
|
120 |
<Select
|
121 |
placeholder={t('flow.componentId')}
|
|
|
125 |
<Form.Item
|
126 |
label={t('flow.operator')}
|
127 |
name={[subField.name, 'operator']}
|
|
|
|
|
128 |
>
|
129 |
<Select
|
130 |
placeholder={t('flow.operator')}
|
|
|
134 |
<Form.Item
|
135 |
label={t('flow.value')}
|
136 |
name={[subField.name, 'value']}
|
|
|
|
|
137 |
>
|
138 |
<Input placeholder={t('flow.value')} />
|
139 |
</Form.Item>
|