Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions frontend/src/components/PhaseProgress/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useContext } from 'react';
import React, { useEffect, useState, useContext } from 'react';
import Button from '@material-ui/core/Button';
import Box from '@material-ui/core/Box';
import Dialog from '@material-ui/core/Dialog';
Expand Down Expand Up @@ -29,6 +29,8 @@ import ReleaseContext from '../../utils/ReleaseContext';
import { phasePrettyName } from '../text';
import MouseOverPopover from '../Shared/MouseOverPopover';

const POLL_INTERVAL = 60000; // 60 seconds

const useStyles = makeStyles(theme => ({
label: {
lineHeight: '0.5',
Expand Down Expand Up @@ -58,6 +60,14 @@ export default function PhaseProgress({ release, readOnly, xpi }) {
'/tasks/groups'
);
const loading = schedulePhaseState.loading || phaseSignOffState.loading;

useEffect(() => {
const interval = setInterval(() => {
fetchReleases(productBranches);
}, POLL_INTERVAL);
return () => clearInterval(interval);
}, [fetchReleases, productBranches]);

const handleClickOpen = phase => {
setPhase(phase);
setOpen(true);
Expand Down Expand Up @@ -130,7 +140,7 @@ export default function PhaseProgress({ release, readOnly, xpi }) {
: { classes: { completed: classes.completed } }
}>
<Link href={`${taskGroupUrlPrefix}/${phase.actionTaskId}`}>
{prettyName} task
{prettyName} task group
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes this is a 404. I wonder if we could wait for it to actually be there before making this link clickable

</Link>
{phase.signoffs && phase.signoffs.length > 0 && (
<MouseOverPopover
Expand Down Expand Up @@ -195,7 +205,7 @@ export default function PhaseProgress({ release, readOnly, xpi }) {
!phases.map(p => p.tcStatus).find(st => st === 'running') &&
(idx === 0 || // The first phase can be scheduled anytime
allowPhaseSkipping || // Can schedule anything
phases[idx - 1].tcStatus === 'completed' || // previsous phase is done
phases[idx - 1].tcStatus === 'completed' || // previous phase is done
// Special case for Firefox RC.
// push_firefox can be scheduled even if ship_firefox_rc (the previous
// phase) is not ready. We still need to be sure that
Expand Down