balibabu commited on
Commit
eb0c846
·
1 Parent(s): ef2a724

fix: When the component id is very long, the delete button of generate will be hidden #1906 (#1907)

Browse files

### What problem does this PR solve?
fix: When the component id is very long, the delete button of generate
will be hidden #1906

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

web/src/assets/svg/llm/moonshot.svg CHANGED
web/src/components/editable-cell.tsx CHANGED
@@ -1,7 +1,8 @@
1
- import { Form, FormInstance, Input, InputRef } from 'antd';
2
  import React, { useContext, useEffect, useRef, useState } from 'react';
3
 
4
  const EditableContext = React.createContext<FormInstance<any> | null>(null);
 
5
 
6
  interface EditableRowProps {
7
  index: number;
@@ -77,7 +78,7 @@ export const EditableCell: React.FC<EditableCellProps> = ({
77
  if (editable) {
78
  childNode = editing ? (
79
  <Form.Item
80
- style={{ margin: 0 }}
81
  name={dataIndex}
82
  rules={[
83
  {
@@ -91,10 +92,12 @@ export const EditableCell: React.FC<EditableCellProps> = ({
91
  ) : (
92
  <div
93
  className="editable-cell-value-wrap"
94
- style={{ paddingRight: 24 }}
95
  onClick={toggleEdit}
96
  >
97
- {children}
 
 
98
  </div>
99
  );
100
  }
 
1
+ import { Form, FormInstance, Input, InputRef, Typography } from 'antd';
2
  import React, { useContext, useEffect, useRef, useState } from 'react';
3
 
4
  const EditableContext = React.createContext<FormInstance<any> | null>(null);
5
+ const { Paragraph, Text } = Typography;
6
 
7
  interface EditableRowProps {
8
  index: number;
 
78
  if (editable) {
79
  childNode = editing ? (
80
  <Form.Item
81
+ style={{ margin: 0, width: 100 }}
82
  name={dataIndex}
83
  rules={[
84
  {
 
92
  ) : (
93
  <div
94
  className="editable-cell-value-wrap"
95
+ // style={{ paddingRight: 24 }}
96
  onClick={toggleEdit}
97
  >
98
+ <Text ellipsis={{ tooltip: children }} style={{ width: 100 }}>
99
+ {children}
100
+ </Text>
101
  </div>
102
  );
103
  }
web/src/locales/en.ts CHANGED
@@ -783,7 +783,7 @@ The above is the content you need to summarize.`,
783
  '15d': '12 days',
784
  '30d': '30 days',
785
  },
786
- publish: 'Publish',
787
  },
788
  footer: {
789
  profile: 'All rights reserved @ React',
 
783
  '15d': '12 days',
784
  '30d': '30 days',
785
  },
786
+ publish: 'API',
787
  },
788
  footer: {
789
  profile: 'All rights reserved @ React',
web/src/locales/zh-traditional.ts CHANGED
@@ -741,7 +741,7 @@ export default {
741
  '15d': '12天',
742
  '30d': '30天',
743
  },
744
- publish: '發布',
745
  },
746
  footer: {
747
  profile: '“保留所有權利 @ react”',
 
741
  '15d': '12天',
742
  '30d': '30天',
743
  },
744
+ publish: 'API',
745
  },
746
  footer: {
747
  profile: '“保留所有權利 @ react”',
web/src/locales/zh.ts CHANGED
@@ -759,7 +759,7 @@ export default {
759
  '15d': '12天',
760
  '30d': '30天',
761
  },
762
- publish: '发布',
763
  },
764
  footer: {
765
  profile: 'All rights reserved @ React',
 
759
  '15d': '12天',
760
  '30d': '30天',
761
  },
762
+ publish: 'API',
763
  },
764
  footer: {
765
  profile: 'All rights reserved @ React',
web/src/pages/flow/generate-form/dynamic-parameters.tsx CHANGED
@@ -38,6 +38,7 @@ const DynamicParameters = ({ nodeId }: IProps) => {
38
  title: t('key'),
39
  dataIndex: 'key',
40
  key: 'key',
 
41
  onCell: (record: IGenerateParameter) => ({
42
  record,
43
  editable: true,
@@ -69,6 +70,7 @@ const DynamicParameters = ({ nodeId }: IProps) => {
69
  width: 20,
70
  key: 'operation',
71
  align: 'center',
 
72
  render(_, record) {
73
  return <DeleteOutlined onClick={handleRemove(record.id)} />;
74
  },
@@ -89,6 +91,7 @@ const DynamicParameters = ({ nodeId }: IProps) => {
89
  className={styles.variableTable}
90
  components={components}
91
  rowClassName={() => styles.editableRow}
 
92
  />
93
  </section>
94
  );
 
38
  title: t('key'),
39
  dataIndex: 'key',
40
  key: 'key',
41
+ width: 50,
42
  onCell: (record: IGenerateParameter) => ({
43
  record,
44
  editable: true,
 
70
  width: 20,
71
  key: 'operation',
72
  align: 'center',
73
+ fixed: 'right',
74
  render(_, record) {
75
  return <DeleteOutlined onClick={handleRemove(record.id)} />;
76
  },
 
91
  className={styles.variableTable}
92
  components={components}
93
  rowClassName={() => styles.editableRow}
94
+ scroll={{ x: true }}
95
  />
96
  </section>
97
  );