Skip to content

Commit

Permalink
Merge pull request #314 from xdev-software/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
AB-xdev authored Feb 14, 2025
2 parents 92abf12 + 2374b38 commit fcd669a
Show file tree
Hide file tree
Showing 18 changed files with 94 additions and 31 deletions.
7 changes: 7 additions & 0 deletions .config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,12 @@
<exclude name="UseStringBufferForStringAppends"/>
</rule>

<rule ref="category/java/performance.xml/TooFewBranchesForSwitch">
<properties>
<!-- If you have one case only please use a if -->
<property name="minimumNumberCaseForASwitch" value="2"/>
</properties>
</rule>

<rule ref="category/java/security.xml"/>
</ruleset>
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: 🐞 Bug
description: Create a bug report for something that is broken
labels: [bug]
type: bug
body:
- type: markdown
attributes:
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: ✨ Feature/Enhancement
description: Suggest a new feature or enhancement
labels: [enhancement]
type: feature
body:
- type: markdown
attributes:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ permissions:
jobs:
link-checker:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

- run: mv .github/.lycheeignore .lycheeignore

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
uses: lycheeverse/lychee-action@v2
with:
fail: false # Don't fail on broken links, create an issue instead

- name: Find already existing issue
id: find-issue
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
matrix:
Expand Down Expand Up @@ -73,6 +74,7 @@ jobs:
checkstyle:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15

strategy:
matrix:
Expand All @@ -95,6 +97,7 @@ jobs:
pmd:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15

strategy:
matrix:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ permissions:
jobs:
check-code:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -48,6 +49,7 @@ jobs:
prepare-release:
runs-on: ubuntu-latest
needs: [check-code]
timeout-minutes: 10
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
Expand Down Expand Up @@ -112,6 +114,7 @@ jobs:
publish-maven:
runs-on: ubuntu-latest
needs: [prepare-release]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -143,6 +146,7 @@ jobs:
publish-pages:
runs-on: ubuntu-latest
needs: [prepare-release]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

Expand All @@ -168,10 +172,12 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
force_orphan: true

after-release:
runs-on: ubuntu-latest
needs: [publish-maven]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
token-check:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
timeout-minutes: 5
outputs:
hasToken: ${{ steps.check-token.outputs.has }}
steps:
Expand All @@ -40,6 +41,7 @@ jobs:
runs-on: ubuntu-latest
needs: token-check
if: ${{ needs.token-check.outputs.hasToken }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ permissions:
jobs:
labels:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
jobs:
publish-maven:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update-from-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ permissions:
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
Expand Down Expand Up @@ -180,6 +181,7 @@ jobs:
needs: [update]
if: needs.update.outputs.create_update_branch_merged_pr == 1
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/saveactions_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.2.4
* Updated dependencies

## 3.2.3
* Added dedicated method for adding steps to WizardPanel to make overriding it easier #269
* Updated dependencies
Expand Down
43 changes: 38 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

# vaadin-grid-exporter

The Vaadin Grid Exporter can convert any Vaadin Grid to a variety of formats.
The Vaadin Grid Exporter can convert nearly any Vaadin Grid to a variety of formats.<br/>
This way you don't have to copy the Grid contents manually or print the whole website with the Grid.

Out of the box supported formats:
* CSV
Expand All @@ -24,6 +25,19 @@ _These formats are exported using [dynamicreports](https://github.com/xdev-softw

It's also easy to extend the Exporter to support your custom format.

![demo](assets/preview.gif)

> [!NOTE]
> <details><summary><b>Disclaimer about the scope of this component</b> (click to expand)</summary>
>
> Although the GridExporter can handle most use-cases, extreme scenarios will likely impact performance, usability and might require some hacks.<br/>
> For such cases custom written exports are recommended e.g. by utilizing JasperReports directly.<br/>
> If you need help implementing these feel free to [contact us](#support) or open a [question](https://github.com/xdev-software/vaadin-grid-exporter/issues/new?assignees=&labels=question&projects=&template=question.yml) if you are not sure that the GridExporter is a good option for your scenario.
>
> </details>
## Usage

Default usage:

```java
Expand All @@ -41,23 +55,42 @@ GridExporter
.open();
```

![demo](assets/preview.gif)

## Installation

[Installation guide for the latest release](https://github.com/xdev-software/vaadin-grid-exporter/releases/latest#Installation)

#### Compatibility with Vaadin
### Comaptibility with ``CSP`` (Content-Security-Policy) and ``X-Frame-Options``

> [!TIP]
> In Spring Security the [default value of ``X-Frame-Options`` is ``DENY``](https://docs.spring.io/spring-security/reference/features/exploits/headers.html#headers-frame-options) which will break the preview if not changed.
To show the preview the [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) or the [X-Frame-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) (deprecated in favor of CSP) must be configured in a way that they allow showing same-site elements.

This can be achieved by:
* setting the CSP to include at least ``frame-ancestors 'self'`` and maybe additionally ``object-src 'self'``
* setting ``X-Frame-Options`` to ``SAMESITE``.<br/>If you use Spring Security without a CSP the easiest way to set this is:
```java
http.headers(c -> c.frameOptions(HeadersConfigurer.FrameOptionsConfig::sameOrigin));
```

> [!NOTE]
> Depending on the browser the settings sometimes have slightly different effects.<br/>
> For example Firefox blocks the preview due to privacy reasons when ``X-Frame-Option=DENY`` and ``Content-Security-Policy=frame-ancestors 'self'; object-src 'self'; ...`` but Chrome does not.

### Compatibility with Vaadin

| Vaadin version | GridExporter version |
| --- | --- |
| Vaadin 24+ (latest) | ``3+`` |
| Vaadin 23 | ``2.x`` |

#### Compatibility with JasperReports
### Compatibility with JasperReports

Starting with version [3.1.0](./CHANGELOG.md#310) JasperReports 7 is required.

### Spring-Boot
* You may have to include ``software/xdev`` inside [``vaadin.allowed-packages``](https://vaadin.com/docs/latest/integrations/spring/configuration#configure-the-scanning-of-packages)

## Run the Demo
* Checkout the repo
* Run ``mvn install && mvn -f vaadin-grid-exporter-demo spring-boot:run``
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.18.2</version>
<version>10.21.2</version>
</dependency>
</dependencies>
<configuration>
Expand All @@ -70,7 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.25.0</version>
<version>3.26.0</version>
<configuration>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
Expand All @@ -82,12 +82,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.6.0</version>
<version>7.10.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.6.0</version>
<version>7.10.0</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -99,7 +99,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
</plugin>
</plugins>
</reporting>
Expand Down
4 changes: 2 additions & 2 deletions vaadin-grid-exporter-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<mainClass>software.xdev.vaadin.Application</mainClass>

<!-- Dependency-Versions -->
<vaadin.version>24.4.13</vaadin.version>
<vaadin.version>24.6.5</vaadin.version>

<org.springframework.boot.version>3.3.4</org.springframework.boot.version>
<org.springframework.boot.version>3.4.2</org.springframework.boot.version>
</properties>

<dependencyManagement>
Expand Down
Loading

0 comments on commit fcd669a

Please sign in to comment.