Skip to content

refactor!: relocate Renderer API with custom function name - #4479

Merged
tomivirkki merged 5 commits into
masterfrom
refactor/renderer-with-function-name
Jan 5, 2023
Merged

tomivirkki merged 5 commits into
masterfrom
refactor/renderer-with-function-name

Conversation

@tomivirkki

@tomivirkki tomivirkki commented Jan 3, 2023 •

Copy link
Copy Markdown
Member

Description

Follow-up for #4224

Moves the render(Element container, DataKeyMapper<SOURCE> keyMapper, String rendererName) API from LitRenderer to Renderer. Every type of Renderer should accept a custom name for the renderer function.

Example:
Before the change, Grid needed to cast the renderer passed to setItemDetailsRenderer as a LitRenderer to make it plug into the rowDetailsRenderer function on the Web Component. After the change, since the API is defined on the Renderer, casting is no longer necessary and any Renderer can be passed as an item details renderer.

Type of change

  • Refactoring

@tomivirkki
tomivirkki marked this pull request as draft January 3, 2023 15:13
@tomivirkki
tomivirkki marked this pull request as ready for review January 4, 2023 07:24
@tomivirkki tomivirkki changed the title refactor!: relocate an API from LitRenderer to Renderer refactor!: relocate Renderer API with custom function name Jan 4, 2023

@DiegoCardoso DiegoCardoso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GridPro has the class ColumnComponentPathRenderer, which extends ColumnPathRenderer. Should the signature of render be updated, so it will override the same method (render(Element container, DataKeyMapper<SOURCE> keyMapper, String rendererName))?

@tomivirkki

Copy link
Copy Markdown
Member Author

Should the signature of render be updated, so it will override the same method

Probably cleaner that way. Done.

@sonarqubecloud

sonarqubecloud Bot commented Jan 5, 2023

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell E 53 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.0.0.alpha8 and is also targeting the upcoming stable 24.0.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants