Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
e842999c
Commit
e842999c
authored
7 months ago
by
Mohammad Nakhaee
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "frontend float quantities validation"
Changelog: Fixed
parent
8194c0c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2039
Resolve "frontend float quantities validation"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gui/src/components/editQuantity/NumberEditQuantity.spec.js
+4
-2
4 additions, 2 deletions
gui/src/components/editQuantity/NumberEditQuantity.spec.js
gui/src/components/units/common.js
+2
-2
2 additions, 2 deletions
gui/src/components/units/common.js
with
6 additions
and
4 deletions
gui/src/components/editQuantity/NumberEditQuantity.spec.js
+
4
−
2
View file @
e842999c
...
@@ -45,11 +45,13 @@ describe('Test numberEditQuantity', () => {
...
@@ -45,11 +45,13 @@ describe('Test numberEditQuantity', () => {
await
waitFor
(()
=>
expect
(
numberFieldValueInput
.
value
).
toEqual
(
'
10
'
))
await
waitFor
(()
=>
expect
(
numberFieldValueInput
.
value
).
toEqual
(
'
10
'
))
await
changeValue
(
numberFieldValueInput
,
'
5
'
)
await
changeValue
(
numberFieldValueInput
,
'
5
'
)
await
changeValue
(
numberFieldValueInput
,
'
0
'
)
await
changeValue
(
numberFieldValueInput
,
''
)
await
changeValue
(
numberFieldValueInput
,
''
)
await
waitFor
(()
=>
expect
(
handleChange
.
mock
.
calls
).
toHaveLength
(
2
))
await
waitFor
(()
=>
expect
(
handleChange
.
mock
.
calls
).
toHaveLength
(
3
))
await
waitFor
(()
=>
expect
(
handleChange
.
mock
.
calls
[
0
][
0
]).
toBe
(
5
))
await
waitFor
(()
=>
expect
(
handleChange
.
mock
.
calls
[
0
][
0
]).
toBe
(
5
))
await
waitFor
(()
=>
expect
(
handleChange
.
mock
.
calls
[
1
][
0
]).
toBe
(
undefined
))
await
waitFor
(()
=>
expect
(
handleChange
.
mock
.
calls
[
1
][
0
]).
toBe
(
0
))
await
waitFor
(()
=>
expect
(
handleChange
.
mock
.
calls
[
2
][
0
]).
toBe
(
undefined
))
})
})
test
.
each
([
test
.
each
([
...
...
This diff is collapsed.
Click to expand it.
gui/src/components/units/common.js
+
2
−
2
View file @
e842999c
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
{
memoize
,
has
}
from
'
lodash
'
import
{
memoize
,
has
,
isNil
}
from
'
lodash
'
import
{
Unit
}
from
'
./Unit
'
import
{
Unit
}
from
'
./Unit
'
import
{
Unit
as
UnitMathJS
}
from
'
mathjs
'
import
{
Unit
as
UnitMathJS
}
from
'
mathjs
'
...
@@ -53,7 +53,7 @@ export function parse(input, options) {
...
@@ -53,7 +53,7 @@ export function parse(input, options) {
try
{
try
{
const
parseResults
=
parseInternal
(
input
,
options
)
const
parseResults
=
parseInternal
(
input
,
options
)
result
.
value
=
parseResults
.
value
||
undefined
result
.
value
=
isNil
(
parseResults
.
value
)
?
undefined
:
parseResults
.
value
result
.
valueString
=
parseResults
.
valueString
||
undefined
result
.
valueString
=
parseResults
.
valueString
||
undefined
if
(
parseResults
.
unit
?.
units
?.
length
)
{
if
(
parseResults
.
unit
?.
units
?.
length
)
{
result
.
unit
=
new
Unit
(
parseResults
.
unit
)
result
.
unit
=
new
Unit
(
parseResults
.
unit
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment