LP1910409 MARC Batch Edit Allows CSV Column 0
authorBill Erickson <berickxx@gmail.com>
Wed, 6 Jan 2021 15:23:22 +0000 (10:23 -0500)
committerJane Sandberg <sandbej@linnbenton.edu>
Wed, 10 Feb 2021 17:05:12 +0000 (09:05 -0800)
Fixes an issue where the "Go!" button was disabled in the MARC Batch
Edit interface when chosing column "0" for a CSV file updload.

Form now prevents values below 0 from being applied (via the number
spinner) and treats all column values >= 0 as valid.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>

Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.html
Open-ILS/src/eg2/src/app/staff/cat/marcbatch/marcbatch.component.ts

index d3cbb13..bfa2952 100644 (file)
           <div class="row">
             <div class="col-lg-3" i18n>Column: </div>
             <div class="col-lg-3 d-flex">
-              <input type="number" class="form-control" [(ngModel)]="csvColumn"/>
+              <input min="0" type="number" class="form-control" [(ngModel)]="csvColumn"/>
               <span class="pl-2" i18n> of </span>
             </div>
             <div class="col-lg-6">
index 84c7f35..81e3913 100644 (file)
@@ -183,7 +183,7 @@ export class MarcBatchComponent implements OnInit {
             return !this.bucket;
 
         } else if (this.source === 'c') {
-            return (!this.csvColumn || !this.csvFile);
+            return (this.csvColumn < 0 || !this.csvFile);
 
         } else if (this.source === 'r') {
             return !this.recordId;