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

Add pickers for the space, include, order, mode and scope parameter #408 #456

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Farcasut
Copy link
Contributor

@Farcasut Farcasut commented Jan 30, 2025

Added pickers for all the parameters and moved part of the wikimacro API back to the xcontext API (XWiki-18965) to retrieve the raw values of the parameters. I also added translations for the enums in a translation page and updated the translations used by the parameter directly on the object. (I'm not sure why there are no translation keys for the macro, but I kept the consistency.)

## TODO When https://jira.xwiki.org/browse/XWIKI-18965 is fixed move back to the newer $wikimacro API
#set($spaces = "$!xcontext.macro.params.spaces")
#if ($xcontext.macro.params.global != 'false')
#set ($spaces = "@ALL")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the global parameter is marked, we override whatever value we had in the space with @ALL. I used this approach to ensure that I preserved the old behavior without adding complex logic that could break the macro.

#set($spaces = "$!wikimacro.parameters.get('spaces')")
#set($scope = "$!xcontext.macro.params.scope")
#if ($scope == 'specified')
#set ($scope="")
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 can't have a blank value in an enum, so I used 'specified' and set it to blank, as this was the old default.

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.

1 participant