@@ -22,12 +22,12 @@ import history from "util/history";
2222import { APPLICATION_VIEW_URL } from "constants/routesURL" ;
2323import { TypographyText } from "../../components/TypographyText" ;
2424import { useParams } from "react-router-dom" ;
25- import { messageInstance } from "lowcoder-design/src/components/GlobalInstances" ;
2625import { FolderIcon } from "icons" ;
2726import { BrandedIcon } from "@lowcoder-ee/components/BrandedIcon" ;
2827import { Typography } from "antd" ;
2928import { default as Form } from "antd/es/form" ;
3029import { default as Input } from "antd/es/input" ;
30+ import { default as AntdTypographyText } from "antd/es/typography/Text" ;
3131import { MultiIconDisplay } from "@lowcoder-ee/comps/comps/multiIconDisplay" ;
3232import { FormStyled } from "../setting/idSource/styledComponents" ;
3333
@@ -107,12 +107,6 @@ const CardInfo = styled.div`
107107 cursor: pointer;
108108 padding-right: 12px;
109109
110- &:hover {
111- .ant-typography {
112- color: #315efb;
113- }
114- }
115-
116110 .ant-typography {
117111 padding: 2px 2px 8px 2px;
118112 }
@@ -138,6 +132,20 @@ const OperationWrapper = styled.div`
138132 }
139133` ;
140134
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+
141149const MONTH_MILLIS = 30 * 24 * 60 * 60 * 1000 ;
142150
143151interface UpdateAppModalProps {
@@ -207,7 +215,6 @@ export function UpdateAppModal({ visible, onCancel, onOk, res, folderId }: Updat
207215
208216export function HomeResCard ( props : { res : HomeRes ; onMove : ( res : HomeRes ) => void ; setModify :any ; modify : boolean } ) {
209217 const { res, onMove, setModify, modify } = props ;
210- const [ appNameEditing , setAppNameEditing ] = useState ( false ) ;
211218 const [ dialogVisible , setDialogVisible ] = useState ( false )
212219 const dispatch = useDispatch ( ) ;
213220
@@ -237,6 +244,8 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
237244 const Icon = resInfo . icon ;
238245
239246 const handleModalOk = ( values : any ) => {
247+ res . type === HomeResTypeEnum . Folder &&
248+ dispatch ( updateFolder ( { id : res . id , name : values . appName || res . name } ) )
240249 dispatch (
241250 updateAppMetaAction ( { applicationId : res . id , name : values . appName || res . name , folderId : folderId } )
242251 ) ;
@@ -284,9 +293,6 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
284293 }
285294 < CardInfo
286295 onClick = { ( e ) => {
287- if ( appNameEditing ) {
288- return ;
289- }
290296 if ( res . type === HomeResTypeEnum . Folder ) {
291297 handleFolderViewClick ( res . id ) ;
292298 } else {
@@ -302,30 +308,9 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
302308 }
303309 } }
304310 >
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 >
329314
330315 { res ?. description
331316 && < Typography . Text
0 commit comments