Skip to content

Commit e16f7e4

Browse files
authored
Merge pull request #204 from xdev-software/develop
Release v3.0.2
2 parents a31834e + 6919232 commit e16f7e4

23 files changed

+224
-220
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ jobs:
7070
id: version
7171
run: |
7272
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
73-
echo "::set-output name=release::$version"
74-
echo "::set-output name=releasenumber::${version//[!0-9]/}"
73+
echo "release=$version" >> $GITHUB_OUTPUT
74+
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
7575
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
7676

7777
- name: Commit and Push
@@ -170,7 +170,7 @@ jobs:
170170
- name: Get version
171171
id: version
172172
run: |
173-
echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
173+
echo "release=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
174174
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
175175

176176
- name: Upload Release Asset

.github/workflows/sonar.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Sonar
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths-ignore:
8+
- '**.md'
9+
- 'assets/**'
10+
- 'config/**'
11+
pull_request:
12+
types: [opened, synchronize, reopened]
13+
paths-ignore:
14+
- '**.md'
15+
- 'assets/**'
16+
- 'config/**'
17+
18+
env:
19+
SONARCLOUD_ORG: ${{ github.event.organization.login }}
20+
SONARCLOUD_HOST: https://sonarcloud.io
21+
22+
jobs:
23+
sonar:
24+
name: SonarCloud Scan
25+
runs-on: ubuntu-latest
26+
# Dependabot PRs have no access to secrets (SONAR_TOKEN) -> Ignore them
27+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'dependabot/') }}
28+
steps:
29+
- uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
32+
33+
- name: Set up JDK 11
34+
uses: actions/setup-java@v3
35+
with:
36+
distribution: 'temurin'
37+
java-version: 11
38+
39+
- name: Cache SonarCloud packages
40+
uses: actions/cache@v3
41+
with:
42+
path: ~/.sonar/cache
43+
key: ${{ runner.os }}-sonar
44+
restore-keys: ${{ runner.os }}-sonar
45+
46+
- name: Cache Maven packages
47+
uses: actions/cache@v3
48+
with:
49+
path: ~/.m2
50+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
51+
restore-keys: ${{ runner.os }}-m2
52+
53+
- name: Build with Maven
54+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} -Dsonar.organization=${{ env.SONARCLOUD_ORG }} -Dsonar.host.url=${{ env.SONARCLOUD_HOST }}
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
57+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/update-from-template.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
echo "Deleting origin branch that contains the updates - if present"
6161
git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true
6262
63-
echo "::set-output name=abort::1"
63+
echo "abort=1" >> $GITHUB_OUTPUT
6464
exit 0
6565
fi
6666
@@ -76,9 +76,9 @@ jobs:
7676
echo "Getting current branch"
7777
current_branch=$(git branch --show-current)
7878
echo "Current branch is $current_branch"
79-
echo "::set-output name=current_branch::$current_branch"
79+
echo "current_branch=$current_branch" >> $GITHUB_OUTPUT
8080
81-
echo "::set-output name=abort::0"
81+
echo "abort=0" >> $GITHUB_OUTPUT
8282
8383
- name: pull-request
8484
uses: repo-sync/pull-request@v2

.idea/codeStyles/Project.xml

Lines changed: 15 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0.2
2+
* Updated dependencies
3+
* Vaadin 23.3
4+
15
## 3.0.1
26

37
* Updated dependencies
@@ -7,7 +11,7 @@
711

812
⚠️<i>This release contains breaking changes</i>
913

10-
* Adds support for Vaadin 23+, drops support for Vaadin 14 #155
14+
* Adds support for Vaadin 23+, drops support for Vaadin 14 #155<br/>
1115
<i>If you are still using Vaadin 14, use the ``2.x`` versions.</i>
1216
* Requires Java 11+
1317
* Updated dependencies

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/daterangepicker-for-vaadin)
22
[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/vaadin-date-range-picker)](https://mvnrepository.com/artifact/com.xdev-software/vaadin-date-range-picker)
3-
[![Build](https://img.shields.io/github/workflow/status/xdev-software/vaadin-date-range-picker/Check%20Build/develop)](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/checkBuild.yml?query=branch%3Adevelop)
3+
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-date-range-picker/checkBuild.yml?branch=develop)](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/checkBuild.yml?query=branch%3Adevelop)
4+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_vaadin-date-range-picker&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_vaadin-date-range-picker)
45
![Vaadin 23+](https://img.shields.io/badge/Vaadin%20Platform/Flow-23+-00b4f0.svg)
56

67
# vaadin-date-range-picker
@@ -39,10 +40,10 @@ A Vaadin Flow DateRangePicker implementation
3940
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/vaadin-date-range-picker/dependencies/)
4041

4142

42-
## Releasing [![Build](https://img.shields.io/github/workflow/status/xdev-software/vaadin-date-range-picker/Release?label=Release)](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/release.yml)
43+
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-date-range-picker/release.yml?branch=master)](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/release.yml)
4344

4445
Before releasing:
45-
* Consider doing a [test-deployment](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
46+
* Consider doing a [test-deployment](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
4647
* Check the [changelog](CHANGELOG.md)
4748

4849
If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes

SECURITY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/vaadin-addon-template/security/advisories/new).

vaadin-date-range-picker-demo/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3434

3535
<!-- Dependency-Versions -->
36-
<vaadin.version>23.2.2</vaadin.version>
36+
<vaadin.version>23.3.3</vaadin.version>
3737
</properties>
3838

3939

@@ -73,7 +73,7 @@
7373
<plugin>
7474
<groupId>org.eclipse.jetty</groupId>
7575
<artifactId>jetty-maven-plugin</artifactId>
76-
<version>10.0.12</version>
76+
<version>10.0.13</version>
7777
<configuration>
7878
<scan>1</scan>
7979
</configuration>

vaadin-date-range-picker-demo/src/main/java/software/xdev/vaadin/daterange_picker/example/DateRangePickerLocalizedDemo.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,41 +115,35 @@ protected void initUI()
115115

116116
// @formatter:off
117117
// List Must start with Sunday and ends with Saturday... Americans...
118-
private static List<DayOfWeek> daysOfWeekSortedForDatepicker =
118+
private static final List<DayOfWeek> daysOfWeekSortedForDatepicker =
119119
Stream.concat(
120120
Stream.of(DayOfWeek.SUNDAY),
121121
Stream.of(DayOfWeek.values()).filter(dow -> !dow.equals(DayOfWeek.SUNDAY))
122122
)
123123
.collect(Collectors.toList());
124124

125-
private static List<String> weekdays =
125+
private static final List<String> weekdays =
126126
daysOfWeekSortedForDatepicker.stream()
127127
.map(dow -> dow.getDisplayName(TextStyle.FULL, Locale.GERMAN))
128128
.collect(Collectors.toList());
129-
private static List<String> weekdaysshort =
129+
private static final List<String> weekdaysshort =
130130
daysOfWeekSortedForDatepicker.stream()
131131
.map(dow -> dow.getDisplayName(TextStyle.SHORT, Locale.GERMAN))
132132
.collect(Collectors.toList());
133-
private static List<String> months =
133+
private static final List<String> months =
134134
Stream.of(Month.values())
135135
.map(m -> m.getDisplayName(TextStyle.FULL, Locale.GERMAN))
136136
.collect(Collectors.toList());
137137
// @formatter:on
138138

139139
/**
140140
* Standard DatePickerI18N
141-
*
142-
* @return
143141
*/
144142
public static DatePickerI18n getDatePickerI18n()
145143
{
146144
final DatePickerI18n datepicker = new DatePickerI18n();
147145
datepicker.setFirstDayOfWeek(1);
148146

149-
datepicker.setWeek("Woche");
150-
datepicker.setCalendar("Kalender");
151-
152-
datepicker.setClear("Leeren");
153147
datepicker.setCancel("Abbrechen");
154148
datepicker.setToday("Heute");
155149

vaadin-date-range-picker-demo/src/main/java/software/xdev/vaadin/daterange_picker/example/customized/CustomDateRanges.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ private CustomDateRanges()
99
// No Impls
1010
}
1111

12-
// @formatter:off
13-
1412
// No Today-DateRange
1513

1614
public static final CustomDateRange DAY = new CustomDateRange()
@@ -39,8 +37,6 @@ private CustomDateRanges()
3937

4038
// No Free-DateRange
4139

42-
// @formatter:on
43-
4440
public static CustomDateRange[] allValues()
4541
{
4642
return new CustomDateRange[] {

vaadin-date-range-picker/pom.xml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,14 @@
4242
</licenses>
4343

4444
<properties>
45-
<license.licenseName>apache_v2</license.licenseName>
46-
4745
<javaVersion>11</javaVersion>
4846
<maven.compiler.release>${javaVersion}</maven.compiler.release>
4947

5048
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5149
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5250

5351
<!-- Dependency-Versions -->
54-
<vaadin.version>23.2.2</vaadin.version>
52+
<vaadin.version>23.3.3</vaadin.version>
5553
</properties>
5654

5755
<dependencyManagement>
@@ -106,28 +104,35 @@
106104
<groupId>com.vaadin</groupId>
107105
<artifactId>vaadin-core</artifactId>
108106
</dependency>
109-
110107
</dependencies>
111108

112109
<build>
113110
<plugins>
114111
<plugin>
115-
<groupId>org.codehaus.mojo</groupId>
112+
<groupId>com.mycila</groupId>
116113
<artifactId>license-maven-plugin</artifactId>
117-
<version>2.0.0</version>
114+
<version>4.1</version>
115+
<configuration>
116+
<properties>
117+
<email>${project.organization.url}</email>
118+
</properties>
119+
<licenseSets>
120+
<licenseSet>
121+
<header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
122+
<includes>
123+
<include>src/main/java/**</include>
124+
<include>src/test/java/**</include>
125+
</includes>
126+
</licenseSet>
127+
</licenseSets>
128+
</configuration>
118129
<executions>
119130
<execution>
120131
<id>first</id>
121132
<goals>
122-
<goal>update-file-header</goal>
133+
<goal>format</goal>
123134
</goals>
124135
<phase>process-sources</phase>
125-
<configuration>
126-
<roots>
127-
<root>src/main/java</root>
128-
<root>src/test/java</root>
129-
</roots>
130-
</configuration>
131136
</execution>
132137
</executions>
133138
</plugin>

vaadin-date-range-picker/src/main/java/software/xdev/vaadin/daterange_picker/business/AbstractDateRange.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
package software.xdev.vaadin.daterange_picker.business;
2-
3-
/*-
4-
* #%L
5-
* vaadin-date-range-picker
6-
* %%
7-
* Copyright (C) 2020 XDEV Software
8-
* %%
1+
/*
2+
* Copyright © 2020 XDEV Software (https://xdev.software/en)
3+
*
94
* Licensed under the Apache License, Version 2.0 (the "License");
105
* you may not use this file except in compliance with the License.
116
* You may obtain a copy of the License at
12-
*
13-
* http://www.apache.org/licenses/LICENSE-2.0
14-
*
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
1510
* Unless required by applicable law or agreed to in writing, software
1611
* distributed under the License is distributed on an "AS IS" BASIS,
1712
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1813
* See the License for the specific language governing permissions and
1914
* limitations under the License.
20-
* #L%
2115
*/
16+
package software.xdev.vaadin.daterange_picker.business;
2217

2318
import java.time.LocalDate;
2419
import java.time.Period;
@@ -32,6 +27,7 @@
3227
*
3328
* @param <SELF> implementer
3429
*/
30+
@SuppressWarnings("java:S119")
3531
public abstract class AbstractDateRange<SELF extends AbstractDateRange<SELF>> implements DateRange
3632
{
3733
private String key;
@@ -40,7 +36,7 @@ public abstract class AbstractDateRange<SELF extends AbstractDateRange<SELF>> im
4036
private Function<LocalDate, Optional<DateRangeResult>> calcForFunc;
4137
private BiFunction<LocalDate, Integer, Optional<DateRangeResult>> moveFunc = (date, count) ->
4238
{
43-
if(!this.optMovePeriod.isPresent())
39+
if(this.optMovePeriod.isEmpty())
4440
{
4541
return Optional.empty();
4642
}

0 commit comments

Comments
 (0)