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-21988: Page naming strategy is blocking creation of pages not respecting it #3229

Merged
merged 5 commits into from
Jul 9, 2024

Conversation

surli
Copy link
Member

@surli surli commented Jun 25, 2024

Jira URL

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

Changes

Description

The goal here is to immediately display a feedback in the create page dialog telling the user that the reference is wrong before they click on create.

I performed following changes here:

  • Refactor CreateActionRequestHandler to have a clean separation between retrieving the reference and performing checks over templates
  • Refactor a bit CreateAction to perform immediate checks over the rights and the name strategy before even checking if the template is chosen: the goal being here to immediately provide exception if there's a problem
  • Refactor createinline.vm to inject bootstrap modal html elements when used with an ajax request: the idea here is to display an ajax modal instead of the old deprecated xwiki dialog
  • Refactor xwiki.js to use a jquery ajax call to request and display createinline
  • Add listener on xwiki:dom:updated events in both create.js and select.js to properly load them in case of dom updates

Clarifications

Screenshots & Video

I took screenshots in the exact same scenario with a link not respecting the name strategy.

Before

With the create modal

Capture d’écran du 2024-06-25 18-52-27

With the create page

Capture d’écran du 2024-06-25 18-52-33

After

With the create modal

Capture d’écran du 2024-06-25 18-47-31

With the create page

Capture d’écran du 2024-06-25 18-48-27

Executed Tests

TBD

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 15.10.x
    • 16.4.x

@surli surli added backport stable-15.10.x Used for automatic backport to 15.10.x branch. backport stable-16.4.x labels Jun 25, 2024
surli added 4 commits July 8, 2024 15:30
…especting it

The goal here is to immediately display a feedback in the create page
dialog telling the user that the reference is wrong before they click on
create.

I performed following changes here:
  * Refactor CreateActionRequestHandler to have a clean separation
    between retrieving the reference and performing checks over
templates
  * Refactor a bit CreateAction to perform immediate checks over the
    rights and the name strategy before even checking if the template is
chosen: the goal being here to immediately provide exception if there's
a problem
  * Refactor createinline.vm to inject bootstrap modal html elements
    when used with an ajax request: the idea here is to display an ajax
modal instead of the old deprecated xwiki dialog
  * Refactor xwiki.js to use a jquery ajax call to request and display
    createinline
  * Add listener on xwiki:dom:updated events in both create.js and
    select.js to properly load them in case of dom updates

Some work is still needed to display a better information message to the
user, in particular about the strategy that should be used.
…especting it

  * Provide new translations for getting better information from the
    name strategy
  * Improve a bit the template for displaying errors
…especting it

  * Move translations
  * Fix typos in translations
  * Fix since
@surli surli marked this pull request as ready for review July 9, 2024 09:19
@surli surli merged commit 0d91409 into master Jul 9, 2024
1 check passed
@surli surli deleted the XWIKI-21988 branch July 9, 2024 14:43
github-actions bot pushed a commit that referenced this pull request Jul 9, 2024
…especting it (#3229)

The goal here is to immediately display a feedback in the create page
dialog telling the user that the reference is wrong before they click on
create.

I performed following changes here:
  * Refactor CreateActionRequestHandler to have a clean separation
    between retrieving the reference and performing checks over
templates
  * Refactor a bit CreateAction to perform immediate checks over the
    rights and the name strategy before even checking if the template is
chosen: the goal being here to immediately provide exception if there's
a problem
  * Refactor createinline.vm to inject bootstrap modal html elements
    when used with an ajax request: the idea here is to display an ajax
modal instead of the old deprecated xwiki dialog
  * Refactor xwiki.js to use a jquery ajax call to request and display
    createinline
  * Add listener on xwiki:dom:updated events in both create.js and
    select.js to properly load them in case of dom updates
  * Provide new translations for getting better information from the
    name strategy
  * Improve a bit the template for displaying errors
  * Fix page test
  * Fix page object
  * Move translations
  * Fix typos in translations
  * Fix since

(cherry picked from commit 0d91409)
github-actions bot pushed a commit that referenced this pull request Jul 9, 2024
…especting it (#3229)

The goal here is to immediately display a feedback in the create page
dialog telling the user that the reference is wrong before they click on
create.

I performed following changes here:
  * Refactor CreateActionRequestHandler to have a clean separation
    between retrieving the reference and performing checks over
templates
  * Refactor a bit CreateAction to perform immediate checks over the
    rights and the name strategy before even checking if the template is
chosen: the goal being here to immediately provide exception if there's
a problem
  * Refactor createinline.vm to inject bootstrap modal html elements
    when used with an ajax request: the idea here is to display an ajax
modal instead of the old deprecated xwiki dialog
  * Refactor xwiki.js to use a jquery ajax call to request and display
    createinline
  * Add listener on xwiki:dom:updated events in both create.js and
    select.js to properly load them in case of dom updates
  * Provide new translations for getting better information from the
    name strategy
  * Improve a bit the template for displaying errors
  * Fix page test
  * Fix page object
  * Move translations
  * Fix typos in translations
  * Fix since

(cherry picked from commit 0d91409)
surli added a commit that referenced this pull request Jul 16, 2024
…especting it (#3229)

The goal here is to immediately display a feedback in the create page
dialog telling the user that the reference is wrong before they click on
create.

I performed following changes here:
  * Refactor CreateActionRequestHandler to have a clean separation
    between retrieving the reference and performing checks over
templates
  * Refactor a bit CreateAction to perform immediate checks over the
    rights and the name strategy before even checking if the template is
chosen: the goal being here to immediately provide exception if there's
a problem
  * Refactor createinline.vm to inject bootstrap modal html elements
    when used with an ajax request: the idea here is to display an ajax
modal instead of the old deprecated xwiki dialog
  * Refactor xwiki.js to use a jquery ajax call to request and display
    createinline
  * Add listener on xwiki:dom:updated events in both create.js and
    select.js to properly load them in case of dom updates
  * Provide new translations for getting better information from the
    name strategy
  * Improve a bit the template for displaying errors
  * Fix page test
  * Fix page object
  * Move translations
  * Fix typos in translations
  * Fix since

(cherry picked from commit 0d91409)
surli added a commit that referenced this pull request Jul 16, 2024
…especting it (#3229)

The goal here is to immediately display a feedback in the create page
dialog telling the user that the reference is wrong before they click on
create.

I performed following changes here:
  * Refactor CreateActionRequestHandler to have a clean separation
    between retrieving the reference and performing checks over
templates
  * Refactor a bit CreateAction to perform immediate checks over the
    rights and the name strategy before even checking if the template is
chosen: the goal being here to immediately provide exception if there's
a problem
  * Refactor createinline.vm to inject bootstrap modal html elements
    when used with an ajax request: the idea here is to display an ajax
modal instead of the old deprecated xwiki dialog
  * Refactor xwiki.js to use a jquery ajax call to request and display
    createinline
  * Add listener on xwiki:dom:updated events in both create.js and
    select.js to properly load them in case of dom updates
  * Provide new translations for getting better information from the
    name strategy
  * Improve a bit the template for displaying errors
  * Fix page test
  * Fix page object
  * Move translations
  * Fix typos in translations
  * Fix since

(cherry picked from commit 0d91409)
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. backport stable-16.4.x
Projects
None yet
2 participants