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

Transform CategorizationRenderer from class to functional #2120

Merged
merged 14 commits into from
Jan 22, 2024

Conversation

TheZoker
Copy link
Contributor

This should fix #2097

@netlify
Copy link

netlify bot commented Mar 21, 2023

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit a72b1e0
🔍 Latest deploy log https://app.netlify.com/sites/jsonforms-examples/deploys/65ae8f2b601b5c0008181f15
😎 Deploy Preview https://deploy-preview-2120--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@coveralls
Copy link

coveralls commented Mar 21, 2023

Coverage Status

coverage: 84.796% (+0.009%) from 84.787%
when pulling a72b1e0 on TheZoker:categorization-to-functional
into 01b08f0 on eclipsesource:master.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Please add a test case.

I don't think the error is fixed. The current category is still saved in state and is not updated on ui schema changes.

@TheZoker TheZoker force-pushed the categorization-to-functional branch 2 times, most recently from e27f976 to b4397ac Compare July 3, 2023 22:51
@TheZoker TheZoker force-pushed the categorization-to-functional branch from f7eeb7c to a24969c Compare July 18, 2023 09:09
@sdirix
Copy link
Member

sdirix commented Aug 7, 2023

Can you check the failing test cases?

Copy link
Contributor

@lucas-koehler lucas-koehler left a comment

Choose a reason for hiding this comment

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

Hi @TheZoker , thanks for the contribution.
I left some comments inline. Please have a look :) The two main issues atm seem to be:

  • In CategorizationList, and endless loop is created by handing down the same filteredCategories. This causes the out of memory error during tests. More details are in the comment inline
  • The new filteredCategories prop is of the wrong type and does not consider Categorization elements despite them effectively being handed down. Handing them down seems to be correct because otherwise we could no longer handle nested Categorizations. The type and potentially the prop name should be fixed accordingly.

Copy link
Contributor

@lucas-koehler lucas-koehler left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. Looks better now :) I have two remarks inline.
Furthermore, the vanilla example app and some tests for the input control and the categorization renderer are failing.
I have a suspicion regarding the example app and input control: packages/vanilla-renderers/src/util/renderer.ts being in the util folder creates a circular dependency. Thus, renderer.ts should be moved up one folder to be directly contained in the src folder.
Please also have a look at the categorization renderer tests.

@lucas-koehler
Copy link
Contributor

@TheZoker Thanks for the updates :)
The test case Categorization renderer › reset selected category on schema change is still failing. Please have a look.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Looks good! Can you squash this into 1-2 nicely formatted commits?

Copy link
Member

Choose a reason for hiding this comment

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

This file should be called renderers as we typically use plurals.

VerticalLayout,
verticalLayoutTester,
} from './layouts';
import DateTimeCell from './cells/DateTimeCell';
Copy link
Member

Choose a reason for hiding this comment

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

Can you align this import with the others?

@sdirix sdirix merged commit a646e83 into eclipsesource:master Jan 22, 2024
8 checks passed
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.

React Vanilla Categorization Renderer should handle updated schemas
4 participants