-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
base: master
Are you sure you want to change the base?
Conversation
* 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.
...tform-core/xwiki-platform-tour/xwiki-platform-tour-ui/src/main/resources/TourCode/TourJS.xml
Outdated
Show resolved
Hide resolved
.../xwiki-platform-tour/xwiki-platform-tour-ui/src/main/resources/TourCode/TourTranslations.xml
Outdated
Show resolved
Hide resolved
You said:
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 |
* Fixed code style. * Updated the JS log type.
Note that when you read the CSS selector, both should have a different meaning:
Since by default, ids are not supposed to contain points, we want to make sure we don't change anything for the first one (it could be seen as a regression for a lot of existing Tours). The second one is non standard (even if common, in HTML ids are not supposed to have dots in them) and we had an unexpected behaviour with it. Removing the XWiki syntax rendering on this one allows for it to work as expected. I updated the first message clarifications to hopefully be a bit better :) |
So I guess this answers my question:
And that the answer to this question is yes. |
@@ -89,7 +89,12 @@ | |||
</dl> | |||
#else | |||
<dl> | |||
<dt><label #if($isEditing)for="TourCode.StepClass_0_${prop.name}"#end>$services.localization.render("${class.name}_${prop.name}")</label></dt> | |||
<dt><label #if($isEditing)for="TourCode.StepClass_0_${prop.name}"#end>$services.localization.render("${class.name}_${prop.name}")</label> |
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.
Strange indentation. And I would call $escapetool.xml()
on the label.
<dt><label #if($isEditing)for="TourCode.StepClass_0_${prop.name}"#end>$services.localization.render("${class.name}_${prop.name}")</label> | ||
## Add a hint for the field if there's one defined in the translations. | ||
#if($!services.localization.render("${class.name}_${prop.name}.hint") != "${class.name}_${prop.name}.hint")## | ||
<span class='xHint'>$!services.localization.render("${class.name}_${prop.name}.hint")</span>## |
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.
<span class='xHint'>$!services.localization.render("${class.name}_${prop.name}.hint")</span>## | |
<span class='xHint'>$!escapetool.xml($services.localization.render("${class.name}_${prop.name}.hint"))</span>## |
<dt><label #if($isEditing)for="TourCode.StepClass_0_${prop.name}"#end>$services.localization.render("${class.name}_${prop.name}")</label></dt> | ||
<dt><label #if($isEditing)for="TourCode.StepClass_0_${prop.name}"#end>$services.localization.render("${class.name}_${prop.name}")</label> | ||
## Add a hint for the field if there's one defined in the translations. | ||
#if($!services.localization.render("${class.name}_${prop.name}.hint") != "${class.name}_${prop.name}.hint")## |
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 can also use $services.localization.get()
to check if a key is translated, see https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-mentions/xwiki-platform-mentions-notifications/src/main/resources/templates/mentions/mention.vm#L85-L89 .
@@ -38,7 +38,7 @@ | |||
<hidden>true</hidden> | |||
<content>{{include reference="TourCode.Macros"/}} | |||
|
|||
{{velocity}} | |||
{{velocity wiki="false"}} |
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.
Why the indentation? And BTW, you could instead set output="false"
and call the #jsonResponse()
Velocity macro at the end to write the JSON directly to the HTTP response.
}); | ||
; |
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 looks unnecessary.
@@ -428,7 +428,10 @@ require(['jquery', 'xwiki-meta'], function ($, xm) { | |||
createTour(tour); | |||
} | |||
} | |||
}).fail(function (data) { | |||
console.error("Querying the JSON for the Tour failed. %o", data); |
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.
I'm not sure what's the benefit for this, since the browser's web developer tools already provide information about the failed HTTP requests.
Jira URL
https://jira.xwiki.org/browse/XWIKI-21633
Changes
Description
element
field hint.Clarifications
\
\\
newline
syntax and replaces it with\n
element
field so that it's easier to use by adminsScreenshots & Video
Both of those screenshots are taken after applying the changes proposed in this PR:


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