Skip to content

Commit

Permalink
Merge pull request #6641 from hotosm/fix/team-member-page-issue
Browse files Browse the repository at this point in the history
Fix Team Members page issues
  • Loading branch information
ramyaragupathy authored Jan 7, 2025
2 parents 505acfa + f5afb67 commit 25a9d43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ jobs:
- env
- run:
name: Run yarn test
no_output_timeout: 20m
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/frontend/
CI=true yarn test -w 3 --silent
CI=true yarn test -w 1 --silent
CI=true GENERATE_SOURCEMAP=false yarn build
backend-code-check-PEP8:
Expand Down Expand Up @@ -133,7 +134,6 @@ jobs:
--output text)
- run:
name: Make Database Backup
no_output_timeout: 15m
command: |
aws rds wait db-instance-available \
--db-instance-identifier ${RDS_ID}
Expand Down Expand Up @@ -211,7 +211,6 @@ jobs:
/tmp/tasking-manager.cfn.json > "$tmpfile" && mv "$tmpfile" $CIRCLE_WORKING_DIRECTORY/cfn-config-<< parameters.stack_name >>.json
- run:
name: Deploy to << parameters.stack_name >>
no_output_timeout: 15m
command: |
export NODE_PATH=/usr/local/share/.config/yarn/global/node_modules/
validate-template $CIRCLE_WORKING_DIRECTORY/scripts/aws/cloudformation/tasking-manager.template.js
Expand Down
16 changes: 14 additions & 2 deletions frontend/src/views/teams.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useSelector } from 'react-redux';
import { Link, useNavigate, useParams } from 'react-router-dom';
import { Link, useNavigate, useParams, useLocation } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
import { Form } from 'react-final-form';
import {
Expand Down Expand Up @@ -421,18 +421,30 @@ export function EditTeam(props) {
export function TeamDetail() {
const { id } = useParams();
useSetTitleTag(`Team #${id}`);
const location = useLocation();
const navigate = useNavigate();
const userDetails = useSelector((state) => state.auth.userDetails);
const token = useSelector((state) => state.auth.token);
const [error, loading, team] = useFetch(`teams/${id}/`);
// eslint-disable-next-line
const [projectsError, projectsLoading, projects] = useFetch(
`projects/?teamId=${id}&omitMapResults=true&projectStatuses=PUBLISHED,DRAFT,ARCHIVED`,
`projects/?teamId=${id}&omitMapResults=true&projectStatuses=PUBLISHED`,
id,
);
const [isMember, setIsMember] = useState(false);
const [managers, setManagers] = useState([]);
const [members, setMembers] = useState([]);

useEffect(() => {
if (!token) {
navigate('/login', {
state: {
from: location.pathname,
},
});
}
}, [location.pathname, navigate, token]);

useEffect(() => {
if (team && team.members) {
setManagers(filterActiveManagers(team.members));
Expand Down

0 comments on commit 25a9d43

Please sign in to comment.