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