@@ -22,12 +22,12 @@ import history from "util/history";
22
22
import { APPLICATION_VIEW_URL } from "constants/routesURL" ;
23
23
import { TypographyText } from "../../components/TypographyText" ;
24
24
import { useParams } from "react-router-dom" ;
25
- import { messageInstance } from "lowcoder-design/src/components/GlobalInstances" ;
26
25
import { FolderIcon } from "icons" ;
27
26
import { BrandedIcon } from "@lowcoder-ee/components/BrandedIcon" ;
28
27
import { Typography } from "antd" ;
29
28
import { default as Form } from "antd/es/form" ;
30
29
import { default as Input } from "antd/es/input" ;
30
+ import { default as AntdTypographyText } from "antd/es/typography/Text" ;
31
31
import { MultiIconDisplay } from "@lowcoder-ee/comps/comps/multiIconDisplay" ;
32
32
import { FormStyled } from "../setting/idSource/styledComponents" ;
33
33
@@ -107,12 +107,6 @@ const CardInfo = styled.div`
107
107
cursor: pointer;
108
108
padding-right: 12px;
109
109
110
- &:hover {
111
- .ant-typography {
112
- color: #315efb;
113
- }
114
- }
115
-
116
110
.ant-typography {
117
111
padding: 2px 2px 8px 2px;
118
112
}
@@ -138,6 +132,20 @@ const OperationWrapper = styled.div`
138
132
}
139
133
` ;
140
134
135
+ export const StyledTypographyText = styled ( AntdTypographyText ) `
136
+ font-size: 14px;
137
+ color: #333333;
138
+ line-height: 14px;
139
+ overflow: hidden;
140
+ text-overflow: ellipsis;
141
+ display: block;
142
+
143
+ &:hover {
144
+ color: #315efb;
145
+ }
146
+ }
147
+ ` ;
148
+
141
149
const MONTH_MILLIS = 30 * 24 * 60 * 60 * 1000 ;
142
150
143
151
interface UpdateAppModalProps {
@@ -207,7 +215,6 @@ export function UpdateAppModal({ visible, onCancel, onOk, res, folderId }: Updat
207
215
208
216
export function HomeResCard ( props : { res : HomeRes ; onMove : ( res : HomeRes ) => void ; setModify :any ; modify : boolean } ) {
209
217
const { res, onMove, setModify, modify } = props ;
210
- const [ appNameEditing , setAppNameEditing ] = useState ( false ) ;
211
218
const [ dialogVisible , setDialogVisible ] = useState ( false )
212
219
const dispatch = useDispatch ( ) ;
213
220
@@ -237,6 +244,8 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
237
244
const Icon = resInfo . icon ;
238
245
239
246
const handleModalOk = ( values : any ) => {
247
+ res . type === HomeResTypeEnum . Folder &&
248
+ dispatch ( updateFolder ( { id : res . id , name : values . appName || res . name } ) )
240
249
dispatch (
241
250
updateAppMetaAction ( { applicationId : res . id , name : values . appName || res . name , folderId : folderId } )
242
251
) ;
@@ -284,9 +293,6 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
284
293
}
285
294
< CardInfo
286
295
onClick = { ( e ) => {
287
- if ( appNameEditing ) {
288
- return ;
289
- }
290
296
if ( res . type === HomeResTypeEnum . Folder ) {
291
297
handleFolderViewClick ( res . id ) ;
292
298
} else {
@@ -302,30 +308,9 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
302
308
}
303
309
} }
304
310
>
305
- < TypographyText
306
- value = { res . title || res . name }
307
- editing = { false }
308
- onChange = { ( value ) => {
309
- if ( ! value . trim ( ) ) {
310
- messageInstance . warning ( trans ( "home.nameCheckMessage" ) ) ;
311
- return ;
312
- }
313
- if ( res . type === HomeResTypeEnum . Folder ) {
314
- dispatch ( updateFolder ( { id : res . id , name : value } ) ) ;
315
- setTimeout ( ( ) => {
316
- setModify ( ! modify ) ;
317
- } , 200 ) ;
318
- } else {
319
- dispatch (
320
- updateAppMetaAction ( { applicationId : res . id , name : value , folderId : folderId } )
321
- ) ;
322
- setTimeout ( ( ) => {
323
- setModify ( ! modify ) ;
324
- } , 200 ) ;
325
- }
326
- setAppNameEditing ( false ) ;
327
- } }
328
- />
311
+ < StyledTypographyText >
312
+ { res . title || res . name }
313
+ </ StyledTypographyText >
329
314
330
315
{ res ?. description
331
316
&& < Typography . Text
0 commit comments