OBPIH-6111 add pricing section with inputs#4524
Conversation
…ty to 1 and disable the field
2395e04 to
e1997c9
Compare
|
|
||
| // preselect value 1 when unit of measure Each is selected | ||
| useEffect(() => { | ||
| if (uom?.id === 'EA') { |
There was a problem hiding this comment.
this feels dangerous to me. Are we sure that on every instance this would have the id of 'EA'?
I think we'd be safer if we looked at uom.code, but we would have to include the code in the response of uoms and change the getDefaultValues() to include the code.
Unless @awalkowiak / @jmiranda know if this will always have id of 'EA' on any instance, then we can let it go.
There was a problem hiding this comment.
I can see that we insert the "EA" unit of measure in one of the migrations:
<insert tableName="unit_of_measure">
<column name="id" value="EA"/>
<column name="version" valueNumeric="0"/>
<column name="code" value="EA"/>
<column name="name" value="Each"/>
<column name="uom_class_id" value="QUANTITY"/>
<column name="created_by_id" value="1"/>
<column name="updated_by_id" value="1"/>
<column name="date_created" valueDate="2020-04-25T00:00:00.0"/>
<column name="last_updated" valueDate="2020-04-25T00:00:00.0"/>
</insert>so I think we are fine with checking the uom.id at this point
|
|
||
| // preselect value 1 when unit of measure Each is selected | ||
| useEffect(() => { | ||
| if (uom?.id === 'EA') { |
There was a problem hiding this comment.
I can see that we insert the "EA" unit of measure in one of the migrations:
<insert tableName="unit_of_measure">
<column name="id" value="EA"/>
<column name="version" valueNumeric="0"/>
<column name="code" value="EA"/>
<column name="name" value="Each"/>
<column name="uom_class_id" value="QUANTITY"/>
<column name="created_by_id" value="1"/>
<column name="updated_by_id" value="1"/>
<column name="date_created" valueDate="2020-04-25T00:00:00.0"/>
<column name="last_updated" valueDate="2020-04-25T00:00:00.0"/>
</insert>so I think we are fine with checking the uom.id at this point
* OBPIH-6111 Fixed issue where form is unsavable when package price is not filled in * OBPIH-6111 Fix issue with preceeding zeros in input type number * OBPIH-6111 Fix null contractPrice in api response * OBPIH-6111 Prevent from entering fractions on package quantity * OBPIH-6111 When unit of measure Each is selected, set value of quantity to 1 and disable the field * OBPIH-6111 use grid system provided by bootstrap to align form inputs * OBPIH-6111 Removed possibility for minimum Order quantity to enter fractions * OBPIH-6111 Added same padding values as on other form sections
One thing you may notice are changes to some other sections. This is because I have added the bootstrap grid system as a wrapper for our fields.
One of the reopen change requests I got was that my fields we not in the same layout as on the mock so I decided to use bootstrap grid system to solve this issue.
To not have different approaches in other sections I did the following modifications and also added
rowandcol-lgclasses