Skip to content

Commit

Permalink
link to project working
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelPull committed Oct 16, 2024
1 parent 5452ae3 commit 83c5abe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/src/pages/SubProjects/ProjectDetails.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { Link } from "react-router-dom";
import _isEmpty from "lodash/isEmpty";

import BarChartIcon from "@mui/icons-material/BarChart";
Expand Down Expand Up @@ -77,6 +78,7 @@ const ProjectDetails = (props) => {
const hasOpenSubprojects = !_isEmpty(subProjects.find((subproject) => subproject.data.status === "open"));
const closeDisabled = !canClose || hasOpenSubprojects || projectStatus === "closed";
const tags = displayTags(projectTags || []);

return (
<div className="project-details-container">
<Card className="project-details-card">
Expand All @@ -89,6 +91,11 @@ const ProjectDetails = (props) => {
) : null}
<ListItemText primary={trimSpecialChars(projectName)} secondary={projectComment} />
</ListItem>
<ListItem>
<div>
<Link to={"/projects/25533d20cdbafa00182c13ca95842f96"}>CLICK</Link>
</div>
</ListItem>
<ListItem>
<ListItemAvatar>
<Avatar>
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/pages/SubProjects/SubProjectContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ class SubProjectContainer extends Component {
}

componentDidUpdate(prevProps) {
if (this.props.router.location.pathname !== prevProps.router.location.pathname) {
const newProjectId = this.props.router.location.pathname.split("/")[2];
if (newProjectId !== this.projectId) {
this.setState({ isDataFetched: false });
this.projectId = newProjectId;
this.props.setSelectedView(this.projectId, "project");
this.props.fetchAllProjectDetails(this.projectId, true);
this.setState({ isDataFetched: true });
}
}
const searchTermChanges = this.props.searchTerm !== prevProps.searchTerm;
const projectsChange = !_isEqual(this.props.subProjects, prevProps.subProjects);

Expand Down

0 comments on commit 83c5abe

Please sign in to comment.