Skip to content

Commit

Permalink
show restricted values only if they are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Jul 7, 2023
1 parent 4220b2d commit 3a2175d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ private static BookingInfoTicket toBookingInfoTicket(Ticket ticket,

private static AdditionalField toAdditionalField(TicketFieldConfigurationDescriptionAndValue t, Map<String, Description> description) {
var fields = t.getFields().stream().map(f -> new Field(f.getFieldIndex(), f.getFieldValue())).collect(Collectors.toList());
var restrictedValues = t.getRestrictedValues().stream()
.filter(rv -> Objects.equals(t.getValue(), rv) || !t.getDisabledValues().contains(rv))
.collect(Collectors.toList());
return new AdditionalField(t.getName(), t.getValue(), t.getType(), t.isRequired(), t.isEditable(),
t.getMinLength(), t.getMaxLength(), t.getRestrictedValues(),
t.getMinLength(), t.getMaxLength(), restrictedValues,
fields, t.isBeforeStandardFields(), description);
}

Expand Down

0 comments on commit 3a2175d

Please sign in to comment.