-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
XWIKI-21452: Macros info, success, warning and error are only distinguished by colors #3023
Conversation
…uished by colors * Updated style to take into account the addition of an icon in xwiki-rendering
…uished by colors * Updated style to differentiate the title from the content of the box
…uished by colors * Updated style to align text in the box with a grid. Note: we don't know the exact height we want for this box (depends on content), so we can't use a column flexbox.
…uished by colors * Cleaned up style
…uished by colors * Updated padding and icon position for a cleaner presentation
…uished by colors * Fixed width of the boxes fitted to content and icon alignement
…uished by colors * Fixed presentation for inplace editing
…uished by colors * Implementing the IconProvider interface to override xwiki-rendering behavior TODO: use a similar code to the icon nacro to provide the raw content of the block
…uished by colors * Implemented an alternative to isntantiate icons in rendering * Updated the POM * Fixed the components.txt file Note: I decided to not factorize witht the code in the DisplayIconMacro because we don't need anything related to a parameter.
…uished by colors * Updated style to better match the previous proposal
…uished by colors * Fixed codestyle and formatting
…uished by colors * Added mapping for the transform icons to fontAwesome
…uished by colors * Reverted approximate mapping for the transform icons to fontAwesome
…uished by colors * Increased component priority
…uished by colors * Started reflecting changes from rendering
…uished by colors * Updated position of the IconProvider to match the changes in rendering * Updated the return type of the iconProvider
* Updated the XWikiIconProvider class to fit the changes on `platform`.
…uished by colors * Updated the position of the XWikiIconProvider to reflect the move in `xwiki-rendering`. Now in the `util` package instead of being in the `transformation` package.
…uished by colors * Updated the `since` value
…uished by colors * in the inline version, reduced the white space between the border and the icon
…uished by colors * Added a text alternative to the icons provided for boxes * Added default translations for the box icons. * Updated release numbers for master branch Note: This does not have any visual effect, but facilitates things for screen readers.
…uished by colors * Changed margins and gaps between icon and borders * Removed borders from the message macro * Removed box shadow from the message macro * Added a visually distinguished left border to each type of message
…uished by colors * Factorized some style * Added a space on the line `border: none`
…uished by colors * Fixed various test checks to fit the new message style.
…uished by colors * Passes `mvn clean install -f xwiki-platform-core/xwiki-platform-invitation/xwiki-platform-invitation-test -Pquality,docker,integration-tests`
…uished by colors * Fixed some tests
…uished by colors * Fixed style for inline boxes
…uished by colors * Updated version number
@Inject | ||
private IconRenderer iconRenderer; | ||
@Inject | ||
private ContextualLocalizationManager l10n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't seems to be using this component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 4a8cecb 👍
Thanks
@Singleton | ||
public class XWikiWarningMessageMacro extends WarningMessageMacro | ||
{ | ||
private static final String ICON_PRETTY_NAME_KEY = "rendering.macro.message.icon.alternative.warning"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you decided to make this pretty name concept related to the macro and not to the icon chosen for the macro (i.e. two macro might have the same and icon show a different pretty name), right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We decided in https://forum.xwiki.org/t/accessibility-html-codestyle-icons-along-text-alternatives/13378 that icons should always be used next to a text alternative. This is why I pushed for having the pretty names independent of the icons and to not provide them by the icon manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I just wanted to be sure it was the intended goal given the handling of the translations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, because the alternative of the icon is context dependant. Eg. what is used as a success
icon in the SuccessMessageMacro could also be a done
icon in another context.
The minimum is not really a "translation service" (and certainly not a public one). All you need is an internal macro icon pretty name provider which is overwritten on platform. It's a pity to introduce an icon provider to avoid overwriting those macros to finally overwrite all those macros for the icon pretty name… |
…uished by colors * Removed useless component from the XWikiIconProvider.java
…uished by colors * Updated the translation of pretty name to avoid overridding macros
…uished by colors * Updated the translation of pretty name to avoid overridding macros
…uished by colors * Updated the translation of pretty name to avoid overridding macros
…uished by colors * Moved around the translations closer to where they are used.
…uished by colors * Renamed the translation keys to be more in line with the current model
Ready for reviews. |
…uished by colors * Updated the parameter for the iconAlternative getter
…uished by colors * Updated API doc to make clear that provided icons are always inline
@@ -0,0 +1,48 @@ | |||
# --------------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this file be removed ? All those translations are already provided by xwiki-rendering-macro-message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 2df9eec 👍
…uished by colors * Updated API doc to make clear that provided icons are always inline
*/ | ||
@Component(roles = MacroIconPrettyNameProvider.class) | ||
@Singleton | ||
public class MacroIconPrettyNameProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not override anything (it just conflict with the rendering class at classloader lever, so one or the other is randomly used), it should have extended the xwiki-rendering MacroIconPrettyNameProvider
(and be named XWikiMacroIconPrettyNameProvider
to be more clear).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in eb30e70 👍 Thank you
xwiki-platform-distribution/xwiki-platform-distribution-war-dependencies/pom.xml
Show resolved
Hide resolved
xwiki-platform-distribution/xwiki-platform-distribution-war-dependencies/pom.xml
Show resolved
Hide resolved
Sorry, I missed some mistakes before merging (but would have been nice to build and test all that after the refactoring). |
@Sereza7 Shouldn't the following be changed too:
There might be other places like these. IMO they should be changed to use the EDIT: Note that strangely Line 123 in bd419a5
|
Also, why is Line 963 in beaeb18
|
It seems to be the same general structure, it's just that we don't show "Information:" (like we have "Error:" and "Warning:") in the case of an information message. It was already like this before. |
Doesn't seem very consistent to me and probably something to fix (possibly with a boolean parameter in the macro to decide to show the title or not). |
@Sereza7 and all: There's a discussion to have which is about the alternate text to use for icons. We used to use "Information" before and it's now been changed to "Info". I personally find "Information" to be better ("Info" can mean several things, see https://www.thefreedictionary.com/words-that-start-with-info ;)). Also we've said that we should try to avoid shortcuts in XWiki and be explicit in sentences. I know that we're now using the Macro name and that the macro is called For example I've had to fix the Invitation tests, see: 3050a0e WDYT? |
Actually, we don't really use the Macro name in XWiki. The macro name is just the fallback in xwiki-rendering, but on platform side (so in an XWiki instance), a translation is used, and the translation text is "Information".
That test module is most probably missing |
@tmortagne interesting, thanks for the info.
Yes indeed (I see it's been added to the XS WAR: xwiki-platform/xwiki-platform-distribution/xwiki-platform-distribution-war-dependencies/pom.xml Lines 301 to 306 in 191e7fe
WARBuilder for the functional tests.
Not easy to decide but I think if we push it to the extreme, a minimal war should not have message macros (it could have So FTM I'll add the dep to |
hmm actually I wonder if we shouldn't just change our deps on xwiki-platform/xwiki-platform-distribution/xwiki-platform-distribution-war-dependencies/pom.xml Lines 301 to 306 in 191e7fe
For EDIT: For now I'll do what said above and add the dep to |
Jira URL
https://jira.xwiki.org/browse/XWIKI-21452
Changes
Description
Clarifications
Most of these changes were initially merged with #2590, but after a passage through CI we noticed a lot of tests broke because of the changes. So we reverted it and I updated the failing tests to fit the new architecture of the message macros.
Screenshots & Video
Executed Tests
First, I built all changes with :
and
Then I checked all places that failed on the CI when we merged #2590:
platform-panels-test-docker checked on 18/03 17:00
platform-administration-test-docker checked on 25/03
platform-invitation-test-docker checked on 18/03 14:50
platform-livedata-test-docker checked on 18/03 14:40
platform-flamingo-skin-test-docker checked on 21/03 15:00
platform-realtime-wysiwyg-test-docker checked on 18/03 14:10
platform-extension-test-tests checked on 18/03 morning
platform-repository-test-tests checked on 18/03 morning
platform-rendering-xwiki checked on 18/03 13h40
I tested all of those with a command similar to:
All of those needed a slight change to the tests themselves. Most of the changes only needed to take into account the new layout inside the blocks, which ended up adding a few newlines in the computed text.
Administration tests were a bit complex to fix, because some cases used the
#info
velocity template while others used the{{info}}
XWiki macro. In the end I added a formatting step when retrieving the content of the block that changed.Expected merging strategy