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-21633: Adding a step tour on a class field doesn't work #3781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Dec 27, 2024

Jira URL

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

Changes

Description

  • Removed XWiki interpretation from the JSON construction velocity template in TourJson
  • Added a hint for the element field of the step creation/edition forms.
  • Added a javascript log when the retrieval of the tour's JSON fails
  • Added the english value for the element field hint.

Clarifications

  • The main change is the one line in the TourJSon file.
    • We need one backslash to escape a special character in CSS. \
    • We escape this backslash when serializing the tour data to a JSON \\
  • XWiki interpreter figures out it's the newline syntax and replaces it with \n
  • The other changes in this PR are just small quality improvements:
    • Addition of a hint to the element field so that it's easier to use by admins
    • Addition of a failure message when retrieving the JSON for easier debugging (without it, this kind of tour failure was completely silent)

Screenshots & Video

Both of those screenshots are taken after applying the changes proposed in this PR:
Screenshot from 2024-12-27 15-58-24
Screenshot from 2024-12-27 15-58-54

Executed Tests

Successfully passed mvn clean install -f xwiki-platform-core/xwiki-platform-tour/ -Pquality,integration-tests,docker -Dxwiki.test.ui.wcag=true with no WCAG warning.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 16.10.X (localized changes, relatively safe)

* Added a hint for the element field of the step creation/edition forms.
* Added a javascript log when the retrieval of the tour's JSON fails
* Removed XWiki interpretation from the JSON construction velocity template in TourJson
* Added the english value for the `element` field hint.
@@ -428,7 +428,10 @@ require(['jquery', 'xwiki-meta'], function ($, xm) {
createTour(tour);
}
}
}).fail(function (data) {
console.log("Querying the JSON for the Tour failed. %o", data);
Copy link
Member

Choose a reason for hiding this comment

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

should be an error log instead

@@ -69,6 +69,8 @@ tour.popover.show.hint=You can restart the tour by clicking this button at anyti
# Steps
TourCode.StepClass_order=Order
TourCode.StepClass_element=Element (CSS selector that identify an element)
TourCode.StepClass_element.hint=CSS selector that identifies an element. Escape special CSS characters with a
Copy link
Member

Choose a reason for hiding this comment

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

wrong indentation

@surli
Copy link
Member

surli commented Jan 7, 2025

You said:

The main change is the one line in the TourJSon file.
We need one backslash to escape a special character in CSS.
We escape this backslash when serializing the tour data to a JSON \
XWiki interpreter figures out it's the newline syntax and replaces it with \n

It's not entirely clear to me: you didn't actually performed any changes to add the backslashes. I assume you mean those still need to be put manually but the only change is on step 4: now those are not transformed anymore to \n? is that correct? So if I understand properly your changes don't fix using Code.TestClass_input but it fixes using Code\.TestClass_input, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants