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

feat: add API to set color options to RichTextEditor #6284

Merged
merged 6 commits into from
Aug 28, 2024

Conversation

web-padawan
Copy link
Member

Description

Related to vaadin/web-components#7392

Type of change

  • Enhancement

Note

Currently getColorOptions() doesn't return the default value of the corresponding web component property.
This could be probably workarounded by adding notify: true and using @Synchronize annotation.

Copy link

sonarcloud bot commented May 13, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@web-padawan web-padawan marked this pull request as ready for review July 19, 2024 11:51
Copy link

sonarcloud bot commented Jul 19, 2024

@@ -268,6 +270,32 @@ private String getDeltaValue() {
return getElement().getProperty("value");
}

/**
* Gets the list of colors in HEX format used by the text color picker and
* background color picker controls of the text editor.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's mention that this doesn't have a default value and returns null by default. Maybe also elaborate that in this case the web component shows a default palette.

Apart from that modifying the list returned by the method doesn't do anything. Let's return an unmodifyable list which would trigger a respective exception when trying to modify it, and mention in the JavaDoc that this returns an umnodifyable list. There are some similar use cases in the repo already (e.g. setting avatar items).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, updated.

@web-padawan web-padawan enabled auto-merge (squash) August 28, 2024 13:21
Copy link

sonarcloud bot commented Aug 28, 2024

@web-padawan web-padawan merged commit 3607801 into main Aug 28, 2024
5 checks passed
@web-padawan web-padawan deleted the feat/rte-color-options branch August 28, 2024 13:32
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha13 and is also targeting the upcoming stable 24.5.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.

4 participants