Generated project
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
|||||||
|
/target/
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
.settings
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
|
||||||
|
*.iml
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# The following files are generated/updated by vaadin-maven-plugin
|
||||||
|
node_modules/
|
||||||
|
src/main/frontend/generated/
|
||||||
|
vite.generated.ts
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"Vaadin": {
|
||||||
|
"type": "http",
|
||||||
|
"url": "https://mcp.vaadin.com/docs"
|
||||||
|
},
|
||||||
|
"playwright": {
|
||||||
|
"command": "npx",
|
||||||
|
"args": [
|
||||||
|
"@playwright/mcp@0.0.73"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
wrapperVersion=3.3.2
|
||||||
|
distributionType=only-script
|
||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
FROM ghcr.io/jqlang/jq:latest AS jq-stage
|
||||||
|
|
||||||
|
FROM eclipse-temurin:25-jdk AS build
|
||||||
|
COPY --from=jq-stage /jq /usr/bin/jq
|
||||||
|
# Test that jq works after copying
|
||||||
|
RUN jq --version
|
||||||
|
|
||||||
|
ENV HOME=/app
|
||||||
|
RUN mkdir -p $HOME
|
||||||
|
WORKDIR $HOME
|
||||||
|
COPY . $HOME
|
||||||
|
|
||||||
|
# If you have a Vaadin Pro key, pass it as a secret with id "proKey":
|
||||||
|
#
|
||||||
|
# $ docker build --secret id=proKey,src=$HOME/.vaadin/proKey .
|
||||||
|
#
|
||||||
|
# If you have a Vaadin Offline key, pass it as a secret with id "offlineKey":
|
||||||
|
#
|
||||||
|
# $ docker build --secret id=offlineKey,src=$HOME/.vaadin/offlineKey .
|
||||||
|
|
||||||
|
RUN --mount=type=cache,target=/root/.m2 \
|
||||||
|
--mount=type=secret,id=proKey \
|
||||||
|
--mount=type=secret,id=offlineKey \
|
||||||
|
sh -c 'PRO_KEY=$(jq -r ".proKey // empty" /run/secrets/proKey 2>/dev/null || echo "") && \
|
||||||
|
OFFLINE_KEY=$(cat /run/secrets/offlineKey 2>/dev/null || echo "") && \
|
||||||
|
./mvnw clean package -DskipTests -Dvaadin.proKey=${PRO_KEY} -Dvaadin.offlineKey=${OFFLINE_KEY}'
|
||||||
|
|
||||||
|
FROM eclipse-temurin:25-jre-alpine
|
||||||
|
COPY --from=build /app/target/*.jar app.jar
|
||||||
|
ENTRYPOINT ["java", "-jar", "/app.jar", "--spring.profiles.active=prod"]
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to http://unlicense.org
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
# My Application
|
||||||
|
|
||||||
|
A Spring Boot + Vaadin project. Build your UI in pure Java — no HTML, no JavaScript.
|
||||||
|
|
||||||
|
> **New to Vaadin?** The 5-minute [Quickstart](https://vaadin.com/quickstart) walks you from here to your first running app, a live code change, and an AI-assisted edit with Copilot.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Fastest start — no plugin needed
|
||||||
|
|
||||||
|
From the project folder:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./mvnw spring-boot:run # Windows: mvnw.cmd spring-boot:run
|
||||||
|
```
|
||||||
|
|
||||||
|
No system Maven required — the wrapper is included. Then open **http://localhost:8080**.
|
||||||
|
|
||||||
|
The first start takes ~30 seconds while Maven downloads dependencies. You'll get a runnable **Task List** app: a data grid (Description / Due Date / Creation Date), a Create button, and an empty-state message. When you see that, you're running.
|
||||||
|
|
||||||
|
> **Port 8080 already in use?** Stop the other process, or set `server.port=8081` in `src/main/resources/application.properties` and open that port instead.
|
||||||
|
>
|
||||||
|
> **To stop the app:** press `Ctrl+C` in the terminal (or the red Stop button if you launched from your IDE).
|
||||||
|
|
||||||
|
## Optional upgrade — instant hotswap
|
||||||
|
|
||||||
|
Running with `spring-boot:run` works, but Java code changes need a restart. For **live reload** — edit Java, see it in the browser without restarting — install the **Vaadin plugin** and start the app through it:
|
||||||
|
|
||||||
|
- **IntelliJ IDEA:** install *Vaadin* from the JetBrains Marketplace → **Debug using Hotswap Agent** (dropdown next to Run). *Just installed it? Let IntelliJ finish indexing, or restart it, if the menu item isn't there yet.*
|
||||||
|
- **VS Code:** install the *Vaadin* extension → **Vaadin: Debug using Hotswap Agent** from the command palette.
|
||||||
|
- **Eclipse:** install the *Vaadin* plugin → right-click the project → **Run As → Vaadin Application**.
|
||||||
|
|
||||||
|
This is what makes the edit-and-see-it loop feel instant — and it's required for the AI edits in [Vaadin Copilot](https://vaadin.com/docs/latest/tools/copilot).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Day 2: make your task list interactive (~10 min)
|
||||||
|
|
||||||
|
Your app lists tasks. Let's make a row do something when you click it.
|
||||||
|
|
||||||
|
**1. Add a click listener (by hand).** In `src/main/java/com/example/examplefeature/ui/TaskListView.java`, add this after the `taskGrid.addColumn(...)` block:
|
||||||
|
|
||||||
|
```java
|
||||||
|
taskGrid.addItemClickListener(event ->
|
||||||
|
Notification.show("Due: " + Optional.ofNullable(event.getItem().getDueDate())
|
||||||
|
.map(LocalDate::toString)
|
||||||
|
.orElse("no due date")));
|
||||||
|
```
|
||||||
|
|
||||||
|
Add the import: `import com.vaadin.flow.component.notification.Notification;`
|
||||||
|
|
||||||
|
Save and click a task — a notification shows its due date. That's a server-side event handler, in pure Java.
|
||||||
|
|
||||||
|
**2. Let Copilot finish it.** Open Copilot (bottom-right toolbar → **Edit mode**), click the AI assistant, and try:
|
||||||
|
|
||||||
|
> When a task row is clicked, open a dialog showing its description, due date, and creation date, with a Close button.
|
||||||
|
|
||||||
|
Copilot writes the dialog into `TaskListView.java` for you. Open the file — your new code is right there.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ask your AI assistant about Vaadin (optional)
|
||||||
|
|
||||||
|
If you use Claude Code, Cursor, or another AI coding assistant, connect it to the **Vaadin MCP server** so it answers against real Vaadin docs and the exact API of your installed version — instead of guessing from outdated training data.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# One-time setup — see https://vaadin.com/docs/latest/building-apps/mcp
|
||||||
|
```
|
||||||
|
|
||||||
|
A `.mcp.json` is included (commented out by default). Uncomment it, or run the setup command above, to activate.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Build for production
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./mvnw package
|
||||||
|
java -jar target/*.jar
|
||||||
|
```
|
||||||
|
|
||||||
|
## Learn more
|
||||||
|
|
||||||
|
- [Vaadin Quickstart](https://vaadin.com/quickstart) — the 5-minute getting-started path
|
||||||
|
- [Components](https://vaadin.com/docs/latest/components) — 50+ UI components, all callable from Java
|
||||||
|
- [Vaadin Copilot](https://vaadin.com/docs/latest/tools/copilot) — visual + AI editing in the browser
|
||||||
|
- [Full documentation](https://vaadin.com/docs)
|
||||||
@@ -0,0 +1,259 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Apache Maven Wrapper startup batch script, version 3.3.2
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
||||||
|
# MVNW_REPOURL - repo url base for downloading maven distribution
|
||||||
|
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||||
|
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
set -euf
|
||||||
|
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
||||||
|
|
||||||
|
# OS specific support.
|
||||||
|
native_path() { printf %s\\n "$1"; }
|
||||||
|
case "$(uname)" in
|
||||||
|
CYGWIN* | MINGW*)
|
||||||
|
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
||||||
|
native_path() { cygpath --path --windows "$1"; }
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# set JAVACMD and JAVACCMD
|
||||||
|
set_java_home() {
|
||||||
|
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
||||||
|
if [ -n "${JAVA_HOME-}" ]; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
JAVACCMD="$JAVA_HOME/bin/javac"
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
||||||
|
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
||||||
|
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="$(
|
||||||
|
'set' +e
|
||||||
|
'unset' -f command 2>/dev/null
|
||||||
|
'command' -v java
|
||||||
|
)" || :
|
||||||
|
JAVACCMD="$(
|
||||||
|
'set' +e
|
||||||
|
'unset' -f command 2>/dev/null
|
||||||
|
'command' -v javac
|
||||||
|
)" || :
|
||||||
|
|
||||||
|
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
||||||
|
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# hash string like Java String::hashCode
|
||||||
|
hash_string() {
|
||||||
|
str="${1:-}" h=0
|
||||||
|
while [ -n "$str" ]; do
|
||||||
|
char="${str%"${str#?}"}"
|
||||||
|
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
||||||
|
str="${str#?}"
|
||||||
|
done
|
||||||
|
printf %x\\n $h
|
||||||
|
}
|
||||||
|
|
||||||
|
verbose() { :; }
|
||||||
|
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
||||||
|
|
||||||
|
die() {
|
||||||
|
printf %s\\n "$1" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
trim() {
|
||||||
|
# MWRAPPER-139:
|
||||||
|
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
||||||
|
# Needed for removing poorly interpreted newline sequences when running in more
|
||||||
|
# exotic environments such as mingw bash on Windows.
|
||||||
|
printf "%s" "${1}" | tr -d '[:space:]'
|
||||||
|
}
|
||||||
|
|
||||||
|
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
||||||
|
while IFS="=" read -r key value; do
|
||||||
|
case "${key-}" in
|
||||||
|
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
||||||
|
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
||||||
|
esac
|
||||||
|
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
|
||||||
|
case "${distributionUrl##*/}" in
|
||||||
|
maven-mvnd-*bin.*)
|
||||||
|
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
||||||
|
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
||||||
|
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
||||||
|
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
||||||
|
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
||||||
|
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
||||||
|
*)
|
||||||
|
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
||||||
|
distributionPlatform=linux-amd64
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
||||||
|
;;
|
||||||
|
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
||||||
|
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||||
|
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||||
|
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
||||||
|
distributionUrlName="${distributionUrl##*/}"
|
||||||
|
distributionUrlNameMain="${distributionUrlName%.*}"
|
||||||
|
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
||||||
|
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
||||||
|
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
||||||
|
|
||||||
|
exec_maven() {
|
||||||
|
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
||||||
|
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -d "$MAVEN_HOME" ]; then
|
||||||
|
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||||
|
exec_maven "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "${distributionUrl-}" in
|
||||||
|
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
||||||
|
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# prepare tmp dir
|
||||||
|
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
||||||
|
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
||||||
|
trap clean HUP INT TERM EXIT
|
||||||
|
else
|
||||||
|
die "cannot create temp dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p -- "${MAVEN_HOME%/*}"
|
||||||
|
|
||||||
|
# Download and Install Apache Maven
|
||||||
|
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||||
|
verbose "Downloading from: $distributionUrl"
|
||||||
|
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||||
|
|
||||||
|
# select .zip or .tar.gz
|
||||||
|
if ! command -v unzip >/dev/null; then
|
||||||
|
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
||||||
|
distributionUrlName="${distributionUrl##*/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# verbose opt
|
||||||
|
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
||||||
|
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
||||||
|
|
||||||
|
# normalize http auth
|
||||||
|
case "${MVNW_PASSWORD:+has-password}" in
|
||||||
|
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||||
|
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
||||||
|
verbose "Found wget ... using wget"
|
||||||
|
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
||||||
|
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
||||||
|
verbose "Found curl ... using curl"
|
||||||
|
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
||||||
|
elif set_java_home; then
|
||||||
|
verbose "Falling back to use Java to download"
|
||||||
|
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
||||||
|
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||||
|
cat >"$javaSource" <<-END
|
||||||
|
public class Downloader extends java.net.Authenticator
|
||||||
|
{
|
||||||
|
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
||||||
|
{
|
||||||
|
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
||||||
|
}
|
||||||
|
public static void main( String[] args ) throws Exception
|
||||||
|
{
|
||||||
|
setDefault( new Downloader() );
|
||||||
|
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END
|
||||||
|
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
||||||
|
verbose " - Compiling Downloader.java ..."
|
||||||
|
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
||||||
|
verbose " - Running Downloader.java ..."
|
||||||
|
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||||
|
if [ -n "${distributionSha256Sum-}" ]; then
|
||||||
|
distributionSha256Result=false
|
||||||
|
if [ "$MVN_CMD" = mvnd.sh ]; then
|
||||||
|
echo "Checksum validation is not supported for maven-mvnd." >&2
|
||||||
|
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||||
|
exit 1
|
||||||
|
elif command -v sha256sum >/dev/null; then
|
||||||
|
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
|
||||||
|
distributionSha256Result=true
|
||||||
|
fi
|
||||||
|
elif command -v shasum >/dev/null; then
|
||||||
|
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
||||||
|
distributionSha256Result=true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
||||||
|
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ $distributionSha256Result = false ]; then
|
||||||
|
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
||||||
|
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# unzip and move
|
||||||
|
if command -v unzip >/dev/null; then
|
||||||
|
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
||||||
|
else
|
||||||
|
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
||||||
|
fi
|
||||||
|
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
|
||||||
|
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
||||||
|
|
||||||
|
clean || :
|
||||||
|
exec_maven "$@"
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
<# : batch portion
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
|
@REM distributed with this work for additional information
|
||||||
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
|
@REM "License"); you may not use this file except in compliance
|
||||||
|
@REM with the License. You may obtain a copy of the License at
|
||||||
|
@REM
|
||||||
|
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@REM
|
||||||
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
|
@REM software distributed under the License is distributed on an
|
||||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@REM KIND, either express or implied. See the License for the
|
||||||
|
@REM specific language governing permissions and limitations
|
||||||
|
@REM under the License.
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Apache Maven Wrapper startup batch script, version 3.3.2
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
||||||
|
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||||
|
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
||||||
|
@SET __MVNW_CMD__=
|
||||||
|
@SET __MVNW_ERROR__=
|
||||||
|
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
||||||
|
@SET PSModulePath=
|
||||||
|
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
||||||
|
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
||||||
|
)
|
||||||
|
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
||||||
|
@SET __MVNW_PSMODULEP_SAVE=
|
||||||
|
@SET __MVNW_ARG0_NAME__=
|
||||||
|
@SET MVNW_USERNAME=
|
||||||
|
@SET MVNW_PASSWORD=
|
||||||
|
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
|
||||||
|
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
||||||
|
@GOTO :EOF
|
||||||
|
: end batch / begin powershell #>
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
if ($env:MVNW_VERBOSE -eq "true") {
|
||||||
|
$VerbosePreference = "Continue"
|
||||||
|
}
|
||||||
|
|
||||||
|
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
||||||
|
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
||||||
|
if (!$distributionUrl) {
|
||||||
|
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
}
|
||||||
|
|
||||||
|
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
||||||
|
"maven-mvnd-*" {
|
||||||
|
$USE_MVND = $true
|
||||||
|
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
||||||
|
$MVN_CMD = "mvnd.cmd"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
$USE_MVND = $false
|
||||||
|
$MVN_CMD = $script -replace '^mvnw','mvn'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||||
|
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||||
|
if ($env:MVNW_REPOURL) {
|
||||||
|
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
||||||
|
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
|
||||||
|
}
|
||||||
|
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
||||||
|
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
||||||
|
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
|
||||||
|
if ($env:MAVEN_USER_HOME) {
|
||||||
|
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
|
||||||
|
}
|
||||||
|
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
||||||
|
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
||||||
|
|
||||||
|
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
||||||
|
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||||
|
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
||||||
|
exit $?
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
||||||
|
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
||||||
|
}
|
||||||
|
|
||||||
|
# prepare tmp dir
|
||||||
|
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
||||||
|
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
||||||
|
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
||||||
|
trap {
|
||||||
|
if ($TMP_DOWNLOAD_DIR.Exists) {
|
||||||
|
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||||
|
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
||||||
|
|
||||||
|
# Download and Install Apache Maven
|
||||||
|
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||||
|
Write-Verbose "Downloading from: $distributionUrl"
|
||||||
|
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||||
|
|
||||||
|
$webclient = New-Object System.Net.WebClient
|
||||||
|
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
||||||
|
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
||||||
|
}
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
|
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
||||||
|
|
||||||
|
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||||
|
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
||||||
|
if ($distributionSha256Sum) {
|
||||||
|
if ($USE_MVND) {
|
||||||
|
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
||||||
|
}
|
||||||
|
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
||||||
|
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
||||||
|
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# unzip and move
|
||||||
|
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
||||||
|
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
|
||||||
|
try {
|
||||||
|
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
||||||
|
} catch {
|
||||||
|
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
||||||
|
Write-Error "fail to move MAVEN_HOME"
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||||
|
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<!-- Project from https://start.vaadin.com/878a8ff2-9a6b-4c2e-9d2c-9f981f454e39 -->
|
||||||
|
<groupId>com.example</groupId>
|
||||||
|
<artifactId>app</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>25</java.version>
|
||||||
|
<vaadin.version>25.2.5</vaadin.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>4.1.0</version>
|
||||||
|
<relativePath/>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<artifactId>vaadin-bom</artifactId>
|
||||||
|
<version>${vaadin.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<!-- Replace artifactId with vaadin-core to use only free components -->
|
||||||
|
<artifactId>vaadin</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<artifactId>vaadin-dev</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<artifactId>vaadin-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<artifactId>hilla-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<artifactId>browserless-test-spring</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<defaultGoal>spring-boot:run</defaultGoal>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<artifactId>vaadin-maven-plugin</artifactId>
|
||||||
|
<version>${vaadin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>build-frontend</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>central</id>
|
||||||
|
<url>https://repo.maven.apache.org/maven2</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>vaadin-directory</id>
|
||||||
|
<url>https://maven.vaadin.com/vaadin-addons</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<pluginRepositories>
|
||||||
|
<!-- Central first to avoid unnecessary lookups from maven.vaadin.com for all artifacts -->
|
||||||
|
<pluginRepository>
|
||||||
|
<id>central</id>
|
||||||
|
<url>https://repo.maven.apache.org/maven2</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.example;
|
||||||
|
|
||||||
|
import com.vaadin.flow.theme.aura.Aura;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||||
|
import com.vaadin.flow.component.page.AppShellConfigurator;
|
||||||
|
import com.vaadin.flow.component.page.Push;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@StyleSheet(Aura.STYLESHEET)
|
||||||
|
@StyleSheet("styles.css") // Your custom styles
|
||||||
|
@Push
|
||||||
|
public class Application implements AppShellConfigurator {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(Application.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.example.base.ui;
|
||||||
|
|
||||||
|
import com.vaadin.flow.component.Component;
|
||||||
|
import com.vaadin.flow.component.Unit;
|
||||||
|
import com.vaadin.flow.component.applayout.AppLayout;
|
||||||
|
import com.vaadin.flow.component.avatar.Avatar;
|
||||||
|
import com.vaadin.flow.component.avatar.AvatarVariant;
|
||||||
|
import com.vaadin.flow.component.html.Span;
|
||||||
|
import com.vaadin.flow.component.icon.Icon;
|
||||||
|
import com.vaadin.flow.component.icon.SvgIcon;
|
||||||
|
import com.vaadin.flow.component.orderedlayout.*;
|
||||||
|
import com.vaadin.flow.component.sidenav.SideNav;
|
||||||
|
import com.vaadin.flow.component.sidenav.SideNavItem;
|
||||||
|
import com.vaadin.flow.router.Layout;
|
||||||
|
import com.vaadin.flow.server.menu.MenuConfiguration;
|
||||||
|
import com.vaadin.flow.server.menu.MenuEntry;
|
||||||
|
|
||||||
|
@Layout
|
||||||
|
public final class MainLayout extends AppLayout {
|
||||||
|
|
||||||
|
MainLayout() {
|
||||||
|
setPrimarySection(Section.DRAWER);
|
||||||
|
addToDrawer(createApplicationHeader(), createApplicationDrawer(), createApplicationFooter());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Component createApplicationHeader() {
|
||||||
|
// TODO Replace with real application logo and name
|
||||||
|
var appLogo = new Avatar("My Application");
|
||||||
|
appLogo.addClassName("app-logo");
|
||||||
|
appLogo.addThemeVariants(AvatarVariant.AURA_FILLED, AvatarVariant.XSMALL);
|
||||||
|
|
||||||
|
var appName = new Span("My Application");
|
||||||
|
appName.addClassName("app-name");
|
||||||
|
|
||||||
|
var header = new HorizontalLayout(appLogo, appName);
|
||||||
|
header.setAlignItems(FlexComponent.Alignment.CENTER);
|
||||||
|
header.setPadding(true);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Component createApplicationDrawer() {
|
||||||
|
var scroller = new Scroller(createSideNav());
|
||||||
|
scroller.addThemeVariants(ScrollerVariant.OVERFLOW_INDICATORS);
|
||||||
|
return scroller;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Component createApplicationFooter() {
|
||||||
|
var footer = new VerticalLayout(new Span("Made with ❤️ with Vaadin"));
|
||||||
|
footer.setAlignItems(FlexComponent.Alignment.CENTER);
|
||||||
|
footer.addClassName("app-footer");
|
||||||
|
return footer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SideNav createSideNav() {
|
||||||
|
var nav = new SideNav();
|
||||||
|
nav.setMinWidth(200, Unit.PIXELS);
|
||||||
|
MenuConfiguration.getMenuEntries().forEach(entry -> nav.addItem(createSideNavItem(entry)));
|
||||||
|
return nav;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SideNavItem createSideNavItem(MenuEntry menuEntry) {
|
||||||
|
if (menuEntry.icon() != null) {
|
||||||
|
Component icon = null;
|
||||||
|
if (menuEntry.icon().contains(".svg")) {
|
||||||
|
icon = new SvgIcon(menuEntry.icon());
|
||||||
|
} else {
|
||||||
|
icon = new Icon(menuEntry.icon());
|
||||||
|
}
|
||||||
|
return new SideNavItem(menuEntry.title(), menuEntry.menuClass(), icon);
|
||||||
|
} else {
|
||||||
|
return new SideNavItem(menuEntry.title(), menuEntry.menuClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.example.base.ui;
|
||||||
|
|
||||||
|
import com.vaadin.flow.component.Composite;
|
||||||
|
import com.vaadin.flow.component.applayout.DrawerToggle;
|
||||||
|
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||||
|
import com.vaadin.flow.component.html.H1;
|
||||||
|
import com.vaadin.flow.component.orderedlayout.FlexComponent;
|
||||||
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||||
|
|
||||||
|
@StyleSheet("view-title.css")
|
||||||
|
public class ViewTitle extends Composite<HorizontalLayout> {
|
||||||
|
|
||||||
|
public ViewTitle(String title) {
|
||||||
|
addClassName("view-title");
|
||||||
|
var h = new H1(title);
|
||||||
|
getContent().add(new DrawerToggle(), h);
|
||||||
|
getContent().setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
@NullMarked
|
||||||
|
package com.example.base.ui;
|
||||||
|
|
||||||
|
import org.jspecify.annotations.NullMarked;
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.example.examplefeature;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import org.jspecify.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "task")
|
||||||
|
public class Task {
|
||||||
|
|
||||||
|
public static final int DESCRIPTION_MAX_LENGTH = 300;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE)
|
||||||
|
@Column(name = "task_id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "description", nullable = false, length = DESCRIPTION_MAX_LENGTH)
|
||||||
|
private String description = "";
|
||||||
|
|
||||||
|
@Column(name = "creation_date", nullable = false)
|
||||||
|
private Instant creationDate;
|
||||||
|
|
||||||
|
@Column(name = "due_date")
|
||||||
|
@Nullable
|
||||||
|
private LocalDate dueDate;
|
||||||
|
|
||||||
|
protected Task() { // To keep Hibernate happy
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task(String description, Instant creationDate) {
|
||||||
|
setDescription(description);
|
||||||
|
this.creationDate = creationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
if (description.length() > DESCRIPTION_MAX_LENGTH) {
|
||||||
|
throw new IllegalArgumentException("Description length exceeds " + DESCRIPTION_MAX_LENGTH);
|
||||||
|
}
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getCreationDate() {
|
||||||
|
return creationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public @Nullable LocalDate getDueDate() {
|
||||||
|
return dueDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDueDate(@Nullable LocalDate dueDate) {
|
||||||
|
this.dueDate = dueDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj == null || !getClass().isAssignableFrom(obj.getClass())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Task other = (Task) obj;
|
||||||
|
return getId() != null && getId().equals(other.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
// Hashcode should never change during the lifetime of an object. Because of
|
||||||
|
// this we can't use getId() to calculate the hashcode. Unless you have sets
|
||||||
|
// with lots of entities in them, returning the same hashcode should not be a
|
||||||
|
// problem.
|
||||||
|
return getClass().hashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.example.examplefeature;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Slice;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
||||||
|
interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificationExecutor<Task> {
|
||||||
|
|
||||||
|
// If you don't need a total row count, Slice is better than Page as it only performs a select query.
|
||||||
|
// Page performs both a select and a count query.
|
||||||
|
Slice<Task> findAllBy(Pageable pageable);
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.example.examplefeature;
|
||||||
|
|
||||||
|
import org.jspecify.annotations.Nullable;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TaskService {
|
||||||
|
|
||||||
|
private final TaskRepository taskRepository;
|
||||||
|
|
||||||
|
TaskService(TaskRepository taskRepository) {
|
||||||
|
this.taskRepository = taskRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void createTask(String description, @Nullable LocalDate dueDate) {
|
||||||
|
var task = new Task(description, Instant.now());
|
||||||
|
task.setDueDate(dueDate);
|
||||||
|
taskRepository.saveAndFlush(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public List<Task> list(Pageable pageable) {
|
||||||
|
return taskRepository.findAllBy(pageable).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
@NullMarked
|
||||||
|
package com.example.examplefeature;
|
||||||
|
// TODO Remove this package once you have added real features
|
||||||
|
|
||||||
|
import org.jspecify.annotations.NullMarked;
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.example.examplefeature.ui;
|
||||||
|
|
||||||
|
import com.example.base.ui.ViewTitle;
|
||||||
|
import com.example.examplefeature.Task;
|
||||||
|
import com.example.examplefeature.TaskService;
|
||||||
|
import com.vaadin.flow.component.button.Button;
|
||||||
|
import com.vaadin.flow.component.button.ButtonVariant;
|
||||||
|
import com.vaadin.flow.component.datepicker.DatePicker;
|
||||||
|
import com.vaadin.flow.component.grid.Grid;
|
||||||
|
import com.vaadin.flow.component.notification.Notification;
|
||||||
|
import com.vaadin.flow.component.notification.NotificationVariant;
|
||||||
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||||
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||||
|
import com.vaadin.flow.component.textfield.TextField;
|
||||||
|
import com.vaadin.flow.router.Menu;
|
||||||
|
import com.vaadin.flow.router.PageTitle;
|
||||||
|
import com.vaadin.flow.router.Route;
|
||||||
|
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.format.FormatStyle;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static com.vaadin.flow.spring.data.VaadinSpringDataHelpers.toSpringPageRequest;
|
||||||
|
|
||||||
|
@Route(value = "")
|
||||||
|
@PageTitle("Task List")
|
||||||
|
@Menu(order = 0, icon = "icons/clipboard-check.svg", title = "Task List")
|
||||||
|
class TaskListView extends VerticalLayout {
|
||||||
|
|
||||||
|
private final TaskService taskService;
|
||||||
|
|
||||||
|
final TextField description;
|
||||||
|
final DatePicker dueDate;
|
||||||
|
final Button createBtn;
|
||||||
|
final Grid<Task> taskGrid;
|
||||||
|
|
||||||
|
TaskListView(TaskService taskService) {
|
||||||
|
this.taskService = taskService;
|
||||||
|
|
||||||
|
description = new TextField();
|
||||||
|
description.setPlaceholder("What do you want to do?");
|
||||||
|
description.setAriaLabel("Task description");
|
||||||
|
description.setMaxLength(Task.DESCRIPTION_MAX_LENGTH);
|
||||||
|
description.setMinWidth("15em");
|
||||||
|
|
||||||
|
dueDate = new DatePicker();
|
||||||
|
dueDate.setPlaceholder("Due date");
|
||||||
|
dueDate.setAriaLabel("Due date");
|
||||||
|
|
||||||
|
createBtn = new Button("Create", event -> createTask());
|
||||||
|
createBtn.addThemeVariants(ButtonVariant.PRIMARY);
|
||||||
|
|
||||||
|
var toolbar = new HorizontalLayout();
|
||||||
|
toolbar.add(new ViewTitle("Task List"), description, dueDate, createBtn);
|
||||||
|
toolbar.setFlexGrow(1, description, dueDate);
|
||||||
|
toolbar.setWrap(true);
|
||||||
|
toolbar.setWidthFull();
|
||||||
|
|
||||||
|
var dateTimeFormatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(getLocale())
|
||||||
|
.withZone(ZoneId.systemDefault());
|
||||||
|
var dateFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM).withLocale(getLocale());
|
||||||
|
|
||||||
|
taskGrid = new Grid<>();
|
||||||
|
taskGrid.setItems(query -> taskService.list(toSpringPageRequest(query)).stream());
|
||||||
|
taskGrid.addColumn(Task::getDescription).setHeader("Description");
|
||||||
|
taskGrid.addColumn(task -> Optional.ofNullable(task.getDueDate()).map(dateFormatter::format).orElse("Never"))
|
||||||
|
.setHeader("Due Date");
|
||||||
|
taskGrid.addColumn(task -> dateTimeFormatter.format(task.getCreationDate())).setHeader("Creation Date");
|
||||||
|
taskGrid.setEmptyStateText("You have no tasks to complete");
|
||||||
|
taskGrid.setSizeFull();
|
||||||
|
|
||||||
|
setSizeFull();
|
||||||
|
add(toolbar, taskGrid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createTask() {
|
||||||
|
if (description.getValue().isBlank()) {
|
||||||
|
description.setInvalid(true);
|
||||||
|
description.setErrorMessage("Description is required");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
taskService.createTask(description.getValue(), dueDate.getValue());
|
||||||
|
taskGrid.getDataProvider().refreshAll();
|
||||||
|
description.clear();
|
||||||
|
dueDate.clear();
|
||||||
|
Notification.show("Task added", 3000, Notification.Position.BOTTOM_END)
|
||||||
|
.addThemeVariants(NotificationVariant.SUCCESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="m9 14 2 2 4-4"/></svg>
|
||||||
|
After Width: | Height: | Size: 327 B |
@@ -0,0 +1,29 @@
|
|||||||
|
/* Add your styles here */
|
||||||
|
|
||||||
|
.app-logo {
|
||||||
|
border-radius: min(40%, var(--vaadin-radius-m));
|
||||||
|
margin-inline-start: var(--vaadin-padding-inline-container);
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-name {
|
||||||
|
font-weight: var(--aura-font-weight-semibold);
|
||||||
|
font-size: var(--aura-font-size-l);
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-footer {
|
||||||
|
color: var(--vaadin-text-color-secondary);
|
||||||
|
font-size: var(--aura-font-size-s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: This is only for demo purposes. You can delete it. */
|
||||||
|
vaadin-side-nav:has(vaadin-side-nav-item:only-child)::after {
|
||||||
|
display: block;
|
||||||
|
content: "More menu items will appear here when you add more views.";
|
||||||
|
font-size: var(--aura-font-size-s);
|
||||||
|
color: var(--vaadin-text-color-secondary);
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 1em;
|
||||||
|
max-width: 14em;
|
||||||
|
min-width: 100%;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
.view-title h1 {
|
||||||
|
font-size: var(--aura-font-size-l);
|
||||||
|
font-weight: var(--aura-font-weight-semibold);
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-title vaadin-drawer-toggle {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
server.port=${PORT:8080}
|
||||||
|
logging.level.org.atmosphere=warn
|
||||||
|
|
||||||
|
# Launch the default browser when starting the application in development mode
|
||||||
|
vaadin.launch-browser=true
|
||||||
|
|
||||||
|
# To improve the performance during development.
|
||||||
|
# For more information https://vaadin.com/docs/latest/flow/integrations/spring/configuration#special-configuration-parameters
|
||||||
|
vaadin.allowed-packages=com.vaadin,org.vaadin,com.flowingcode,com.example
|
||||||
|
|
||||||
|
# Let Hibernate update the schema automatically or create it if it does not exist.
|
||||||
|
#
|
||||||
|
# DO NOT DO THIS IN PRODUCTION!
|
||||||
|
#
|
||||||
|
# Instead, use Flyway or another controlled way of managing your database schema.
|
||||||
|
# See https://vaadin.com/docs/latest/building-apps/forms-data/add-flyway for instructions.
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.example.examplefeature;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||||
|
|
||||||
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
|
||||||
|
@Transactional
|
||||||
|
class TaskServiceTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TaskService taskService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void tasks_are_stored_in_the_database_with_the_current_timestamp() {
|
||||||
|
var now = Instant.now();
|
||||||
|
var desc = "Do this";
|
||||||
|
var due = LocalDate.of(2025, 2, 7);
|
||||||
|
taskService.createTask(desc, due);
|
||||||
|
|
||||||
|
var task = taskService.list(PageRequest.ofSize(1)).get(0);
|
||||||
|
assertThat(task.getDescription().equals(desc));
|
||||||
|
assertThat(task.getDueDate().equals(due));
|
||||||
|
assertThat(task.getCreationDate().isAfter(now));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void tasks_are_validated_before_they_are_stored() {
|
||||||
|
assertThatThrownBy(() -> taskService.createTask("X".repeat(Task.DESCRIPTION_MAX_LENGTH + 1), null))
|
||||||
|
.isInstanceOf(IllegalArgumentException.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.example.examplefeature.ui;
|
||||||
|
|
||||||
|
import com.vaadin.browserless.SpringBrowserlessTest;
|
||||||
|
import com.vaadin.flow.component.notification.Notification;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
|
||||||
|
@Transactional
|
||||||
|
class TaskListViewTest extends SpringBrowserlessTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void empty_grid_shows_no_tasks() {
|
||||||
|
var view = navigate(TaskListView.class);
|
||||||
|
assertThat(test(view.taskGrid).size()).isZero();
|
||||||
|
assertThat(view.taskGrid.getEmptyStateText()).isEqualTo("You have no tasks to complete");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void create_task_with_empty_description_does_nothing() {
|
||||||
|
var view = navigate(TaskListView.class);
|
||||||
|
|
||||||
|
test(view.createBtn).click();
|
||||||
|
|
||||||
|
assertThat(test(view.taskGrid).size()).isZero();
|
||||||
|
assertThat(view.description.isInvalid()).isTrue();
|
||||||
|
assertThat($(Notification.class).exists()).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void create_task_without_due_date() {
|
||||||
|
var view = navigate(TaskListView.class);
|
||||||
|
|
||||||
|
test(view.description).setValue("Buy groceries");
|
||||||
|
test(view.createBtn).click();
|
||||||
|
|
||||||
|
assertThat(test(view.taskGrid).size()).isEqualTo(1);
|
||||||
|
assertThat(test(view.taskGrid).getCellText(0, 0)).isEqualTo("Buy groceries");
|
||||||
|
assertThat(test(view.taskGrid).getCellText(0, 1)).isEqualTo("Never");
|
||||||
|
|
||||||
|
assertThat(test(view.taskGrid).getCellText(0, 2)).isNotEmpty();
|
||||||
|
|
||||||
|
assertThat(view.description.getValue()).isEmpty();
|
||||||
|
assertThat(view.dueDate.getValue()).isNull();
|
||||||
|
|
||||||
|
var notification = $(Notification.class).single();
|
||||||
|
assertThat(test(notification).getText()).contains("Task added");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void create_task_with_due_date() {
|
||||||
|
var view = navigate(TaskListView.class);
|
||||||
|
|
||||||
|
test(view.description).setValue("File taxes");
|
||||||
|
test(view.dueDate).setValue(LocalDate.of(2026, 3, 15));
|
||||||
|
test(view.createBtn).click();
|
||||||
|
|
||||||
|
assertThat(test(view.taskGrid).size()).isEqualTo(1);
|
||||||
|
assertThat(test(view.taskGrid).getCellText(0, 0)).isEqualTo("File taxes");
|
||||||
|
assertThat(test(view.taskGrid).getCellText(0, 1)).isNotEqualTo("Never");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void create_multiple_tasks() {
|
||||||
|
var view = navigate(TaskListView.class);
|
||||||
|
|
||||||
|
test(view.description).setValue("First task");
|
||||||
|
test(view.createBtn).click();
|
||||||
|
|
||||||
|
test(view.description).setValue("Second task");
|
||||||
|
test(view.dueDate).setValue(LocalDate.of(2026, 6, 1));
|
||||||
|
test(view.createBtn).click();
|
||||||
|
|
||||||
|
assertThat(test(view.taskGrid).size()).isEqualTo(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user