{
{
title: 'Value',
key: 'metricValue',
- width: 160
+ width: 120
},
{
title: 'Qubits',
key: 'qubitCount',
- width: 160
+ width: 120
},
{
title: 'Depth',
key: 'circuitDepth',
- width: 160
+ width: 120
+ },
+ {
+ title: 'Shots',
+ key: 'shots',
+ width: 120
},
{
title: 'Notes',
@@ -84,6 +89,7 @@ const ResultsTable = (props) => {
metricValue: row.metricValue,
qubitCount: row.qubitCount,
circuitDepth: row.circuitDepth,
+ shots: row.shots,
notes: {row.notes &&
{row.notes}}>
}
,
edit: props.onClickEdit(row.id)} />
})
diff --git a/src/components/SubmissionRefsAddModal.js b/src/components/SubmissionRefsAddModal.js
index 12052c41..a0461f6b 100644
--- a/src/components/SubmissionRefsAddModal.js
+++ b/src/components/SubmissionRefsAddModal.js
@@ -1,4 +1,4 @@
-import React, { Suspense, useEffect, useState } from 'react'
+import React, { Suspense, useEffect, useState, useCallback } from 'react'
import { Accordion, Button, Card, Modal } from 'react-bootstrap'
import { Link } from 'react-router-dom'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
@@ -25,6 +25,19 @@ const SubmissionRefsAddModal = (props) => {
submissions: props.submissionId
})
+ const key = props.modalMode === 'Task'
+ ? 'task'
+ : props.modalMode === 'Method'
+ ? 'method'
+ : props.modalMode === 'Platform' ? 'platform' : 'login'
+
+ const handleValidation = useCallback((i) => {
+ if (!i) {
+ i = item
+ }
+ setIsValid((!!i.id && !showAccordion) || (showAccordion && !!i.name && (i.parent || (key !== 'task'))))
+ }, [item, showAccordion, key])
+
useEffect(() => {
const nItem = { ...item }
const submissions = props.submissionId.toString()
@@ -33,24 +46,12 @@ const SubmissionRefsAddModal = (props) => {
if (props.refName) {
isChanged |= nItem.name !== props.refName
nItem.name = props.refName
+ handleValidation(nItem)
}
if (isChanged) {
setItem(nItem)
}
- }, [props.submissionId, props.refName, item])
-
- const key = props.modalMode === 'Task'
- ? 'task'
- : props.modalMode === 'Method'
- ? 'method'
- : props.modalMode === 'Platform' ? 'platform' : 'login'
-
- const handleValidation = (i) => {
- if (!i) {
- i = item
- }
- setIsValid((!!i.id && !showAccordion) || (showAccordion && !!i.name && (i.parent || (key !== 'task'))))
- }
+ }, [props.submissionId, props.refName, item, handleValidation])
const handleAccordionToggle = () => {
setIsValid((!!item.id && showAccordion) || (!showAccordion && !!item.name && (item.parent || (key !== 'task'))))
diff --git a/src/components/ValidationRegex.js b/src/components/ValidationRegex.js
index f42a6a96..f2d955d1 100644
--- a/src/components/ValidationRegex.js
+++ b/src/components/ValidationRegex.js
@@ -4,10 +4,8 @@ const metricValueRegex = /(^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)$)|([+-]?\d(\.\d+
const nonblankRegex = /(.|\s)*\S(.|\s)*/
const numberRegex = /^[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)$/
const passwordValidRegex = /.{12,}/
-const sampleSizeRegex = /^[0-9]+$/
const standardErrorRegex = /^[0-9]+([.][0-9]*)?|[.][0-9]+$/
-const qubitCountRegex = /^[0-9]+$/
-const circuitDepthRegex = /^[0-9]+$/
+const numeralRegex = /^[0-9]+$/
const urlValidRegex = new RegExp('^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
@@ -29,10 +27,8 @@ module.exports = {
nonblankRegex,
numberRegex,
passwordValidRegex,
- sampleSizeRegex,
standardErrorRegex,
- qubitCountRegex,
- circuitDepthRegex,
+ numeralRegex,
urlValidRegex,
blankOrurlValidRegex,
usernameValidRegex