-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements #1376, #1361, #1354 (#412)
* - first implementation of #1354 * - updated message for #1354 * - cleanup for #1354 * - implemented #1361 - improvements for #1354 * - implemented #1376 - also fixed bug in download structures dialog where only first download got added to the dropdown menu
- Loading branch information
1 parent
30bf9d1
commit 42fdbad
Showing
9 changed files
with
141 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React, { useState } from 'react'; | ||
import { Button, Modal } from '../../common'; | ||
import { DJANGO_CONTEXT } from '../../../utils/djangoContext'; | ||
import { DialogActions, DialogContent, DialogContentText, DialogTitle } from '@material-ui/core'; | ||
import { updateClipboard } from '../../snapshot/helpers'; | ||
|
||
export const LegacySnapshotModal = ({ open, project, snapshot }) => { | ||
const [legacyLink, setLegacyLink] = useState(''); | ||
|
||
if (DJANGO_CONTEXT['legacy_url'] && DJANGO_CONTEXT['legacy_url'] !== '' && legacyLink === '') { | ||
setLegacyLink(`${DJANGO_CONTEXT['legacy_url']}/viewer/react/projects/${project}/${snapshot}`); | ||
} | ||
|
||
const openInNewTab = () => { | ||
window.open(legacyLink); | ||
}; | ||
|
||
return ( | ||
<Modal open={open}> | ||
<> | ||
<DialogTitle id="form-dialog-title">Potential legacy link detected</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText> | ||
Project/Snapshot could not be resolved. It's possible that this is legacy URL and you may try to visit URL | ||
below. | ||
</DialogContentText> | ||
<a href={legacyLink} target="_blank"> | ||
{legacyLink} | ||
</a> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={() => updateClipboard(legacyLink)} color="primary"> | ||
Copy link | ||
</Button> | ||
<Button style={{ width: '175px' }} onClick={openInNewTab} color="primary"> | ||
Open in new tab | ||
</Button> | ||
</DialogActions> | ||
</> | ||
{/* <h3> | ||
Project/Snapshot could not be resolved. It's possible that this is legacy URL and you may try to visit URL | ||
below. <br /> | ||
</h3> | ||
<a href={legacyLink} target="_blank"> | ||
Legacy URL | ||
</a> */} | ||
</Modal> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters