Fix in logic, further documentation in dev_notes

This commit is contained in:
Mirco 2024-06-14 12:11:10 +02:00
parent 6900a54157
commit afb0f46545
2 changed files with 8 additions and 6 deletions

View file

@ -2,9 +2,12 @@
``` ```
HowTo BUILD jar? HowTo BUILD jar?
local: ./gradle build
Failed within local: ./gradle build
java -jar build/libs/ModeratorElection.jar -> localhost:6333 "White Label..."-Error java -jar build/libs/ModeratorElection.jar -> localhost:6333 "White Label..."-Error
https://docs.gradle.org/current/userguide/gradle_wrapper.html
=> ./gradlew clean build -Pvaadin.productionMode
..in ide dev: ./gradlew clean vaadinPrepareFrontend
``` ```
``` ```

View file

@ -38,8 +38,9 @@ public class MainView extends VerticalLayout {
Button electNow = new Button("Elect!", buttonClickEvent -> { Button electNow = new Button("Elect!", buttonClickEvent -> {
try { try {
ArrayList checkboxSelectedMembers = new ArrayList(checkboxGroup.getSelectedItems());
Notification moderatorNotification = new Notification() Notification moderatorNotification = new Notification()
.show("Nächster Moderator: " + electMember(selectMemberItemsNameslist)); .show("Nächster Moderator: " + electMember(checkboxSelectedMembers));
moderatorNotification.setPosition(Notification.Position.BOTTOM_CENTER); moderatorNotification.setPosition(Notification.Position.BOTTOM_CENTER);
} catch(Exception exceptionEvent) { } catch(Exception exceptionEvent) {
Notification errorNotification = new Notification(); Notification errorNotification = new Notification();
@ -50,9 +51,7 @@ public class MainView extends VerticalLayout {
Button closeButton = new Button(new Icon("lumo", "cross")); Button closeButton = new Button(new Icon("lumo", "cross"));
closeButton.addThemeVariants(ButtonVariant.LUMO_TERTIARY_INLINE); closeButton.addThemeVariants(ButtonVariant.LUMO_TERTIARY_INLINE);
closeButton.setAriaLabel("Close"); closeButton.setAriaLabel("Close");
closeButton.addClickListener(closeButtonEvent -> { closeButton.addClickListener(closeButtonEvent -> errorNotification.close());
errorNotification.close();
});
HorizontalLayout layout = new HorizontalLayout(text, closeButton); HorizontalLayout layout = new HorizontalLayout(text, closeButton);
layout.setAlignItems(Alignment.CENTER); layout.setAlignItems(Alignment.CENTER);