Skip to content

Commit

Permalink
fix: quick order - enable the add-to-cart button after a valid csv fi…
Browse files Browse the repository at this point in the history
…le has been selected (#736)
  • Loading branch information
SGrueber authored Jun 22, 2021
1 parent e638710 commit 72aaf83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h3>{{ 'quickorder.page.csv.title' | translate }}</h3>
</div>
</div>
<div>
<button type="submit" class="btn btn-primary" name="addToCartCSV" disabled="csvForm.invalid">
<button type="submit" class="btn btn-primary" name="addToCartCSV" [disabled]="isCsvDisabled">
{{ 'quickorder.page.add.cart' | translate }}
</button>
<button type="reset" class="btn btn-link" name="reset" (click)="resetCsvProductArray()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ export class QuickorderPageComponent implements OnInit {
return file.name.endsWith('.csv');
}

get isCsvDisabled() {
return this.status !== 'ValidFormat';
}

addCsvToCart() {
if (this.status === 'ValidFormat') {
this.addProductsToBasket(this.productsFromCsv);
Expand Down

0 comments on commit 72aaf83

Please sign in to comment.