From afb0f46545af68bebf6a1394ccabc54d7ab970d5 Mon Sep 17 00:00:00 2001 From: Mirco Date: Fri, 14 Jun 2024 12:11:10 +0200 Subject: [PATCH] Fix in logic, further documentation in dev_notes --- doc/dev_notes.md | 7 +++++-- src/main/java/com/ModeratorElection/MainView.java | 7 +++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/dev_notes.md b/doc/dev_notes.md index 7c334b7..2357adf 100644 --- a/doc/dev_notes.md +++ b/doc/dev_notes.md @@ -2,9 +2,12 @@ ``` HowTo BUILD jar? -local: ./gradle build + +Failed within local: ./gradle build 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 ``` ``` diff --git a/src/main/java/com/ModeratorElection/MainView.java b/src/main/java/com/ModeratorElection/MainView.java index c290e46..f946c33 100644 --- a/src/main/java/com/ModeratorElection/MainView.java +++ b/src/main/java/com/ModeratorElection/MainView.java @@ -38,8 +38,9 @@ public class MainView extends VerticalLayout { Button electNow = new Button("Elect!", buttonClickEvent -> { try { + ArrayList checkboxSelectedMembers = new ArrayList(checkboxGroup.getSelectedItems()); Notification moderatorNotification = new Notification() - .show("Nächster Moderator: " + electMember(selectMemberItemsNameslist)); + .show("Nächster Moderator: " + electMember(checkboxSelectedMembers)); moderatorNotification.setPosition(Notification.Position.BOTTOM_CENTER); } catch(Exception exceptionEvent) { Notification errorNotification = new Notification(); @@ -50,9 +51,7 @@ public class MainView extends VerticalLayout { Button closeButton = new Button(new Icon("lumo", "cross")); closeButton.addThemeVariants(ButtonVariant.LUMO_TERTIARY_INLINE); closeButton.setAriaLabel("Close"); - closeButton.addClickListener(closeButtonEvent -> { - errorNotification.close(); - }); + closeButton.addClickListener(closeButtonEvent -> errorNotification.close()); HorizontalLayout layout = new HorizontalLayout(text, closeButton); layout.setAlignItems(Alignment.CENTER);