Skip to content

Commit

Permalink
Merge pull request #21 from HicResearch/dev
Browse files Browse the repository at this point in the history
singleapprover: automatically make copy/download buttons available
  • Loading branch information
manics authored Jul 25, 2023
2 parents ba3c81b + db0da07 commit 8a6b849
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions src/components/egress/EgressRequestList.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ function EgressRequestList() {
}
}
setNotificationMessage('Request saved successfully.');
if (selectedEgressRequest.is_single_approval_enabled) {
if (decision === 'APPROVED') setIsDownloadable(true);
setIsEditable(false);
}
} catch (err) {
setNotificationMessage(err.errors[0].message);
}
Expand Down Expand Up @@ -627,32 +631,25 @@ function EgressRequestList() {
Reject
</Button>

{downloading ? (
<CircularProgress size={25} color="primary" />
) : (
<Button
color="primary"
variant="contained"
onClick={handleDownload}
disabled={!isDownloadable}
startIcon={<FileDownloadIcon />}
>
Download
</Button>
)}
{downloading ? (
<CircularProgress size={25} color="primary" />
) : (
<Button
color="primary"
variant="contained"
onClick={handleCopyLink}
disabled={!isDownloadable}
startIcon={<ContentCopyIcon />}
>
Copy link
</Button>
)}
<Button
color="primary"
variant="contained"
onClick={handleDownload}
disabled={!isDownloadable}
startIcon={<FileDownloadIcon />}
>
Download
</Button>
<Button
color="primary"
variant="contained"
onClick={handleCopyLink}
disabled={!isDownloadable}
startIcon={<ContentCopyIcon />}
>
Copy link
</Button>
{downloading && <CircularProgress size={25} color="primary" />}
</Stack>
</MDBModalFooter>
</form>
Expand Down

0 comments on commit 8a6b849

Please sign in to comment.