Skip to content
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

JNG-5742 eager relations #411

Merged
merged 13 commits into from
Jun 12, 2024
Merged

Conversation

noherczeg
Copy link
Contributor

@noherczeg noherczeg commented Jun 10, 2024

BugJNG-5742 Composite aggregation tables should not trigger REST calls

Copy link

coderabbitai bot commented Jun 10, 2024

Walkthrough

The recent changes to the judo-ui-react project primarily involve refactoring methods, updating import statements, and enhancing components with new properties and functionalities. Key updates include the removal and addition of methods in UiActionsHelper, converting return types in UiImportHelper, and adding dataPath properties across various components. Additionally, significant modifications have been made to date handling, filter serialization, and the handling of component states and props.

Changes

File Path Change Summary
.../UiActionsHelper.java Removed methods, added new methods, and significantly modified existing methods.
.../UiImportHelper.java Converted return types of getTableAPIImports and getLinkAPIImports from String to List<String>.
.../UiPageHelper.java Added import, renamed method, and added new method dialogDataInitialValue.
.../FilterDialog.tsx.hbs Removed date conversion utility functions and updated date value handling directly.
.../EagerTable.tsx.hbs Added FiltersSerializer and updated filter handling.
.../LazyTable.tsx.hbs Added FiltersSerializer and updated filter handling.
.../table-row-actions.tsx.hbs Updated parameter ownerdata to ownerData for consistency.
.../widgets/Tags.tsx.hbs Corrected import statement and updated type of filter.
.../link/index.tsx.hbs Modified imports and added dataPath in destructured props.
.../link/types.ts.hbs Restructured imports and added optional dataPath property to interface.
.../table/index.tsx.hbs Modified imports, added serialization functions, and updated props related to filters.
.../table/types.ts.hbs Imported and defined types, added optional dataPath property to interface.
.../container.tsx.hbs Added dataPath property to destructured props.
.../dialog.tsx.hbs Updated import paths and added dataPath property to component props.
.../page.tsx.hbs Restructured imports and added dataPath property to component props.
.../containers/types.ts.hbs Added optional dataPath property to interfaces.
.../widget-fragments/dateinput.hbs Modified value attribute to reference data.{{ child.attributeType.name }} directly.
.../widget-fragments/datetimeinput.hbs Modified value prop assignment and updated onChange handler type.
.../widget-fragments/link.hbs Added condition to disabled attribute and included dataPath attribute.
.../widget-fragments/table.hbs Added dataPath attribute to component.
.../widget-fragments/timeinput.hbs Modified value prop and updated onChange handler type.
.../custom/custom-element-types.ts.hbs Modified state modifier method to update data with additional meta attributes.
.../dialogs/hooks.tsx.hbs Refactored use{{ pageName page }} hook and introduced new {{ pageName page }}HookProps interface.
.../dialogs/index.tsx.hbs Reordered imports and modified functions and variables related to data handling and validation logic.

Poem

In the land of code, where changes bloom,
A rabbit hops from room to room.
Methods pruned and imports neat,
Filters serialized, a tidy feat.
With dataPath now in the mix,
Our UI's got some nifty tricks!
Hooray for updates, big and small,
CodeRabbit celebrates them all! 🐇✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6ab31c8 and db27dd2.

Files selected for processing (8)
  • judo-ui-react-itest/RelationTest/LICENSE.txt (1 hunks)
  • judo-ui-react-itest/RelationTest/pom.xml (1 hunks)
  • judo-ui-react-itest/RelationTest/relation_test__actor/LICENSE.txt (1 hunks)
  • judo-ui-react-itest/RelationTest/relation_test__actor/pom.xml (1 hunks)
  • judo-ui-react-itest/pom.xml (1 hunks)
  • judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiActionsHelper.java (4 hunks)
  • judo-ui-react/src/main/resources/actor/src/pages/actions/RefreshAction.fragment.hbs (2 hunks)
  • judo-ui-react/src/main/resources/actor/src/utilities/helper.ts.hbs (1 hunks)
Files skipped from review due to trivial changes (1)
  • judo-ui-react-itest/RelationTest/pom.xml
Files skipped from review as they are similar to previous changes (3)
  • judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiActionsHelper.java
  • judo-ui-react/src/main/resources/actor/src/pages/actions/RefreshAction.fragment.hbs
  • judo-ui-react/src/main/resources/actor/src/utilities/helper.ts.hbs
Additional context used
LanguageTool
judo-ui-react-itest/RelationTest/LICENSE.txt

[style] ~47-~47: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...iles of the Program solely in each case in order to link to, bind by name, or subclass the ...


[style] ~114-~114: Consider replacing this phrase with the adverb “reasonably” to avoid wordiness. (IN_A_X_MANNER)
Context: ...d informs Recipients how to obtain it in a reasonable manner on or through a medium customarily us...


[style] ~118-~118: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style. (DIFFERENT_THAN)
Context: ...the Program under a license different than this Agreement, provided that such lice...


[style] ~156-~156: ‘with respect to’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)
Context: ...are may accept certain responsibilities with respect to end users, business partners and the li...


[style] ~171-~171: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...ged intellectual property infringement. In order to qualify, an Indemnified Contributor mus...


[uncategorized] ~234-~234: Possible missing article found. (AI_HYDRA_LEO_MISSING_THE)
Context: ... rights under this Agreement terminate, Recipient agrees to cease use and distribution of...


[style] ~240-~240: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...istribute copies of this Agreement, but in order to avoid inconsistency the Agreement is co...


[uncategorized] ~240-~240: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...f this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may on...


[uncategorized] ~250-~250: Possible missing article found. (AI_HYDRA_LEO_MISSING_THE)
Context: ... version of the Agreement is published, Contributor may elect to Distribute the Program (in...

judo-ui-react-itest/RelationTest/relation_test__actor/LICENSE.txt

[style] ~47-~47: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...iles of the Program solely in each case in order to link to, bind by name, or subclass the ...


[style] ~114-~114: Consider replacing this phrase with the adverb “reasonably” to avoid wordiness. (IN_A_X_MANNER)
Context: ...d informs Recipients how to obtain it in a reasonable manner on or through a medium customarily us...


[style] ~118-~118: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style. (DIFFERENT_THAN)
Context: ...the Program under a license different than this Agreement, provided that such lice...


[style] ~156-~156: ‘with respect to’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)
Context: ...are may accept certain responsibilities with respect to end users, business partners and the li...


[style] ~171-~171: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...ged intellectual property infringement. In order to qualify, an Indemnified Contributor mus...


[style] ~240-~240: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...istribute copies of this Agreement, but in order to avoid inconsistency the Agreement is co...

Additional comments not posted (4)
judo-ui-react-itest/pom.xml (1)

35-35: Added RelationTest module to integration tests.

Ensure this module integrates smoothly with existing test suites and CI pipelines.

judo-ui-react-itest/RelationTest/relation_test__actor/pom.xml (1)

1-193: Configuration review for relation_test__actor.

Ensure that all Maven dependency versions (${revision}, ${judo-meta-ui-version}, etc.) are up-to-date and compatible with the rest of the project.

judo-ui-react-itest/RelationTest/LICENSE.txt (1)

1-277: License review for RelationTest.

The Eclipse Public License v2.0 is appropriately applied. Ensure that all contributions to this module comply with this license.

Tools
LanguageTool

[style] ~47-~47: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...iles of the Program solely in each case in order to link to, bind by name, or subclass the ...


[style] ~114-~114: Consider replacing this phrase with the adverb “reasonably” to avoid wordiness. (IN_A_X_MANNER)
Context: ...d informs Recipients how to obtain it in a reasonable manner on or through a medium customarily us...


[style] ~118-~118: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style. (DIFFERENT_THAN)
Context: ...the Program under a license different than this Agreement, provided that such lice...


[style] ~156-~156: ‘with respect to’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)
Context: ...are may accept certain responsibilities with respect to end users, business partners and the li...


[style] ~171-~171: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...ged intellectual property infringement. In order to qualify, an Indemnified Contributor mus...


[uncategorized] ~234-~234: Possible missing article found. (AI_HYDRA_LEO_MISSING_THE)
Context: ... rights under this Agreement terminate, Recipient agrees to cease use and distribution of...


[style] ~240-~240: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...istribute copies of this Agreement, but in order to avoid inconsistency the Agreement is co...


[uncategorized] ~240-~240: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...f this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may on...


[uncategorized] ~250-~250: Possible missing article found. (AI_HYDRA_LEO_MISSING_THE)
Context: ... version of the Agreement is published, Contributor may elect to Distribute the Program (in...

judo-ui-react-itest/RelationTest/relation_test__actor/LICENSE.txt (1)

1-277: License review for relation_test__actor.

The Eclipse Public License v2.0 is correctly applied. Ensure that all contributions to this module comply with this license.

Tools
LanguageTool

[style] ~47-~47: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...iles of the Program solely in each case in order to link to, bind by name, or subclass the ...


[style] ~114-~114: Consider replacing this phrase with the adverb “reasonably” to avoid wordiness. (IN_A_X_MANNER)
Context: ...d informs Recipients how to obtain it in a reasonable manner on or through a medium customarily us...


[style] ~118-~118: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style. (DIFFERENT_THAN)
Context: ...the Program under a license different than this Agreement, provided that such lice...


[style] ~156-~156: ‘with respect to’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)
Context: ...are may accept certain responsibilities with respect to end users, business partners and the li...


[style] ~171-~171: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...ged intellectual property infringement. In order to qualify, an Indemnified Contributor mus...


[style] ~240-~240: Consider a shorter alternative to avoid wordiness. (IN_ORDER_TO_PREMIUM)
Context: ...istribute copies of this Agreement, but in order to avoid inconsistency the Agreement is co...


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

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: 16

Outside diff range and nitpick comments (10)
judo-ui-react/src/main/resources/actor/src/pages/actions/OpenSetSelectorAction.fragment.hbs (1)

3-18: Review the conditional logic for setting ownerData and alreadySelected.

Ensure that the conditional logic accurately reflects the intended behavior for setting ownerData and alreadySelected, especially in complex scenarios.

judo-ui-react/src/main/resources/actor/src/pages/actions/OpenAddSelectorAction.fragment.hbs (1)

Line range hint 2-27: Optimize the handling of ownerData and alreadySelected to ensure efficiency and correctness.

Consider simplifying the conditional logic for setting ownerData and alreadySelected to improve readability and reduce potential errors.

judo-ui-react/src/main/resources/actor/src/containers/components/link/types.ts.hbs (1)

26-26: Ensure the optional dataPath prop is well-documented to clarify its usage.

Consider adding a comment explaining the purpose and usage of dataPath in the interface to help other developers understand its role in the component.

judo-ui-react/src/main/resources/actor/src/containers/widget-fragments/datetimeinput.hbs (1)

53-56: Ensure proper handling of nullable Date values.

The onChange handler now accepts Date | null, which is a good practice for handling nullable date inputs. However, ensure that the storeDiff function and any other downstream logic properly handle null values to prevent runtime errors.

judo-ui-react/src/main/resources/actor/src/dialogs/hooks.tsx.hbs (1)

Line range hint 21-62: Ensure comprehensive error handling in the custom hook.

The custom hook implementation lacks explicit error handling. Consider adding try-catch blocks around asynchronous operations to manage exceptions effectively and provide a fallback mechanism.

+ try {
+   // Asynchronous operation
+ } catch (error) {
+   console.error("An error occurred:", error);
+   // Handle error appropriately
+ }

This change will help in robustly managing errors that might occur during the execution of asynchronous operations within the hook.

judo-ui-react/src/main/resources/actor/src/containers/components/table/types.ts.hbs (1)

64-64: Add documentation for the dataPath property to clarify its usage.

It's beneficial to include comments explaining the purpose and usage of newly introduced properties, especially when they are related to data handling in a UI context.

judo-ui-react/src/main/resources/actor/src/fragments/relation/column.fragment.hbs (1)

Line range hint 1-1: Ensure consistent formatting and comment usage throughout the file.

While the logic and functionality changes are sound, maintaining consistent formatting and proper commenting can improve readability and maintainability.

judo-ui-react/src/main/resources/actor/src/containers/container.tsx.hbs (1)

43-43: Document the new properties in the component's propTypes or TypeScript interface.

Adding documentation for new properties like dataPath and related flags will enhance clarity and maintainability, especially for new developers or when revisiting the code later.

judo-ui-react/src/main/resources/actor/src/utilities/error-handling.ts.hbs (1)

Line range hint 49-120: Consider improving error handling by adding more specific error messages for common HTTP errors.

It might be beneficial to handle more HTTP status codes explicitly to provide users with more detailed feedback on what went wrong.

judo-ui-react/src/main/resources/actor/src/containers/types.ts.hbs (1)

67-67: Ensure consistency in optional properties across interfaces.

The dataPath property is optional in some interfaces but not in others. Consider making it consistently optional across all relevant interfaces to avoid potential runtime errors.

Also applies to: 91-91, 131-131

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: 2

Outside diff range and nitpick comments (2)
judo-ui-react/src/main/resources/actor/src/pages/actions/OpenCreateFormAction.fragment.hbs (2)

3-3: Consider adding a comment explaining the purpose of itemIndex.

Adding a brief comment explaining why itemIndex is calculated here could improve code readability.


13-13: Clarify the purpose of maskRequest and ensure it's correctly implemented.

A comment explaining the purpose of maskRequest and how it's used could enhance understanding for future maintainers.

@noherczeg noherczeg merged commit 38c293d into develop Jun 12, 2024
3 checks passed
@noherczeg noherczeg deleted the feature/JNG-5742-eager-relations branch June 12, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants