Skip to content

fix: add json-digger dependency #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 3, 2025
Merged

fix: add json-digger dependency #84

merged 4 commits into from
Apr 3, 2025

Conversation

javier-godoy
Copy link
Member

@javier-godoy javier-godoy commented Mar 26, 2025

I had to upgrade Vaadin 24 to 24.3 because 23.2 failed with

SyntaxError: Unexpected token (3246:11334) in J:/fc/addons/OrgChartAddon/node_modules/json-digger/dist/json-digger.js

Summary by CodeRabbit

  • Chores

    • Upgraded our UI framework to the latest stable release (Vaadin version 24.3.20) to enhance overall performance and reliability.
  • New Features

    • Integrated a third-party JSON processing utility (json-digger version 2.0.2) that is now available globally.
    • Enhanced the organizational chart component, delivering more robust data handling and a dynamic user experience.
    • These improvements lay the groundwork for smoother interactions and future scalability.

@javier-godoy javier-godoy requested a review from paodb March 26, 2025 16:51
Copy link

coderabbitai bot commented Mar 26, 2025

Walkthrough

This pull request introduces several modifications, including an update to the Vaadin version in the v24 profile of pom.xml, changing it from 24.2.6 to 24.3.20. A new NPM dependency, json-digger version 2.0.2, has been added to the OrgChart class via an annotation. Additionally, changes in the frontend JavaScript include importing the JSONDigger library and assigning it to the global window object. Most changes are related to version updates and dependency additions, with no alterations to existing logic.

Changes

Files Change Summary
pom.xml Updated the <vaadin.version> in the v24 profile from 24.2.6 to 24.3.20. Added a new <webApp> element with <resourceBases> in the jetty-maven-plugin configuration.
src/.../OrgChart.java
src/.../fc-orgchart.js
Added json-digger integration: In OrgChart.java, introduced @NpmPackage(value = "json-digger", version = "2.0.2"); in fc-orgchart.js, imported JSONDigger and assigned it to window.JSONDigger.
src/.../OrgChartItem.java
src/.../OrgChartState.java
src/.../ChartConstants.java
src/.../ChartDirectionEnum.java
src/.../TemplateLiteralRewriter.java
src/.../DemoLayout.java
src/.../BottomTopDemo.java
src/.../DemoView.java
src/.../DragAndDropExportDemo.java
src/.../HybridEnhancedChartDemo.java
src/.../OrgchartDemoView.java
src/.../ImageInTitleDemo.java
src/.../demo-styles.css
src/.../hybrid-demo-styles.css
Updated copyright year from 2023 to 2025 and made minor formatting adjustments in the comment headers across multiple files.

Possibly related PRs

  • Fix Javadocs warnings #83: The changes in the main PR are related to the OrgChart.java file, specifically the addition of a new annotation, while the retrieved PR modifies the same file by updating Javadoc comments and parameter names, indicating a direct connection in terms of code modifications.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@paodb
Copy link
Member

paodb commented Mar 31, 2025

I did some testing as the fix includes things that I've already tried without success so I was intrigued.

  • Vaadin 14 version, kept getting the same error as I reported in the issue. Did several clean ups with same outcome. So I did a new clone and tried running the add-on in VSCode intead of Eclipse and at that point it worked okay. (I guess there's something wrong with my Eclipse version/configuration maybe)
  • Vaadin 24 version. When running the add-on with the Vaadin 24 profile, styling breaks. I did a new clone just in case but I'm getting these errors:
    image
    Even though it looks broken, the drag and drop works.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
pom.xml (1)

263-268: Clarify the Duplicate Resource Bases Configuration

The new <webApp> element (lines 263–268) defines the same resource bases as those already present in <webAppConfig>. Please verify whether both configurations are required for the current Jetty setup with Vaadin 24. If they are both needed (for example, if one is used for a specific deployment mode), consider adding an inline comment to clarify the rationale. Otherwise, removing the duplication could simplify the configuration.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0c4a43 and 0d7e384.

📒 Files selected for processing (18)
  • pom.xml (2 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java (2 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChartItem.java (1 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/client/OrgChartState.java (1 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/client/constants/ChartConstants.java (1 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/client/enums/ChartDirectionEnum.java (1 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/extra/TemplateLiteralRewriter.java (1 hunks)
  • src/main/resources/META-INF/frontend/fc-orgchart.js (3 hunks)
  • src/main/resources/META-INF/resources/frontend/fc-orgchart-styles.css (2 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java (1 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/BottomTopDemo.java (1 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/DemoView.java (1 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/DragAndDropExportDemo.java (1 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridEnhancedChartDemo.java (1 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/ImageInTitleDemo.java (1 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/OrgchartDemoView.java (1 hunks)
  • src/test/resources/META-INF/resources/frontend/styles/orgchart/demo-styles.css (2 hunks)
  • src/test/resources/META-INF/resources/frontend/styles/orgchart/hybrid-demo-styles.css (3 hunks)
✅ Files skipped from review due to trivial changes (15)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChartItem.java
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/ImageInTitleDemo.java
  • src/test/resources/META-INF/resources/frontend/styles/orgchart/hybrid-demo-styles.css
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/DragAndDropExportDemo.java
  • src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/client/constants/ChartConstants.java
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/client/OrgChartState.java
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/BottomTopDemo.java
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/client/enums/ChartDirectionEnum.java
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/HybridEnhancedChartDemo.java
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/DemoView.java
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/extra/TemplateLiteralRewriter.java
  • src/main/resources/META-INF/resources/frontend/fc-orgchart-styles.css
  • src/test/java/com/flowingcode/vaadin/addons/orgchart/OrgchartDemoView.java
  • src/test/resources/META-INF/resources/frontend/styles/orgchart/demo-styles.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java
  • src/main/resources/META-INF/frontend/fc-orgchart.js
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-vaadin14
🔇 Additional comments (1)
pom.xml (1)

532-539: Update Vaadin Version in the v24 Profile

The v24 profile now overrides the global Vaadin version by setting <vaadin.version>24.3.20</vaadin.version> (line 534) along with updating the compiler source/target to 17 and the Jetty version. This aligns with the upgrade objectives. Just ensure that this override does not conflict with other profiles or the default settings declared earlier in the <properties> section.

@javier-godoy
Copy link
Member Author

Vaadin 24 version. When running the add-on with the Vaadin 24 profile, styling breaks. I did a new clone just in case but I'm getting these errors:

I updated the jetty plugin configuration.

Copy link
Member

@paodb paodb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I tested Vaadin 14 & Vaadin 24 versions and now drag and drop is working as expected.

@paodb paodb merged commit 17efb9b into master Apr 3, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Pending release in Flowing Code Addons Apr 3, 2025
@paodb paodb deleted the fix-79 branch April 3, 2025 13:09
@javier-godoy javier-godoy moved this from Pending release to Done in Flowing Code Addons Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants