diff --git a/.gitignore b/.gitignore
index 9f2a078..65ca50d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
build/
.gradle/
+.idea/
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index c02d3e5..9e8a4e1 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,14 @@
-
+
+
+
+
+
+
+
+
@@ -40,6 +47,9 @@
+
+
+ {
"associatedIndex": 1
}
@@ -48,17 +58,32 @@
- {
+ "keyToString": {
+ "ASKED_ADD_EXTERNAL_FILES": "true",
+ "Application.App_build.executor": "Run",
+ "Gradle.Build ModeratorElection.executor": "Run",
+ "Gradle.Load Gradle Dependencies.executor": "Run",
+ "Gradle.ModeratorElection [:MEApplication.main()].executor": "Run",
+ "Gradle.base-starter-spring-gradle [:DemoApplication.main()].executor": "Run",
+ "Gradle.base-starter-spring-gradle [:MEApplication.main()].executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "kotlin-language-version-configured": "true",
+ "last_opened_file_path": "/home/zam/repo/JavaLearning/base-starter-spring-gradle",
+ "settings.editor.selected.configurable": "build.tools"
}
-}]]>
+}
+
+
+
+
+
+
+
+
+
+
+
@@ -70,4 +95,15 @@
+
+
+
\ No newline at end of file
diff --git a/gradlew b/gradlew
index 0adc8e1..1aa94a4 100755
--- a/gradlew
+++ b/gradlew
@@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC3045
+ # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC3045
+ # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
diff --git a/src/main/java/com/ModeratorElection/MEApplication.java b/src/main/java/com/ModeratorElection/MEApplication.java
index 88f92d3..7fe20e2 100644
--- a/src/main/java/com/ModeratorElection/MEApplication.java
+++ b/src/main/java/com/ModeratorElection/MEApplication.java
@@ -5,7 +5,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MEApplication {
-
public static void main(String[] args) {
SpringApplication.run(MEApplication.class, args);
}
diff --git a/src/main/java/com/ModeratorElection/MainView.java b/src/main/java/com/ModeratorElection/MainView.java
index 5ca1fe1..7e86209 100644
--- a/src/main/java/com/ModeratorElection/MainView.java
+++ b/src/main/java/com/ModeratorElection/MainView.java
@@ -14,19 +14,25 @@ import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.router.PageTitle;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
@Route("")
@PageTitle("Moderatorenwahl")
+@Configuration
public class MainView extends VerticalLayout {
- public MainView() {
-
+ public MainView(@Value("${membernames}") String membernames) {
+ String[] memberNamesArray = membernames.split(",");
+ List selectMemberItemsNameslist = Arrays.asList(memberNamesArray);
CheckboxGroup checkboxGroup = new CheckboxGroup<>();
checkboxGroup.setLabel("Team members to elect");
- checkboxGroup.setItems("Micha", "Ansgar", "Clemens", "Mattis", "Erik", "Mirco");
- checkboxGroup.select("Micha", "Ansgar", "Clemens", "Mattis", "Erik", "Mirco");
+ checkboxGroup.setItems(selectMemberItemsNameslist);
+ checkboxGroup.select(selectMemberItemsNameslist);
checkboxGroup.addThemeVariants(CheckboxGroupVariant.LUMO_VERTICAL);
add(checkboxGroup);
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 0275cca..783d827 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -8,3 +8,4 @@ vaadin.launch-browser=true
# For more information https://vaadin.com/docs/latest/integrations/spring/configuration#special-configuration-parameters
vaadin.allowed-packages = com.vaadin,org.vaadin,dev.hilla,com.example.application
spring.jpa.defer-datasource-initialization = true
+membernames=Micha,Ansgar,Clemens,Mattis,Erik,Mirco