Skip to content

XWIKI-22433: Provide consistency in info / warning / error class usages in templates #3555

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

Merged
merged 70 commits into from
Apr 14, 2025

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Oct 11, 2024

Jira URL

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

Changes

Description

  • Updated all the vm hardcoded instances of colored message boxes
  • Updated the velocity macros to match the new kind of boxes and added a few to increase coverage and allow a correct conversion of hardcoded boxes.
  • Added a couple translations to populate the velocity macros.

Status

I made this table and categories with this order:

  • Contains a relevant instance of .<whatever>message. info--> warning -->error-->success
  • Github search order

(Table under the detail dropdown)

Part File Updated Self-reviewed
A styles.js
A LivedataFootnotes.vue
A passwd.vm
A changesdoc.vm
A loader.js
B extensionHistory.vm
B extension.vm
B distribution/macros.vm
B Extensions.xml
B Macros.xml
C Settings.xml
C OfficeImporterAdmin.xml
C LiveTableViewSheet.xml
C Admin.xml
C edit_macros.vm
D job_macros.vm
D children.vm
D import.js
D ExtensionBreakingQuestion.form.vm
D XClassBreakingQuestion.form.vm
E dashboard.js
E AttachmentGalleryPickerMacro.java
E OfficeImporter.xml
E XObjectDisplayerProvider.java
E CreateApplication.xml
F ClassEditSheet.xml
F CreateWiki.xml
F LiveTableEditSheet.xml
F flamingo/macros.vm
F editobject.vm
G job_status_json.vm
G uploadfailure.vm
G FilterStreamJobJSON.xml
G macroSelector.js
G macroEditor.js
H XWikiSkinsSheet.xml
H restore.vm
H AdminUsersSheet.xml
H InvitationCommon.xml
H ColorThemePropertyDisplayer.xml
I createinline.vm
I xwiki-office/plugin.js
I moveStatus.vm
I NotificationAlert.xml
I NotificationsMacro.xml
J VulnerabilityIndexer.java
J ConfigurableClass.xml
J flamingo/copy.vm
J templates/renameStatus.vm
J flamingo/renameStatus.vm

38 files updated.

Additional file changes

  • Application resources --> Contains a couple new keys to populate the velocity macros -- make them more consistent.
  • templates/macros.vm --> Contains the updated velocity macros to provide a macro for every situation.

2 files updated

38 + 2 => 40 files total

Screenshots & Video

The name of the file whose modifications are illustrated by the screenshots is above them. If there's only one screenshot, it's for the after state.

Invitations.xml
before
Screenshot from 2024-10-09 10-55-05
after
Screenshot from 2024-10-09 10-54-32

NotificationAlert.xml
Screenshot from 2024-10-09 16-39-46
moveStatus.vm
Screenshot from 2024-10-09 15-48-37
CreateWiki.xml
Screenshot from 2024-09-16 16-26-34
OfficeImporter.xml
Screenshot from 2024-09-16 13-46-43
flamingo/macros.vm
Screenshot from 2024-09-04 10-04-27

Executed Tests

Manual tests only. I did test most of the changes as much as I could on a local live instance. The changes are across a very large scope. From what I could see, adding a class to the item did not break docker tests.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None, relatively dangerous changes.

…es in templates

* Part B
* extensionHistory.vm
* extension.vm
* distribution/macros.vm
* template/macros.vm
* Extensions.xml
* AnnotationCode/Macros.xml
…es in templates

* Part C
* ExtensionSecurity/Admin.xml
* edit_macros.vm
* LiveTableViewSheet.xml
* OfficeImporterAdmin.xml
* Annotations/Settings.xml
…es in templates

* Part D
* job_macros.vm
* children.vm
* ExtensionBreakingQuestion.form.vm
* XClassBreakingQuestion.form.vm
…es in templates

* Misc - doubled icon regression
…es in templates

* Part E
* AttachmentGalleryPickerMacro.java fails with `You must inject a component role. Got [org.xwiki.rendering.internal.macro.message.WarningMessageMacro] at L.87`
…es in templates

* Part E
* OfficeImporter.xml
* XObjectDisplayerProvider.java (WIP)
* CreateApplication.xml
…es in templates

* Part F
* ClassEditSheet.xml
* CreateWiki.xml (partially tested)
* LiveTableEditSheet.xml
* macros.vm
* editobject.vm (WIP)
…es in templates

* Part G
* job_status_json.vm
* uploadfailure.vm
* FilterStreamJobJSON.xml
…es in templates

* Part J
* Added velocity macro to support the inline mode
…es in templates

* Fixed escaping and syntax in LiveTableEditSheet.xml
…es in templates

* Fixed icon mock in MovePageTest.java
…es in templates

* Fixed icon mock in MovePageTest.java
…es in templates

* Removed a now useless setup step.
…es in templates

* Removed a now useless resource file.
…es in templates

* Replaced a velocity translation call with the standard translation macro.
…es in templates

* Updated the structure of the verlocimacros to take into account the latest bugfixes on the XWiki macros.
…es in templates

* Updated mocking in CreateInlinePageTest.java
…es in templates

* Updated the structure of the verlocimacros to take into account the latest bugfixes on the XWiki macros.
…es in templates

* Updated mocking of the IconManagerScriptService
Sereza7 and others added 4 commits March 18, 2025 14:04
…es in templates

* Removed escaping from strings that are not in a HTML context anymore
… usages in templates


* Replaced a statement lambda with an expression lambda

Co-authored-by: Michael Hamann <michael@content-space.de>
@Sereza7
Copy link
Contributor Author

Sereza7 commented Mar 18, 2025

All the comments on this PR have been adressed, it is ready for further review or a merge.

Comment on lines 672 to 682
{{/html}}
#if($request.deleteOk)
&lt;p class="successmessage box"&gt;
$services.localization.render('platform.wiki.create.wizard.step.cleaningup.success', ["&lt;strong&gt;$wikiId&lt;/strong&gt;"])
&lt;/p&gt;
{{success}}
{{html}}$services.localization.render('platform.wiki.create.wizard.step.cleaningup.success', ["&lt;strong&gt;$wikiId&lt;/strong&gt;"]){{/html}}
{{/success}}
#else
&lt;p class="errormessage box"&gt;
$services.localization.render('platform.wiki.create.wizard.step.cleaningup.error', ["&lt;strong&gt;$wikiId&lt;/strong&gt;"])
&lt;/p&gt;
{{error}}
{{html}}$services.localization.render('platform.wiki.create.wizard.step.cleaningup.error', ["&lt;strong&gt;$wikiId&lt;/strong&gt;"]){{/html}}
{{/error}}
#end
{{html clean="false"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be line breaks between these macros to ensure that all of them are standalone? Did you test this?

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 didn't test this one before AFAIR. Without changes it does indeed set the message as inline.
I committed the changes in 9b30dec 👍

In order to test it, I just called the template with empty parameters.
With the latest changes:
image

Before the changes in this PR:
image

Sereza7 added 3 commits March 18, 2025 16:48
…es in templates

* Added newlines around macros to make sure they are rendered standalone.
…es in templates

* Fixed the latest tests so that JobStatusJSONPageTest build properly with the changes to the error box.
@Sereza7
Copy link
Contributor Author

Sereza7 commented Apr 14, 2025

Tests:

  • Passed mvn clean install -f xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker; mvn clean install -f xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker; mvn clean install -f xwiki-platform-core/xwiki-platform-extension/ -Pdocker successfully
  • Fixed the latest tests so that JobStatusJSONPageTest build properly with the changes to the error box. Succesfully built mvn clean install -f xwiki-platform-core/xwiki-platform-web -Pquality,docker,integration-tests (note that when trying all the tests below, this fail caused the compilation of the module to not be done properly and made the changes in other module fail them...)
  • Passed successfully mvn clean install -f xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-ui -Pquality; mvn clean install -f xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-filter/xwiki-platform-filter-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-invitation/xwiki-platform-invitation-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-office/xwiki-platform-office-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-ui -Pquality;mvn clean install -f xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates -Pquality; mvn clean install -f xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-ui/xwiki-platform-wiki-ui-mainwiki -Pquality;mvn clean install -f xwiki-platform-distribution/xwiki-platform-distribution-flavor

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

Successfully merging this pull request may close these issues.

4 participants