webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js in katello-3.8.0.rc1 vs webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js in katello-3.8.0.rc2

- old
+ new

@@ -1,7 +1,7 @@ import React from 'react'; -import { FormGroup, FormControl, ControlLabel } from 'react-bootstrap'; +import { FormGroup, FormControl, ControlLabel, HelpBlock } from 'react-bootstrap'; import helpers from '../../../move_to_foreman/common/helpers'; import { headerFormatter, cellFormatter, selectionHeaderCellFormatter, @@ -69,11 +69,11 @@ cell: { formatters: [cellFormatter], }, }, { - property: 'quantity', + property: 'available', header: { label: __('Available Entitlements'), formatters: [headerFormatter], }, cell: { @@ -94,25 +94,30 @@ }, cell: { formatters: [ (value, { rowData }) => ( <td> - <FormGroup> + <FormGroup + validationState={controller.quantityValidationInput(rowData)} + > <ControlLabel srOnly>{__('Number to Allocate')}</ControlLabel> <FormControl type="text" onBlur={e => controller.onChange(e.target.value, rowData)} defaultValue={rowData.updatedQuantity} + onChange={(e) => { + controller.onChange(e.target.value, rowData); + }} onKeyDown={(e) => { const key = e.charCode ? e.charCode : e.keyCode; if (key === 13) { - controller.onChange(e.target.value, rowData); controller.saveUpstreamSubscriptions(); e.preventDefault(); } }} /> - <div>{__('Max')} {rowData.quantity}</div> + {controller.quantityValidationInput(rowData) === 'error' && + <HelpBlock>{controller.quantityValidation(rowData)[1]}</HelpBlock>} </FormGroup> </td> ), ], },