feat: pre-flight check of agency bookings
addresses #869bqxr4q
This commit is contained in:
@@ -62,18 +62,25 @@
|
||||
} %}
|
||||
{% endif %}
|
||||
|
||||
{# Display validation errors #}
|
||||
{% if bookingEditContext.hasValidationErrors %}
|
||||
{# Display blocking issues first; otherwise show the attention scan as a calm warning #}
|
||||
{% if bookingEditContext.hasBlockingValidationErrors %}
|
||||
{% include '_partials/_alert.html.twig' with {
|
||||
level: 'error',
|
||||
title: 'Bitte überprüfe die Teilnehmerdaten',
|
||||
messages: ['Einige Teilnehmer haben noch unvollständige oder fehlerhafte Angaben. Bitte bearbeite die markierten Teilnehmer.']
|
||||
title: 'Teilnehmerdaten prüfen',
|
||||
messages: ['Die Daten einiger Teilnehmer:innen sind noch unvollständig oder fehlerhaft. Bitte bearbeite die markierten Teilnehmer.']
|
||||
} %}
|
||||
{% elseif bookingEditContext.missingValueLabelsByParticipantIndex|length > 0 %}
|
||||
{% include '_partials/_alert.html.twig' with {
|
||||
level: 'warning',
|
||||
title: 'Teilnehmerdaten prüfen',
|
||||
messages: ['Die Daten von ' ~ (bookingEditContext.missingValueLabelsByParticipantIndex|length) ~ ' Teilnehmer:innen sind noch unvollständig oder fehlerhaft. Bitte bearbeite die markierten Teilnehmer.']
|
||||
} %}
|
||||
{% endif %}
|
||||
|
||||
<div id="participant-cards-grid" class="space-y-4">
|
||||
<div id="participant-cards-grid" class="divide-y divide-gray-200">
|
||||
{% for participant in bookingEditContext.bookingDto.participants %}
|
||||
{% set isCanceled = (bookingEditContext.bookingData.participantsStatus[loop.index0] ?? null) == 'S' %}
|
||||
{% set attentionLabels = bookingEditContext.missingValueLabelsByParticipantIndex[loop.index0]|default([]) %}
|
||||
{% include 'booking/_participant_card.html.twig' with {
|
||||
'cardData': bookingEditContext.cardsData[loop.index0],
|
||||
'index': loop.index0,
|
||||
@@ -82,6 +89,8 @@
|
||||
'bookingId': bookingEditContext.bookingData.id,
|
||||
'isCanceled': isCanceled,
|
||||
'isSubmitted': bookingEditContext.isSubmitted,
|
||||
'needsAttention': attentionLabels is not empty,
|
||||
'attentionLabels': attentionLabels,
|
||||
} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -97,13 +106,13 @@
|
||||
class="inline-flex items-center justify-center bg-gray-200 rounded-md w-8 h-8 md:w-10 md:h-10">
|
||||
<svg class="w-6 h-6 md:w-8 md:h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
||||
</a>
|
||||
{% if bookingEditContext.isDirty %}
|
||||
{% if bookingEditContext.isDirty or bookingEditContext.hasBlockingValidationErrors %}
|
||||
<button type="submit"
|
||||
{% if bookingEditContext.hasValidationErrors %}
|
||||
{% if bookingEditContext.hasBlockingValidationErrors %}
|
||||
disabled
|
||||
title="Bitte prüfe zuerst deine Eingaben"
|
||||
{% endif %}
|
||||
class="button button--primary {{ bookingEditContext.hasValidationErrors ? 'opacity-50 cursor-not-allowed' : '' }}">
|
||||
class="button button--primary {{ bookingEditContext.hasBlockingValidationErrors ? 'opacity-50 cursor-not-allowed' : '' }}">
|
||||
Buchung aktualisieren
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user