Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8daa8d

Browse files
committed
Added removing folder.
1 parent63534ca commitc8daa8d

File tree

2 files changed

+52
-30
lines changed

2 files changed

+52
-30
lines changed

‎client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2785,6 +2785,7 @@ export const en = {
27852785
"switch":"Switch Component: "
27862786
},
27872787
"module":{
2788+
"folderNotEmpty":"Folder is not empty",
27882789
"emptyText":"No Data",
27892790
"docLink":"Read More About Modules...",
27902791
"documentationText" :"Modules are complete Applications, that can get included and repeated in other Applications and it functions just like a single component. As modules can get embedded, they need to be able to interact with your outside apps or websites. This four settings help to support communication with a Module.",

‎client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {showAppSnapshotSelector} from "@lowcoder-ee/redux/selectors/appSnapshotS
3131
import{DraggableTreeNode,DraggableTreeNodeItemRenderProps}from"@lowcoder-ee/components/DraggableTree/types";
3232
importRefTreeCompfrom"@lowcoder-ee/comps/comps/refTreeComp";
3333
import{EmptyContent}from"components/EmptyContent";
34-
import{moveToFolder}from"@lowcoder-ee/redux/reduxActions/folderActions";
34+
import{deleteFolder,moveToFolder}from"@lowcoder-ee/redux/reduxActions/folderActions";
3535
import{HomeResInfo}from"@lowcoder-ee/util/homeResUtils";
3636
constItemWrapper=styled.div`
3737
display: flex;
@@ -585,42 +585,65 @@ export default function ModulePanel() {
585585
// return <ModuleItem onDrag={onDrag} key={id} meta={meta} />
586586
}
587587

588-
functiononDelete(type:boolean,id:string){
588+
functiononDelete(type:boolean,id:string,node:NodeType){
589589
setDeleteFlag(true);
590590
console.log("1111111111111111111111111",type,id,node);
591591
if(type){
592-
alert(1);
593-
}
594-
else{
595-
CustomModal.confirm({
596-
title:trans("home.moveToTrash"),
597-
content:transToNode("home.moveToTrashSubTitle",{
598-
type:"",
599-
name:"This file",
600-
}),
601-
onConfirm:()=>{
592+
if(node.children.length){
593+
messageInstance.error(trans("module.folderNotEmpty"))
594+
}else{
595+
try{
602596
dispatch(
603-
recycleApplication(
604-
{
605-
applicationId:id,
606-
folderId:popedItemSourceId,
607-
},
597+
deleteFolder(
598+
{folderId:id,parentFolderId:""},
608599
()=>{
609-
messageInstance.success(trans("success"))
610-
600+
messageInstance.success(trans("home.deleteSuccessMsg"));
611601
},
612602
()=>{
603+
messageInstance.error(trans("error"))
613604
}
614605
)
615-
)
616-
setDeleteFlag(false)
617-
},
618-
confirmBtnType:"delete",
619-
okText:trans("home.moveToTrash"),
620-
onCancel:()=>setDeleteFlag(false)
621-
});
606+
);
607+
}catch(error){
608+
console.error("Error: Delete module in extension:",error);
609+
throwerror;
610+
}
611+
}
612+
}else{
613+
try{
614+
CustomModal.confirm({
615+
title:trans("home.moveToTrash"),
616+
content:transToNode("home.moveToTrashSubTitle",{
617+
type:"",
618+
name:"This file",
619+
}),
620+
onConfirm:()=>{
621+
dispatch(
622+
recycleApplication(
623+
{
624+
applicationId:id,
625+
folderId:popedItemSourceId,
626+
},
627+
()=>{
628+
messageInstance.success(trans("success"));
629+
630+
},
631+
()=>{
632+
messageInstance.error(trans("error"));
633+
}
634+
)
635+
)
636+
setDeleteFlag(false)
637+
},
638+
confirmBtnType:"delete",
639+
okText:trans("home.moveToTrash"),
640+
onCancel:()=>setDeleteFlag(false)
641+
});
642+
}catch(error){
643+
console.error("Error: Delete module in extension:",error);
644+
throwerror;
645+
}
622646
}
623-
returntrue;
624647
}
625648

626649
return(
@@ -661,9 +684,7 @@ export default function ModulePanel() {
661684
onCopy={()=>onCopy(isFolder,id)}
662685
onSelect={()=>onSelect(isFolder,id,resComp)}
663686
onDelete={()=>{
664-
if(onDelete(isFolder,id)){
665-
onDeleteTreeItem();
666-
}
687+
(onDelete(isFolder,id,resComp))
667688
}}
668689
{...otherParams}
669690
/>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp