Skip to content

luci-base: implement the move method for CBIJSONConfig#8348

Open
emzet wants to merge 1 commit intoopenwrt:masterfrom
emzet:feature/luci-base-form
Open

luci-base: implement the move method for CBIJSONConfig#8348
emzet wants to merge 1 commit intoopenwrt:masterfrom
emzet:feature/luci-base-form

Conversation

@emzet
Copy link

@emzet emzet commented Feb 24, 2026

As the title says, the original implementation was missing. Here is the actual implementation. It works correctly with GridSection (including nested ones) and handles moving items internally, which is useful when you need to save the data as JSON file, not just visualize it via the UI.

The logic is as follows:

  • convert the data object into an array
  • find the indices for section_id1 and section_id2
  • move the section_id1 item to the correct position
  • recalculate the indices for the entire data object
  • convert the array back into an object

@github-actions

This comment has been minimized.

- convert the data object into an array
- find the indices for section_id1 and section_id2
- move the section_id1 item to the correct position
- recalculate the indices for the entire data object
- convert the array back into an object

Signed-off-by: Marek Zavacky <[email protected]>
@emzet emzet force-pushed the feature/luci-base-form branch from d68f4b1 to 8312508 Compare February 24, 2026 21:39
@emzet emzet changed the title feat: implement the move method for CBIJSONConfig luci-base: implement the move method for CBIJSONConfig Feb 24, 2026
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