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

[Fix]: #1928 folder edit/create issues#1932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -143,7 +143,6 @@ export const StyledTypographyText = styled(AntdTypographyText)`
&:hover {
color: #315efb;
}
}
`;

const MONTH_MILLIS = 30 * 24 * 60 * 60 * 1000;
Expand DownExpand Up@@ -244,11 +243,15 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
const Icon = resInfo.icon;

const handleModalOk = (values: any) => {
res.type === HomeResTypeEnum.Folder &&
dispatch(updateFolder({ id: res.id, name: values.appName || res.name }))
dispatch(
updateAppMetaAction({ applicationId: res.id, name: values.appName || res.name, folderId: folderId })
);
if (res.type === HomeResTypeEnum.Folder) {
// Update folder
dispatch(updateFolder({ id: res.id, name: values.appName || res.name }));
} else {
// Update application
dispatch(
updateAppMetaAction({ applicationId: res.id, name: values.appName || res.name, folderId: folderId })
);
}

setDialogVisible(false);
setTimeout(() => {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,8 +12,7 @@ import { AppTypeEnum } from "constants/applicationConstants";
import { CopyModal } from "pages/common/copyModal";
import { messageInstance } from "lowcoder-design/src/components/GlobalInstances";
import ApplicationApi from "../../api/applicationApi";
import { FolderApi } from "../../api/folderApi";
import { ReduxActionTypes } from "constants/reduxActionConstants";
import { deleteFolder } from "../../redux/reduxActions/folderActions";

const PopoverIcon = styled(PointIcon)`
cursor: pointer;
Expand DownExpand Up@@ -120,27 +119,24 @@ export const HomeResOptions = (props: {
type: HomeResInfo[res.type].name.toLowerCase(),
name: <b>{res.name}</b>,
}),
onConfirm:async() => {
try {
await FolderApi.deleteFolder({
onConfirm: () => {
dispatch(deleteFolder(
{
folderId: res.id,
parentFolderId: folderId || ""
});

// Update Redux state to remove deleted folder from dropdown
dispatch({
type: ReduxActionTypes.DELETE_FOLDER_SUCCESS,
payload: { folderId: res.id, parentFolderId: folderId || "" }
});

messageInstance.success(trans("home.deleteSuccessMsg"));
setTimeout(() => {
setModify(!modify);
}, 200);
} catch (error) {
console.error("Failed to delete folder:", error);
messageInstance.error("Failed to delete folder");
}
},
() => {
// Success callback
messageInstance.success(trans("home.deleteSuccessMsg"));
setTimeout(() => {
setModify(!modify);
}, 200);
},
() => {
// Error callback
messageInstance.error("Failed to delete folder");
}
));
},
confirmBtnType: "delete",
okText: trans("delete"),
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { HomeRes } from "./HomeLayout";
import { default as Form } from "antd/es/form";
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useParams } from "react-router-dom";
import {
Expand All@@ -11,10 +11,10 @@ import {
FormSelectItem,
TacoButton,
} from "lowcoder-design";
import { moveToFolder } from "../../redux/reduxActions/folderActions";
import { moveToFolder, fetchFolderElements } from "../../redux/reduxActions/folderActions";
import styled from "styled-components";
import { trans } from "../../i18n";
import { foldersSelector } from "../../redux/selectors/folderSelector";
import { foldersSelector, isFetchingFolderElements } from "../../redux/selectors/folderSelector";

const MoveLabel = styled.div`
font-size: 13px;
Expand DownExpand Up@@ -47,11 +47,20 @@ export const MoveToFolderModal = (props: { source?: HomeRes; onClose: () => void
const [loading, setLoading] = useState<boolean>(false);

const folders = useSelector(foldersSelector);
const isFetching = useSelector(isFetchingFolderElements);

const dispatch = useDispatch();

const { folderId } = useParams<{ folderId: string }>();

// Fetch folders when modal opens to populate Redux state (only if not already loaded or fetching)
useEffect(() => {
if (props.source && folders.length === 0 && !isFetching) {
// Dispatch the Redux action to fetch folders (empty folderId fetches all folders)
dispatch(fetchFolderElements({}));
}
}, [props.source, dispatch, folders.length, isFetching]);

return (
<CustomModal
open={!!props.source}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp