Bug #5141

[Workbench] Should permit all numeric values for numeric pipeline inputs, not just integers

Added by Brett Smith over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
-
Category:
Workbench
Target version:
Start date:
02/05/2015
Due date:
% Done:

100%

Estimated time:
(Total: 1.00 h)
Story points:
0.5

Description

Currently, when a pipeline input has dataclass: numeric, Workbench lets users specify that with an numeric X-Editable input. However, X-Editable only accepts integers in this case. It should be expanded to permit all numeric types, including floats.


Subtasks

Task #5143: Review 5141-workbench-numeric-inputs-wipResolvedPeter Amstutz

Associated revisions

Revision e5b8f682
Added by Brett Smith over 5 years ago

Merge branch '5141-workbench-numeric-inputs-wip'

Closes #5141, #5143.

History

#1 Updated by Brett Smith over 5 years ago

  • Status changed from New to In Progress

#2 Updated by Peter Amstutz over 5 years ago

I don't have a problem with treating it like a string on the browser side if the editing form is being obnoxious.

However, (correct me if I'm wrong), I believe the "number" type did ensure that the "value" field would be set to a JSON number. With this change, "value" is now a string. There needs to be some fixup logic that converts parses values with dataclass "number" to actual numbers to avoid unpleasant surprises for downstream scripts.

#3 Updated by Brett Smith over 5 years ago

Peter Amstutz wrote:

However, (correct me if I'm wrong), I believe the "number" type did ensure that the "value" field would be set to a JSON number.

This does not seem to be the case. Check out 4xphq-d1hrv-0lhbqyjab4g0bwp, which is a pipeline instance I created on 4xphq just now to test this, setting a number value using the existing Workbench code. That value is a string.

#4 Updated by Peter Amstutz over 5 years ago

Brett Smith wrote:

Peter Amstutz wrote:

However, (correct me if I'm wrong), I believe the "number" type did ensure that the "value" field would be set to a JSON number.

This does not seem to be the case. Check out 4xphq-d1hrv-0lhbqyjab4g0bwp, which is a pipeline instance I created on 4xphq just now to test this, setting a number value using the existing Workbench code. That value is a string.

You got me there. Ok.

In render_pipeline_component_attribute if attrvalue is a number (not a string) then datatype does not get set and will be nil. However, it appears that the result is simply that "data-type" is not set on the x-editable control, and x-editable defaults to text anyway.

Go ahead and merge.

#5 Updated by Brett Smith over 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:e5b8f6826a2034c0c7d7142cff3fb02f64fb8831.

Also available in: Atom PDF