Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add platform from modal #850

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions src/components/ResultsAddModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useState, Suspense, useEffect } from 'react'
import { Button, Modal } from 'react-bootstrap'
import config from '../config'
import ErrorHandler from './ErrorHandler'
import EditButton from './EditButton'
import { nonblankRegex, metricValueRegex, dateRegex, standardErrorRegex, numeralRegex } from './ValidationRegex'
const FormFieldRow = React.lazy(() => import('./FormFieldRow'))
const FormFieldSelectRow = React.lazy(() => import('./FormFieldSelectRow'))
Expand All @@ -29,9 +30,10 @@ const ResultsAddModal = (props) => {
}

const handleOnChange = (field, value) => {
result[field] = value
setResult(result)
setIsValidated(false)
setResult(prevResult => {
return {...prevResult, [field]: value}
});
setIsValidated(false);
}

const onHide = () => {
Expand Down Expand Up @@ -203,6 +205,10 @@ const ResultsAddModal = (props) => {
onChange={handleOnChange}
tooltip='The quantum computer platform used by the method for this result'
/><br />
<EditButton
className='float-right edit-button btn'
onClickAdd={props.onClickAddRef}
/>
<FormFieldTypeaheadRow
inputName='metricName' label='Metric name'
value={result.metricName}
Expand Down
1 change: 1 addition & 0 deletions src/views/Submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ class Submission extends React.Component {
evaluatedAt={this.state.evaluatedAt}
metricNames={this.state.metricNames}
onAddOrEdit={this.handleModalResultAddNew}
onClickAddRef={() => this.handleOnClickAddRef('Platform')}
/>
</Suspense>
<Modal
Expand Down