Merge branch 'main' into tracker-connect-back
This commit is contained in:
commit
65874161c7
@ -7,7 +7,8 @@ import {
|
||||
getValueModalType,
|
||||
setProject,
|
||||
setProjectBoardFetch,
|
||||
editProjectName
|
||||
editProjectName,
|
||||
getColumnTitle,
|
||||
} from "../../../redux/projectsTrackerSlice";
|
||||
|
||||
import "./trackerModal.scss";
|
||||
@ -18,7 +19,8 @@ export const TrackerModal = ({
|
||||
selectedTab,
|
||||
defautlInput,
|
||||
titleProject,
|
||||
projectId
|
||||
projectId,
|
||||
titleColumn
|
||||
}) => {
|
||||
const dispatch = useDispatch();
|
||||
const projectBoard = useSelector(getProjectBoard);
|
||||
@ -27,6 +29,8 @@ export const TrackerModal = ({
|
||||
|
||||
const [emailWorker, setEmailWorker] = useState("");
|
||||
const [projectName, setProjectName] = useState(defautlInput);
|
||||
const [editTitleColumn, setEditTitleColumn] = useState(titleColumn);
|
||||
|
||||
const [valueColumn, setValueColumn] = useState("");
|
||||
const [nameProject, setNameProject] = useState("");
|
||||
|
||||
@ -80,11 +84,11 @@ export const TrackerModal = ({
|
||||
method: "PUT",
|
||||
data: {
|
||||
project_id: projectId,
|
||||
name: projectName
|
||||
name: projectName,
|
||||
},
|
||||
}).then((res) => {
|
||||
setActive(false)
|
||||
dispatch(editProjectName({id: projectId, name: projectName}))
|
||||
setActive(false);
|
||||
dispatch(editProjectName({ id: projectId, name: projectName }));
|
||||
});
|
||||
}
|
||||
|
||||
@ -232,7 +236,6 @@ export const TrackerModal = ({
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{/* TODO: fix state */}
|
||||
{modalType === "editColumn" && (
|
||||
<div>
|
||||
<div className="title-project">
|
||||
@ -240,8 +243,8 @@ export const TrackerModal = ({
|
||||
<div className="input-container">
|
||||
<input
|
||||
className="name-project"
|
||||
value={defautlInput}
|
||||
onChange={(e) => setValueTiket(e.target.value)}
|
||||
value={editTitleColumn}
|
||||
onChange={(e) => setEditTitleColumn(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,6 +16,7 @@ import {
|
||||
setProjectBoardFetch,
|
||||
setToggleTab,
|
||||
activeLoader,
|
||||
setColumnTitle,
|
||||
} from "../../redux/projectsTrackerSlice";
|
||||
|
||||
import ModalTicket from "../../components/UI/ModalTicket/ModalTicket";
|
||||
@ -191,6 +192,12 @@ export const ProjectTracker = () => {
|
||||
</Link>
|
||||
</div>
|
||||
<div className="tracker__tabs__content">
|
||||
<TrackerModal
|
||||
active={modalAdd}
|
||||
setActive={setModalAdd}
|
||||
selectedTab={selectedTab}
|
||||
/>
|
||||
|
||||
{loader && <Loader style="green" />}
|
||||
{!loader && (
|
||||
<div className="tracker__tabs__content__tasks tasks active__content">
|
||||
@ -198,12 +205,6 @@ export const ProjectTracker = () => {
|
||||
<div className="tasks__head__wrapper">
|
||||
<h4>Проект : {projectBoard.name}</h4>
|
||||
|
||||
<TrackerModal
|
||||
active={modalAdd}
|
||||
setActive={setModalAdd}
|
||||
selectedTab={selectedTab}
|
||||
></TrackerModal>
|
||||
|
||||
<div className="tasks__head__add">
|
||||
<span
|
||||
onClick={() => {
|
||||
@ -269,6 +270,12 @@ export const ProjectTracker = () => {
|
||||
wrapperHover[column.id] ? "tasks__board__hover" : ""
|
||||
}`}
|
||||
>
|
||||
<TrackerModal
|
||||
active={modalAdd}
|
||||
setActive={setModalAdd}
|
||||
selectedTab={selectedTab}
|
||||
titleColumn={column.title}
|
||||
/>
|
||||
<div className="board__head">
|
||||
{/*<span className={wrapperIndex === 3 ? "done" : ""}>*/}
|
||||
<span>{column.title}</span>
|
||||
|
@ -6,7 +6,7 @@ const initialState = {
|
||||
projectBoard: {},
|
||||
toggleTab: 1,
|
||||
modalType: "",
|
||||
boardLoader: false
|
||||
boardLoader: false,
|
||||
};
|
||||
|
||||
export const setProjectBoardFetch = createAsyncThunk("userInfo", (id) =>
|
||||
@ -29,12 +29,12 @@ export const projectsTrackerSlice = createSlice({
|
||||
deleteProject: (state, action) => {
|
||||
state.projects.forEach((project) => {
|
||||
if (project.id === action.payload.id) {
|
||||
project.status = 10
|
||||
project.status = 10;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
activeLoader: (state) => {
|
||||
state.boardLoader = true
|
||||
state.boardLoader = true;
|
||||
},
|
||||
moveProjectTask: (state, action) => {
|
||||
state.projectBoard.columns.forEach((column, index) => {
|
||||
@ -58,9 +58,9 @@ export const projectsTrackerSlice = createSlice({
|
||||
editProjectName: (state, action) => {
|
||||
state.projects.forEach((project) => {
|
||||
if (project.id === action.payload.id) {
|
||||
project.name = action.payload.name
|
||||
project.name = action.payload.name;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
modalToggle: (state, action) => {
|
||||
state.modalType = action.payload;
|
||||
@ -69,7 +69,7 @@ export const projectsTrackerSlice = createSlice({
|
||||
extraReducers: {
|
||||
[setProjectBoardFetch.fulfilled]: (state, action) => {
|
||||
state.projectBoard = action.payload;
|
||||
state.boardLoader = false
|
||||
state.boardLoader = false;
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -82,13 +82,14 @@ export const {
|
||||
setToggleTab,
|
||||
modalToggle,
|
||||
activeLoader,
|
||||
editProjectName
|
||||
editProjectName,
|
||||
setColumnTitle,
|
||||
} = projectsTrackerSlice.actions;
|
||||
|
||||
export const getProjects = (state) => state.tracker.projects;
|
||||
export const getProjectBoard = (state) => state.tracker.projectBoard;
|
||||
export const getToggleTab = (state) => state.tracker.toggleTab;
|
||||
export const getValueModalType = (state) => state.tracker.modalType;
|
||||
export const getBoarderLoader = (state) => state.tracker.boardLoader
|
||||
export const getBoarderLoader = (state) => state.tracker.boardLoader;
|
||||
|
||||
export default projectsTrackerSlice.reducer;
|
||||
|
Loading…
Reference in New Issue
Block a user