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

XWIKI-19150: The Page Like UI is not following the common template style for a page #2788

Merged
merged 5 commits into from
Feb 29, 2024

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Jan 11, 2024

Jira URL

https://jira.xwiki.org/browse/XWIKI-19150

Changes

Description

  • Added a proper content header to the liker page.
  • Added an anchor in the title
  • Updated the id of the livetable to avoid a collision with an item in the #tmMoreActions menu

Screenshots & Video

Before PR vvv
beforePR
After PR vvv
19150-afterPR

Executed Tests

Succcessfully built with mvn clean install -f xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api

Expected merging strategy

  • Prefers squash: Yes
  • Backport to 15.10.X : localized changes on the content of a template, low risk of breaking something.

…yle for a page

* Added a proper content header to the liker page.
* Added an anchor in the title
…yle for a page

* Updated teh id of the livetable to avoid a collision with an item in the `#tmMoreActions` menu
@manuelleduc
Copy link
Contributor

Also, note that I'm working on https://jira.xwiki.org/browse/XWIKI-18992 which is also going to impact likers.vm.

…yle for a page

* Added a comment to give an indication on the change of livetable id.
@@ -99,7 +99,8 @@
#livetable_filterObfuscated($map)
$jsontool.serialize($map)
#else
<h1>$escapetool.xml($services.localization.render('like.likers.title', [$doc.plainTitle]))</h1>
#set($titleToDisplay = $services.localization.render('like.likers.title', ["<a href='$doc.getURL()'>$escapetool.xml($doc.plainTitle)</a>"]))
Copy link
Contributor

@manuelleduc manuelleduc Jan 11, 2024

Choose a reason for hiding this comment

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

To be tested but escaping html properties is probably safer.

Suggested change
#set($titleToDisplay = $services.localization.render('like.likers.title', ["<a href='$doc.getURL()'>$escapetool.xml($doc.plainTitle)</a>"]))
#set($titleToDisplay = $services.localization.render('like.likers.title', ["<a href='$escapetool.xml($doc.getURL())'>$escapetool.xml($doc.plainTitle)</a>"]))

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'm pretty sure we shouldn't escape this URL: https://github.com/search?q=repo%3Axwiki%2Fxwiki-platform+%2Fhref%3D%27.*getURL%2F&type=code

Most of those are not escaped ...

@surli
Copy link
Member

surli commented Feb 27, 2024

@Sereza7 you have conflicts to fix on this one.

@Sereza7
Copy link
Contributor Author

Sereza7 commented Feb 28, 2024

It was indeed a conflict with changes related to https://jira.xwiki.org/browse/XWIKI-18992 👍
I replaced the updated title with a call to the contentheader.vm template like it's done in other page templates (and what was done on this PR beforehand) :)

The updated Live Data id is the same as the one I changed on the live table, no need to update this.

…yle for a page

* Added back the comment (forgot it on merge conflict fix)
@Sereza7 Sereza7 added the backport stable-15.10.x Used for automatic backport to 15.10.x branch. label Feb 28, 2024
@surli surli merged commit ba4473a into xwiki:master Feb 29, 2024
2 checks passed
Copy link

The backport to stable-15.10.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-stable-15.10.x stable-15.10.x
# Navigate to the new working tree
cd .worktrees/backport-stable-15.10.x
# Create a new branch
git switch --create backport-2788-to-stable-15.10.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba4473ad848435053bedbab5d269d3176e893c50
# Push it to GitHub
git push --set-upstream origin backport-2788-to-stable-15.10.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-stable-15.10.x

Then, create a pull request where the base branch is stable-15.10.x and the compare/head branch is backport-2788-to-stable-15.10.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable-15.10.x Used for automatic backport to 15.10.x branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants