mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1908: feat(remission-shared-dialog): add dynamic dropdown label for return reason s...
feat(remission-shared-dialog): add dynamic dropdown label for return reason selection Implement computed property to show selected reason value or default placeholder text in the dropdown label. This provides better UX by displaying the current selection instead of a static label. - Add dropdownLabel computed property that returns selected reason or fallback - Update template to use dynamic label binding instead of hardcoded text - Enhances user feedback when reason is selected vs. when no selection is made Ref: #5253
This commit is contained in:
committed by
Andreas Schickinger
parent
0dcb31973f
commit
7ae484fc83
@@ -24,7 +24,7 @@
|
||||
class="border-none max-w-56 truncate"
|
||||
data-what="dropdown"
|
||||
data-which="reason"
|
||||
label="Rückgabegrund"
|
||||
[label]="dropdownLabel()"
|
||||
>
|
||||
@if (reasonResource.value(); as reasons) {
|
||||
@for (reson of reasons; track reson.key) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
computed,
|
||||
inject,
|
||||
input,
|
||||
model,
|
||||
@@ -41,6 +42,11 @@ export class QuantityAndReasonItemComponent {
|
||||
|
||||
quantityAndReason = model.required<QuantityAndReason>();
|
||||
|
||||
dropdownLabel = computed(() => {
|
||||
const reason = this.quantityAndReason().reason;
|
||||
return reason !== '' ? reason : 'Rückgabegrund';
|
||||
});
|
||||
|
||||
reasonResource = resource({
|
||||
loader: async ({ abortSignal }) => {
|
||||
return this.#reasonService.fetchReturnReasons(abortSignal);
|
||||
|
||||
Reference in New Issue
Block a user