Compare commits

...

3 Commits

Author SHA1 Message Date
8ca16936a8 Add special liter l for unit
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-19 12:45:38 +02:00
f0998c818a Add required marker for required form field 2025-06-19 12:45:28 +02:00
0cf9f3cd0f Fix dropdown value mapping 2025-06-19 12:45:17 +02:00
5 changed files with 34 additions and 6 deletions

View File

@@ -0,0 +1 @@
<span class="required">*</span>

View File

@@ -0,0 +1,3 @@
.required {
color: red;
}

View File

@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-required-marker',
imports: [
],
templateUrl: './required-marker.component.html',
styleUrl: './required-marker.component.scss'
})
export class RequiredMarkerComponent {
}

View File

@@ -4,20 +4,25 @@
<form [formGroup]="formGroup" class="flex flex-col gap-4" (ngSubmit)="onSubmit()"> <form [formGroup]="formGroup" class="flex flex-col gap-4" (ngSubmit)="onSubmit()">
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<label [for]="formFieldNames.car"> Auto </label> <label [for]="formFieldNames.car">
Auto
<app-required-marker />
</label>
@if (cars(); as cars) { @if (cars(); as cars) {
<p-select <p-select
[options]="cars" [options]="cars"
placeholder="Auto auswählen" placeholder="Auto auswählen"
[formControlName]="formFieldNames.car" [formControlName]="formFieldNames.car"
[optionLabel]="formFieldNames.car" optionLabel="name"
[inputId]="formFieldNames.car" [inputId]="formFieldNames.car"
styleClass="w-full" /> styleClass="w-full" />
} }
</div> </div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<label [for]="formFieldNames.date"> Datum </label> <label [for]="formFieldNames.date">
Datum
</label>
<p-datepicker [iconDisplay]="'input'" <p-datepicker [iconDisplay]="'input'"
[firstDayOfWeek]="1" [firstDayOfWeek]="1"
placeholder="Datum auswählen" placeholder="Datum auswählen"
@@ -29,7 +34,10 @@
</div> </div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<label [for]="formFieldNames.mileage"> Kilometerstand </label> <label [for]="formFieldNames.mileage">
Kilometerstand
<app-required-marker />
</label>
<p-inputGroup> <p-inputGroup>
<input <input
id="mileage" id="mileage"
@@ -43,7 +51,10 @@
</div> </div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<label [for]="formFieldNames.amount"> Menge </label> <label [for]="formFieldNames.amount">
Menge
<app-required-marker />
</label>
<p-inputGroup> <p-inputGroup>
<input <input
id="amount" id="amount"
@@ -52,7 +63,7 @@
min="1" min="1"
pInputText pInputText
[formControlName]="formFieldNames.amount" /> [formControlName]="formFieldNames.amount" />
<p-inputGroupAddon>l</p-inputGroupAddon> <p-inputGroupAddon>&#8467;</p-inputGroupAddon>
</p-inputGroup> </p-inputGroup>
</div> </div>

View File

@@ -15,6 +15,7 @@ import { MultiSelectModule } from 'primeng/multiselect';
import { SelectModule } from 'primeng/select'; import { SelectModule } from 'primeng/select';
import { SkeletonModule } from 'primeng/skeleton'; import { SkeletonModule } from 'primeng/skeleton';
import { map } from 'rxjs'; import { map } from 'rxjs';
import { RequiredMarkerComponent } from './components/required-marker.component';
@Component({ @Component({
selector: 'app-edit-entry', selector: 'app-edit-entry',
@@ -29,6 +30,7 @@ import { map } from 'rxjs';
InputTextModule, InputTextModule,
MultiSelectModule, MultiSelectModule,
ReactiveFormsModule, ReactiveFormsModule,
RequiredMarkerComponent,
SelectModule, SelectModule,
SkeletonModule, SkeletonModule,
], ],