Skip to content
Snippets Groups Projects
Commit 49e05548 authored by Pedda's avatar Pedda :8ball:
Browse files

fix: update admin rooms spelling and equipment creation feedback

parent d7e0e755
2 merge requests!156Update Presentation Tests,!84Prepare Presentation
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
*ngIf="name.touched && name.dirty && name.invalid" *ngIf="name.touched && name.dirty && name.invalid"
[control]="name" [control]="name"
[messages]="{ [messages]="{
required: { severity: 'error', detail: 'Bitte gib eine Niederlassung an.' }, required: { severity: 'error', detail: 'Bitte gib einen Namen an.' },
minlength: { minlength: {
severity: 'error', severity: 'error',
detail: 'Der Name muss mindestens 1 Zeichen lang sein.', detail: 'Der Name muss mindestens 1 Zeichen lang sein.',
...@@ -57,20 +57,26 @@ ...@@ -57,20 +57,26 @@
formControlName="type" formControlName="type"
optionLabel="label" optionLabel="label"
optionValue="value" /> optionValue="value" />
<app-form-error-messages
*ngIf="type.touched && type.dirty && type.invalid"
[control]="type"
[messages]="{
required: { severity: 'error', detail: 'Bitte gib einen Typ an.' },
}" />
</div> </div>
<div class="flex flex-col gap-2 lg:col-span-2"> <div class="flex flex-col gap-2 lg:col-span-2">
Beschreibung: Beschreibung:
<textarea cols="30" formControlName="description" pInputTextarea rows="5"></textarea> <textarea cols="30" formControlName="description" pInputTextarea rows="5"></textarea>
<p-messages <app-form-error-messages
[closable]="false" *ngIf="description.touched && description.dirty && description.invalid"
[enableService]="false" [control]="description"
[value]="[ [messages]="{
{ required: { severity: 'error', detail: 'Bitte gib eine Beschreibung an.' },
severity: 'info', maxlength: {
summary: 'Info', severity: 'error',
detail: 'Die Ausstattung kann noch nicht bearbeitet werden.', detail: 'Die Beschreibung darf maximal 2048 Zeichen lang sein.',
}, },
]" /> }" />
</div> </div>
<p-button [loading]="submitted" class="col-span-full mx-auto" label="Erstellen" type="submit" /> <p-button [loading]="submitted" class="col-span-full mx-auto" label="Erstellen" type="submit" />
......
...@@ -46,8 +46,8 @@ export class EquipmentCreateFormComponent { ...@@ -46,8 +46,8 @@ export class EquipmentCreateFormComponent {
Validators.minLength(1), Validators.minLength(1),
Validators.maxLength(255), Validators.maxLength(255),
]), ]),
type: new FormControl('other', [Validators.required]), type: new FormControl('', [Validators.required]),
description: new FormControl('', [Validators.maxLength(2048)]), description: new FormControl('', [Validators.required, Validators.maxLength(2048)]),
}) })
get name() { get name() {
......
<p-panel [header]="'Alle Niederlassungen mit Abteilung (' + totalRecords + ')'" [toggleable]="true"> <div class="mx-auto grid gap-2">
<p-table <p-panel [header]="'Alle Ausrüstungen (' + totalRecords + ')'" [toggleable]="true">
[value]="equipments" <p-table
[lazy]="true" [value]="equipments"
(onLazyLoad)="loadTable($event)" [lazy]="true"
dataKey="id" (onLazyLoad)="loadTable($event)"
[paginator]="true" dataKey="id"
[rows]="10" [paginator]="true"
[scrollable]="true" [rows]="10"
[rowsPerPageOptions]="[5, 10, 20, 50]" [scrollable]="true"
[totalRecords]="totalRecords" [rowsPerPageOptions]="[5, 10, 20, 50]"
[loading]="loading" [totalRecords]="totalRecords"
(onPage)="onPageChange($event)"> [loading]="loading"
<ng-template pTemplate="header"> (onPage)="onPageChange($event)">
<tr> <ng-template pTemplate="header">
<th pSortableColumn="name"> <tr>
Name <th pSortableColumn="name">
<p-sortIcon field="name" /> Name
</th> <p-sortIcon field="name" />
<th pSortableColumn="type"> </th>
Type <th pSortableColumn="type">
<p-sortIcon field="type" /> Typ
</th> <p-sortIcon field="type" />
<th>Description</th> </th>
</tr> <th>Beschreibung</th>
</ng-template> </tr>
<ng-template pTemplate="body" let-equipment> </ng-template>
<tr> <ng-template pTemplate="body" let-equipment>
<td> <tr>
{{ equipment.name }} <td>
</td> {{ equipment.name }}
<td>{{ getEquipmentTypeLabel(equipment.type) }}</td> </td>
<td>{{ equipment.description }}</td> <td>{{ getEquipmentTypeLabel(equipment.type) }}</td>
</tr> <td>{{ equipment.description }}</td>
</ng-template> </tr>
</p-table> </ng-template>
</p-panel> </p-table>
</p-panel>
<p-panel header="Neues Equipment erstellen" toggleable="true"> <p-panel header="Neues Equipment erstellen" toggleable="true">
<app-equipment-create-form (createdEvent)="onNewEquipment()" /> <app-equipment-create-form (createdEvent)="onNewEquipment()" />
</p-panel> </p-panel>
</div>
...@@ -2,12 +2,15 @@ ...@@ -2,12 +2,15 @@
<div class=""> <div class="">
<p-panel <p-panel
[header]=" [header]="
'Alle Räume von Niederlassung: ' + 'Alle Räume von ' +
department?.location + department?.location +
' Abteil: ' + ' - ' +
department?.location + department?.building +
' Etage: ' + ' - ' +
department?.floor department?.floor +
' (' +
totalRecords +
')'
" "
[toggleable]="true"> [toggleable]="true">
<p-table <p-table
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment