<input class="form-control form-control-sm" type="text"
spellcheck="false"
[required]="true"
+ [ngClass]="{invalid: !volNode.target.label()}"
[ngModel]="volNode.target.label()"
(change)="applyVolValue(volNode.target, 'label', $event.target.value)">
</ng-container>
</button>
</ng-container>
+ <!--
+ Barcode value is not required for new copies, since those
+ without a barcode will be ignored.
+ -->
<input type="text" class="form-control form-control-sm"
title="{{copyStatLabel(copyNode.target)}}"
id="barcode-input-{{copyNode.target.id()}}"
spellcheck="false" [required]="true"
placeholder="New Barcode..." i18n-placeholder
[disabled]="volcopy.copyStatIsMagic(copyNode.target.status())"
- [ngClass]="{'text-danger': copyNode.target._dupe_barcode}"
+ [ngClass]="{
+ 'text-danger': copyNode.target._dupe_barcode,
+ 'invalid': !copyNode.target.barcode() && !copyNode.target.isnew()
+ }"
(change)="barcodeChanged(copyNode.target, $event.target.value)"
(ngModelChange)="copyNode.target.barcode($event)"
(keyup.enter)="selectNextBarcode(copyNode.target.id())"
-<div class="border rounded m-1" [ngClass]="{'border-danger': warnOnRequired()}">
+<div class="border rounded m-1">
<div class="font-weight-bold header p-2 d-flex" i18n>
{{label}} <span *ngIf="hasChanged" class="text-danger">*</span>
<ng-container *ngIf="bulky()">
</div>
<div tabindex="0" class="p-2" *ngIf="!editing || multiValue()"
(click)="enterEditMode()" (keyup.enter)="enterEditMode()"
- [ngClass]="{'has-changes': hasChanged}">
+ [ngClass]="{'has-changes': hasChanged, 'bg-warning': warnOnRequired()}">
<div class="d-flex"
*ngFor="let count of labelCounts | keyvalue; let idx = index">
<ng-container *ngIf="!expanded && !editing && idx === defaultDisplayCount">
</ng-container>
<div class="flex-1">
<ng-container *ngIf="displayAs == 'bool'">
- <span *ngIf="count.key == 't'" i18n>Yes</span>
- <span *ngIf="count.key == 'f'" i18n>No</span>
+ <ng-container *ngIf="valueIsUnset(count.key); else defaultBool">
+ <span i18n><Unset></span>
+ </ng-container>
+ <ng-template #defaultBool>
+ <span *ngIf="count.key == 't'" i18n>Yes</span>
+ <span *ngIf="count.key == 'f'" i18n>No</span>
+ </ng-template>
</ng-container>
<ng-container *ngIf="displayAs == 'currency'">
<ng-container
</ng-container>
<ng-template #defaultCurrency>{{count.key | currency}}</ng-template>
</ng-container>
- <ng-container *ngIf="displayAs == null">
+ <ng-container *ngIf="displayAs != 'bool' && displayAs != 'currency'">
<ng-container
*ngIf="valueIsUnset(count.key); else default">
<span i18n><Unset></span>