UI sorting
This commit is contained in:
parent
0a126f554b
commit
449e58b8ec
@ -25,4 +25,14 @@ export class BulkEntry {
|
||||
);
|
||||
}
|
||||
|
||||
static compareName(a: BulkEntry, b: BulkEntry) {
|
||||
if (!a.property) {
|
||||
return +1;
|
||||
}
|
||||
if (!b.property) {
|
||||
return -1;
|
||||
}
|
||||
return a.property.title.localeCompare(b.property.title);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,15 +2,19 @@
|
||||
<h1>
|
||||
<app-text [initial]="bulk.name" (valueChange)="set(bulk, 'name', $event)"></app-text>
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Eigenschaft</th>
|
||||
<th>Wert</th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
<ng-container *ngIf="bulk">
|
||||
<tr *ngFor="let entry of bulk.entries">
|
||||
<tr *ngFor="let entry of bulk.entries.sort(BulkEntry.compareName)">
|
||||
<td>
|
||||
<app-search [searchService]="propertyService" [allowEmpty]="false" [initial]="entry.property?.id" (valueChange)="setEntry(entry, 'property', $event)"></app-search>
|
||||
</td>
|
||||
@ -52,7 +56,4 @@
|
||||
</ng-container>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
</ng-container>
|
||||
|
||||
@ -13,6 +13,8 @@ import {faTimesCircle} from "@fortawesome/free-regular-svg-icons";
|
||||
})
|
||||
export class BulkEditorComponent implements OnInit {
|
||||
|
||||
protected readonly BulkEntry = BulkEntry;
|
||||
|
||||
readonly faTimes = faTimesCircle;
|
||||
|
||||
bulk!: Bulk;
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th> </th>
|
||||
@ -26,7 +30,3 @@
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
</td>
|
||||
</ng-template>
|
||||
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<tr class="header">
|
||||
<ng-container *ngTemplateOutlet="boolean;context:{schedule: schedule, value: schedule.enabled, key:'enabled'}"></ng-container>
|
||||
@ -144,8 +148,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
|
||||
</ng-container>
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th> </th>
|
||||
@ -43,7 +47,3 @@
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<button (click)="create()">+ Hinzufügen</button>
|
||||
</p>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user