Integrated Redux for state management with auth and settings slices. (#117)

* feat: Implement DatasetFileTransfer component for file selection and management

* feat: Add pagination support to file list in Overview component

* feat: add DatasetFileTransfer and TagManagement components

- Added DatasetFileTransfer component for managing dataset files.
- Introduced TagManagement component for handling tags.
- Integrated Redux for state management with auth and settings slices.
- Updated package.json to include @reduxjs/toolkit and react-redux dependencies.
- Refactored existing components to utilize new DatasetFileTransfer and TagManagement components.
- Implemented hooks for typed dispatch and selector in Redux.
- Enhanced CreateKnowledgeBase and SynthesisTask components to support new features.
This commit is contained in:
chenghh-9609
2025-11-29 17:37:36 +08:00
committed by GitHub
parent 2e13bb9b4c
commit 5c178d5274
16 changed files with 305 additions and 22 deletions

View File

@@ -10,6 +10,8 @@ import { menuItems } from "@/pages/Layout/menu";
import { NavLink, useLocation, useNavigate } from "react-router";
import TaskUpload from "./TaskUpload";
import SettingsPage from "../SettingsPage/SettingsPage";
import { useAppSelector, useAppDispatch } from "@/store/hooks";
import { showSettings, hideSettings } from "@/store/slices/settingsSlice";
const AsiderAndHeaderLayout = () => {
const { pathname } = useLocation();
@@ -17,7 +19,8 @@ const AsiderAndHeaderLayout = () => {
const [activeItem, setActiveItem] = useState<string>("");
const [sidebarOpen, setSidebarOpen] = useState(true);
const [taskCenterVisible, setTaskCenterVisible] = useState(false);
const [settingVisible, setSettingVisible] = useState(false);
const settingVisible = useAppSelector((state) => state.settings.visible);
const dispatch = useAppDispatch();
// Initialize active item based on current pathname
const initActiveItem = () => {
@@ -140,7 +143,7 @@ const AsiderAndHeaderLayout = () => {
<Button
block
onClick={() => {
setSettingVisible(true);
dispatch(showSettings());
}}
>
@@ -167,7 +170,7 @@ const AsiderAndHeaderLayout = () => {
<Button
block
onClick={() => {
setSettingVisible(true);
dispatch(showSettings());
}}
>
<SettingOutlined />
@@ -181,7 +184,7 @@ const AsiderAndHeaderLayout = () => {
width="100%"
height="100%"
open={settingVisible}
onClose={() => setSettingVisible(false)}
onClose={() => dispatch(hideSettings())}
bodyStyle={{ padding: 0 }}
destroyOnHidden={true}
>