-
-
Notifications
You must be signed in to change notification settings - Fork 515
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-17966: Mention events should display the name of the wiki where they took place in Notifications #3042
base: master
Are you sure you want to change the base?
Conversation
… they took place in Notifications * Added a wiki indicator to mention notifications similar to the one found in regular notifications in notification/macros.vm
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.
The code looks ok, but I'd suggest improving org.xwiki.mentions.templates.MentionPageTest
to cover your changes.
With the current nexus issues, I don't know how I'd try out the changes to the docker tests. Leaving this as a draft until I commit a properly tested improvement to MentionPageTest. |
|
… they took place in Notifications * Added a test for the new template feature
Added a test for the new feature, successfully passed: |
velocityContext.put("xcontext", this.context); | ||
// Template rendering. | ||
String actual = templateManager.render("mentions/mention.vm"); | ||
String expected = IOUtils.toString(getClass().getResourceAsStream("/templates/mentions/mention2.html"), |
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.
Wdyt of giving a slightly more descriptive name to mention2.html
(e.g., mentionOtherWiki.html
)?
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.
Hum actually I'm not even sure comparing to a full html file is the way to go (I know I introduced the first test which was ok-ish to validate the general structure, but I'm not sure this is really the best approach).
What I suggest is to parse the content with jsoup, run selections on the resulting document and assert the existence and/or content of the selections.
I also suggest adding the "wiki" script services to the loaded components, it seems to be missing.
Of course, feel free to ping me if you need help.
Jira URL
https://jira.xwiki.org/browse/XWIKI-17966
Changes
Description
Clarifications
xwiki-platform/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/macros.vm
Lines 63 to 65 in 69fe80c
Screenshots & Video
Before the PR, there was no indication about the wiki in mention notifications (see examples on the jira ticket).
Here are two screenshots of my test instance after the PR. On this instance, I used a default user account to ping the Administrator on both the main wiki (prettyName = Home) and a sub wiki (prettyName = subwiki)
The first one shows mention notifications as the Admin would see them when in the main wiki:
The second one shows mention notifications as the Admin would see them when in the sub wiki:
We can see on both of these examples that the wiki name is displayed on mention notifications coming from another wiki than the one currently navigated. This message works whatever the plurality of mentions in the notification is.
Executed Tests
Manual tests, see screenshots above.
Successfully passed
mvn clean install -f xwiki-platform-core/xwiki-platform-mentions/xwiki-platform-mentions-notifications -Pdocker,quality,integration-tests
. Tried to check the docker tests inxwiki-platform-mentions-test-docker
too, but the build got stuck atINFO o.x.t.d.internal.junit5.WARBuilder - Resolving distribution dependencies ...
, from experience it's an issue with our nexus instance.Expected merging strategy