Skip to content

Commit

Permalink
Merge pull request #758 from unitaryfund/751_existing_draft
Browse files Browse the repository at this point in the history
#751: Detect and redirect users to existing submission drafts
  • Loading branch information
WrathfulSpatula authored Dec 12, 2022
2 parents 6e34559 + 1d49c92 commit 2dfdfc7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/views/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const About = () => {
<p>
Make transparent, accessible benchmarks available to everyone in the quantum computing community.
</p>
<iframe title='Metriq: the open source platform for community driven quantum benchmarks' width='420' height='315' src='https://www.youtube.com/embed/tg6Q5fnw2EE'>
</iframe>
<iframe title='Metriq: the open source platform for community driven quantum benchmarks' width='420' height='315' src='https://www.youtube.com/embed/tg6Q5fnw2EE' />
</div>
<br />
<h1 className='text-center'>About</h1>
Expand Down
4 changes: 4 additions & 0 deletions src/views/AddSubmission.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ class AddSubmission extends React.Component {
if (field === 'contentUrl') {
axios.post(config.api.getUriPrefix() + '/pagemetadata', { url: value.trim() })
.then(res => {
const edid = res.data.data.ExistingDraftId
if (edid && (window.confirm('You have an existing draft with this URL. Press "OK" to be redirected to this draft.') === true)) {
this.props.history.push('/Submission/' + edid)
}
this.setState({ name: res.data.data.og.title, description: res.data.data.og.description.replace(/\n/g, ' '), isAlreadyInDatabase: res.data.data.isAlreadyInDatabase, isValidated: false })
})
.catch(err => {
Expand Down
3 changes: 1 addition & 2 deletions src/views/FAQ.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const FAQ = () => {
<p>
A metriq <b>"submission"</b> can be an arXiv preprint, GitHub repository, or links to peer reviewed and published articles.
</p>
<iframe title='How to make a submission on Metriq: the platform for community driven quantum benchmarks' width='420' height='315' src='https://www.youtube.com/embed/XjLeutpo3v0'>
</iframe>
<iframe title='How to make a submission on Metriq: the platform for community driven quantum benchmarks' width='420' height='315' src='https://www.youtube.com/embed/XjLeutpo3v0' />
<p>
A submission can present or utilize one of more <b>"methods"</b> by which they accomplish one or more <b>"tasks"</b>, which are workloads of interest.
</p>
Expand Down

0 comments on commit 2dfdfc7

Please sign in to comment.