-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
e893a59
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 ce0d296
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 a2864ea
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 9cb73e8
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 8cd50de
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 9b0ef83
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 83571f1
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 31eb18a
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 ab5e55f
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 ce3be8c
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 7fa4083
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 e47c7f8
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 980a360
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 b9393db
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 131db3c
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 5840570
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 2df7497
XWIKI-21009: LiveData alternative to drag controls
Sereza7 521e428
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 504cd67
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 e3a0914
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 fd80d5b
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 6c0b9e2
XWIKI-21452: Macros info, success, warning and error are only disting…
tkrieck c8944cc
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 255e082
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 0b7dc8a
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 6598952
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 448e564
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 9be5a4f
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 5a75166
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 f4a1f06
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 963e697
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 cf5cee1
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 3ba8e1d
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 03aba25
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 82b894d
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 90e15c5
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 a61c518
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 cc763ee
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 13c360b
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 287f092
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 1ff7bb4
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 b99cef0
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 ba7838d
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 9e77593
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 40015cd
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 67a10e1
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 43ae07e
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 4a8cecb
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 3dbf161
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 b62ecdd
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 3415d2e
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 03bc9cd
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 56f6565
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 d4e7cca
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 a9bf1fb
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 2df9eec
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-message/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-rendering-macros</artifactId> | ||
<version>16.7.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>xwiki-platform-rendering-macro-message</artifactId> | ||
<name>XWiki Platform - Rendering - Macro - Message</name> | ||
<description>Extends the default message macro to provide translations.</description> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-localization-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xwiki.rendering</groupId> | ||
<artifactId>xwiki-rendering-macro-message</artifactId> | ||
<version>${rendering.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
50 changes: 50 additions & 0 deletions
50
...src/main/java/org/xwiki/rendering/internal/macro/message/MacroIconPrettyNameProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.xwiki.rendering.internal.macro.message; | ||
|
||
import org.xwiki.component.annotation.Component; | ||
import org.xwiki.localization.ContextualLocalizationManager; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
/** | ||
* XWiki specific component to provide an alternative text for an icon. | ||
* | ||
* @version $Id$ | ||
* @since 16.7.0RC1 | ||
*/ | ||
@Component(roles = MacroIconPrettyNameProvider.class) | ||
@Singleton | ||
public class MacroIconPrettyNameProvider | ||
{ | ||
private static final String TRANSLATION_KEY_PREFIX = "rendering.macro.message.icon.alternative."; | ||
@Inject | ||
private ContextualLocalizationManager l10n; | ||
|
||
/** | ||
* @param macroId the id of the macro whose icon needs an alternative text | ||
* @return the alternative text associated to the provided icon | ||
*/ | ||
public String getIconPrettyName(String macroId) | ||
{ | ||
return l10n.getTranslationPlain(TRANSLATION_KEY_PREFIX + macroId); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...-macros/xwiki-platform-rendering-macro-message/src/main/resources/META-INF/components.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
500:org.xwiki.rendering.internal.macro.message.MacroIconPrettyNameProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...rm-rendering-xwiki/src/main/java/org/xwiki/rendering/internal/util/XWikiIconProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.xwiki.rendering.internal.util; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
import org.xwiki.component.annotation.Component; | ||
import org.xwiki.icon.IconException; | ||
import org.xwiki.icon.IconRenderer; | ||
import org.xwiki.icon.IconSet; | ||
import org.xwiki.icon.IconSetManager; | ||
import org.xwiki.rendering.block.Block; | ||
import org.xwiki.rendering.block.RawBlock; | ||
import org.xwiki.rendering.syntax.Syntax; | ||
|
||
/** | ||
* Component to use the icon theme to provide a proper block for displaying an icon. | ||
* | ||
* @version $Id$ | ||
* @since 16.7.0RC1 | ||
*/ | ||
@Component | ||
@Singleton | ||
public class XWikiIconProvider extends DefaultIconProvider | ||
{ | ||
@Inject | ||
private IconSetManager iconSetManager; | ||
@Inject | ||
private IconRenderer iconRenderer; | ||
|
||
/** | ||
* Uses the icon theme to provide the right block for displaying an inline icon. | ||
* @param iconName the name of the icon to display | ||
* @return the block containing an icon. | ||
*/ | ||
@Override | ||
public Block get(String iconName) | ||
{ | ||
try { | ||
IconSet iconSet = getIconSet(iconName); | ||
String iconContent = this.iconRenderer.renderHTML(iconName, iconSet); | ||
return new RawBlock(iconContent, Syntax.HTML_5_0); | ||
} catch (IconException e) { | ||
return super.get(iconName); | ||
} | ||
} | ||
|
||
private IconSet getIconSet(String iconName) throws IconException | ||
{ | ||
IconSet iconSet = this.iconSetManager.getCurrentIconSet(); | ||
if (iconSet == null || !iconSet.hasIcon(iconName)) { | ||
iconSet = this.iconSetManager.getDefaultIconSet(); | ||
} | ||
return iconSet; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...tform-rendering/xwiki-platform-rendering-xwiki/src/main/resources/META-INF/components.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 namedXWikiMacroIconPrettyNameProvider
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