improve: upgrade node to 20, upgrade react-query to v4

This commit is contained in:
h z
2025-04-27 00:36:42 +01:00
parent 9ea44385ee
commit 1ce2eebbfa
22 changed files with 309 additions and 218 deletions

View File

@@ -1,4 +1,6 @@
import React, {useState} from "react";
import { useSelector, useDispatch } from 'react-redux';
import { toggleNodeExpansion } from '../../store/navigationSlice';
import { Link } from "react-router-dom";
import PermissionGuard from "../PermissionGuard";
import "./PathNode.css";
@@ -9,10 +11,13 @@ import PathSettingModal from "../Modals/PathSettingModal";
const PathNode = ({ path, isRoot = false }) => {
const [isPathSettingModalOpen, setIsPathSettingModalOpen] = useState(false);
const [isExpanded, setIsExpanded] = useState(isRoot);
const [isEditing, setIsEditing] = useState(false);
const [newName, setNewName] = useState(path.name || "");
const expandedNodes = useSelector(state => state.navigation.expandedNodes);
const dispatch = useDispatch();
const isExpanded = isRoot || expandedNodes[path.id];
const deletePath = useDeletePath();
const updatePath = useUpdatePath();
@@ -23,11 +28,13 @@ const PathNode = ({ path, isRoot = false }) => {
const expand = () => {
if(!isExpanded)
setIsExpanded(true);
if (!isExpanded) {
dispatch(toggleNodeExpansion(path.id));
}
};
const toggleExpand = () => {
setIsExpanded(!isExpanded);
dispatch(toggleNodeExpansion(path.id));
};
const handleSave = () => {