Commit 5526453
authored
(fix) Add quantity > 0 validation to billing form (#648)
* (fix) add quantity > 0 validation to billing form
Prevent submission of bill items with zero or empty quantity.
Extends `validateSelectedItems` to show an error snackbar and
return false when any item's quantity is falsy or less than 1.
* review changes
* (fix) Remove min={1} from quantity NumberInput
min={1} on Carbon's NumberInput prevents the invalid state from
surfacing when the user clears or enters a value below 1. Removing
it lets the inline invalid/invalidText validation display correctly.1 parent cb69f71 commit 5526453
1 file changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| |||
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
178 | 192 | | |
179 | 193 | | |
180 | | - | |
| 194 | + | |
181 | 195 | | |
182 | 196 | | |
183 | 197 | | |
| |||
252 | 266 | | |
253 | 267 | | |
254 | 268 | | |
255 | | - | |
| 269 | + | |
| 270 | + | |
256 | 271 | | |
257 | 272 | | |
258 | | - | |
| 273 | + | |
259 | 274 | | |
260 | 275 | | |
261 | 276 | | |
| |||
292 | 307 | | |
293 | 308 | | |
294 | 309 | | |
295 | | - | |
296 | 310 | | |
297 | 311 | | |
298 | 312 | | |
| |||
0 commit comments