Batch Move Pages

Last modified by Adina Milica on 2025/02/25 09:32

 XWiki
 Feature
 Idea
 
 
No

Description

Batch move pages scenarios


He wants to move a single page (that does NOT have children).

He wants to move multiple pages (that do NOT have children).

He wants to move a single page (that has children, but not move any children) .

He wants to move multiple single pages (that have children, but not move any children).

He wants to move a single page with all its children.

He wants to move multiple pages with all of their children.

He wants to be able to take a specific page or group of pages out of the batch.

He wants to move all the children of a page, but not the page itself.

What things are important when moving in batch


  • Structure to be kept
  • Rights to be kept or redefined
  • Status of the pages sent
  • Showing the user if any data has to be resent or if the move failed.

Proposal Look (states detailed below, this is just a quick look)


move patch pags.png

Where to access the UI from?


The Batch Move UI could be accessed through a new entry, named Batch Move, in the 1739531193319-882.png dropdown of any page.

Step 1: Initial state of the UI


When accessing the UI, the tree loads only the first 10 pages of the current space. If they have children, they are collapsed.

In the Rights section, the first option is the default.

Update links and Create an automatic redirect are both checked by default.

The Destination space tree after moving section only has the following message shown below its title, in a Info box: "You haven't selected any pages yet. Check their boxes to select."

The Save bar at the bottom of the page is sticky. On it, initially, the message in the left says "No pages selected". Because there are no pages selected, there is no  "Start moving" button.

move batch 2 inital.png

Step 2: Selecting a page


Let's say the user decides to click a checkbox.

Clicking a checkbox doesn't expand the group of sub-pages.

Pages selected, but no destination path

If the user hasn't yet set a destination path, this is how the UI will look:

  • The section "Destination space tree after moving" will contain a warning box stating the number of pages selected and warning the user to set a destination path.

move batch 2 inital no path elected.png

Pages selected, destination path set

If there are pages selected and the destination is set, then the destination tree including the pages to be moved would be rendered immediately after the destination is set.

At this point, the Refresh tree button is not yet present.

If after this, the user selects more pages, the Refresh tree button appears and the tree gets hidden. If the user clicks the button, the tree gets rendered.

This behavior gets repeated every time the user selects some other pages or if the user changes the destination path .

move batch 2 path selected.png

Step 3: Confirming the selection


move batch 2 confirm.png

Step 4: Status page


Step 5: Batch history? Is it requested by users?


How does the selection work?


Every page will have a checkbox in front of its name in the tree. Initially, this checkbox is empty.

For terminal pages (pages with no children), the checkbox only has 2 states (state 0 and state 1 from below).

For parent pages (pages with children), the checkbox has 4 states (states 0,1,2,3).

These are the 4 possible states of the checkbox:

checkboxes.png

State 0: Empty Checkbox: The current page hasn't been selected.

State 1: Blue Checked Checkbox: The current page has been selected.

State 2: Green Checked Checkbox: The current page and all of its children have been selected.

Parent page(2).png

  • Sub-case: Let's say we have the current page in state 2. Thus, all children (and sub-children, sub-sub-children, etc.) are in state 1. If even one sub-children (however deeply nested it is) gets unchecked (state 0 or state 3), the current page goes to state 2.

Parent page.png

State 3: Crossed Checkbox: All children of the current page have been selected, but the current page hasn't been selected.

  • Sub-case: Let's say we have the current page in state 3. Thus, all children (and sub-children, sub-sub-children, etc.) are in state 1. If even one sub-children (however deeply nested it is) gets unchecked (state 0 or state 3), the current page goes to state 0.

Parent page(1).png

Listing the pages to be moved


If this is efficient to do: we simulate the look of the future tree in the destination space. To not do this every time a checkbox state changes (seems like this wouldn't be very efficient), we can just add a refresh button for the user to click when he wants to see the tree.

An alternative would to be to have a summary of the pages added, grouped by a relevant parent. This implies a whole algorithm created for this method which, while it would be nice, I do not find that it brings that much value overall.

Example of selection implementation (doesn't include sub-cases)


https://codepen.io/Adina-Milica-the-encoder/pen/mybZoJv


 


Get Connected