diff --git a/.circleci/config.yml b/.circleci/config.yml index 733ec28069..0674170b83 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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} @@ -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 diff --git a/frontend/src/views/teams.js b/frontend/src/views/teams.js index 32a1b56b4e..d3f73c6364 100644 --- a/frontend/src/views/teams.js +++ b/frontend/src/views/teams.js @@ -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 { @@ -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));