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

XRENDERING-736: Macros info, success, warning and error are only distinguished by colors #296

Merged
merged 82 commits into from
Aug 8, 2024

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Mar 27, 2024

Jira URL

https://jira.xwiki.org/browse/XRENDERING-736

Changes

Description

  • Added the appropriate changes to the block structure of the message macro

Clarifications

Last attempt at merging a fix for this issue ended up in a lot of CI errors on xwiki-platform. Therefor we reverted changes from #286 . This PR adds them back. Almost no changes were made on the rendering side since then. Most of the changes were done on the platform side.

Screenshots & Video

See #286, no change to the visuals since the end of this PR.

Executed Tests

Successfully passed mvn clean install -f xwiki-rendering-macros/xwiki-rendering-macro-message -Pquality,integration-tests,docker;mvn clean install -f xwiki-rendering-macros/xwiki-rendering-macro-box -Pquality,integration-tests,docker; mvn clean install -f xwiki-rendering-api -Pdocker,integration-tests,quality

Expected merging strategy

Sereza7 and others added 30 commits November 8, 2023 15:59
…uished by colors

* Added the appropriate changes to the block structure of the message macro

Note: Those icons use the Silk icon theme.
…uished by colors

* Added a container for the box title

Note: These changes go beyond the context of message macros.
…uished by colors

* Added back the metadata block
…stinguished by colors


* Updated list instantiation

Co-authored-by: Manuel Leduc <manuel.leduc@xwiki.com>
…uished by colors

* Added an interface and a component to handle icon providing.

Note: the default behavior is the same within xwiki-rendering, but there, xwiki-platform can override the component to allow usage of icon themes for transformations or generic icon use.
…uished by colors

* Properly use the interface to instantiate the icons
* Added a method to the interface to make sure the transformation icons work properly whatever the provider used
* Fixed the POM
…uished by colors

* Added a wrapping block for easier styling
…uished by colors

* Fixed the rule for wrapping children

Note: Previous conditions were overcomplicated and did not generalize well (issue when using an image without a title)
…uished by colors

* Fixed import order
* Added usntable and override annotations
…uished by colors


* Fixed codestyle

Co-authored-by: Michael Hamann <michael@content-space.de>
…inguished by colors

* Moved the classes from `xwiki-rendering-transformation-icon`
* Created an IconBlock class to contain the icons
…inguished by colors

* Updated the logic for the IconTransformation parser to fit the new composite type
…inguished by colors

* Fixed an outdated POM
* Cleaned up code
…inguished by colors

* Moved around the IconBlock class
…inguished by colors

* Replaced the IconBlock class with a parameter
…inguished by colors

* Moved the parameter from the IconProvider interface to the private usage of IconTransformation
…inguished by colors

* Moved the IconProvider classes to util instead of transformation
…inguished by colors

* Use a custom block to wrap icons in the icon transformation instead of
  using a parameter that would be present in the output.
…inguished by colors

* Reverted all changes on the IconTransformation

Note: adding them in a comment for XRENDERING-738 so that we can use them later if needed
…inguished by colors


* Updated `since` fields

Co-authored-by: Michael Hamann <michael@content-space.de>
…inguished by colors


* Updated `since` fields

Co-authored-by: Michael Hamann <michael@content-space.de>
…inguished by colors


* Improved javadoc

Co-authored-by: Michael Hamann <michael@content-space.de>
…inguished by colors

* Rewriting of a selector using a more straightforward syntax.

Note: It has been built with standard tests successfully and behaves the same as before for manual tests on a local distribution.
…inguished by colors

* Updated `since` annotations
@Sereza7
Copy link
Contributor Author

Sereza7 commented Jun 21, 2024

Addressed all comments, and updated the version numbers.

@Sereza7 Sereza7 marked this pull request as ready for review June 21, 2024 11:37
…inguished by colors

* Updated the translation of pretty name to avoid overridding macros
@Sereza7 Sereza7 marked this pull request as draft August 7, 2024 08:19
…inguished by colors

* Updated the translation of pretty name to avoid overridding macros
…inguished by colors

* Updated the translation of pretty name to avoid overridding macros
@Sereza7 Sereza7 marked this pull request as ready for review August 7, 2024 13:24
@Sereza7 Sereza7 marked this pull request as draft August 7, 2024 13:25
…inguished by colors

* Moved around the translations closer to where they are used.
…inguished by colors

* Renamed the translation keys to be more in line with the current model
…inguished by colors

* Renamed the translation keys to be more in line with the current model
@Sereza7 Sereza7 marked this pull request as ready for review August 7, 2024 13:40
@Sereza7
Copy link
Contributor Author

Sereza7 commented Aug 7, 2024

Ready for reviews.
I went back to test manually the feature and everything seems to be working properly.
No build with the changes failed.

@Sereza7
Copy link
Contributor Author

Sereza7 commented Aug 7, 2024

Need to address #296 (comment)

…inguished by colors

* Updated the parameter for the iconAlternative getter
*/
String getIconPrettyName(String macroId)
{
return PRETTYNAME_MAPPING.get(macroId);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure it really worth having such a mapping. What about StringUrils.capitalize(macroId) ? Feels good enough for a fallback we never really use in practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with this solution first, because it's usually bad for accessibility to use programmatic names as descriptions. Here it does not really make a difference so might as well use the macro Id directly 👍
Addressed in 75253ad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 75253ad 👍

…inguished by colors

* Updated API doc to make clear that provided icons are always inline
* Fixed a regression introduced with the icon alternative on inline macros.
…inguished by colors

* Simplified the fallback for the icon name provider
@Sereza7
Copy link
Contributor Author

Sereza7 commented Aug 8, 2024

Here is a screenshot of a set of messages I used for manual testing:

image

@tmortagne tmortagne merged commit 3a0a1de into xwiki:master Aug 8, 2024
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.

4 participants