Skip to content

feat: add allow_remove and allow_reorder flags#7573

Merged
martinjagodic merged 2 commits intodecaporg:mainfrom
poslovnimediji:allow-remove_reorder
Aug 12, 2025
Merged

feat: add allow_remove and allow_reorder flags#7573
martinjagodic merged 2 commits intodecaporg:mainfrom
poslovnimediji:allow-remove_reorder

Conversation

@martinjagodic
Copy link
Member

Fixes #4702

  • adds allow_remove and allow_reorder flags to the list widgets
  • if either is set to false, UI does not render the drag handle/remove button
  • they are added to schemas

@martinjagodic martinjagodic requested a review from a team as a code owner August 11, 2025 07:59
@martinjagodic martinjagodic requested review from Copilot and demshy and removed request for a team August 11, 2025 09:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new configuration flags allow_remove and allow_reorder to list widgets, allowing users to control whether list items can be removed or reordered. The changes implement conditional rendering of UI controls based on these flags.

  • Added allow_remove and allow_reorder boolean properties to list widget schemas
  • Modified UI components to conditionally render drag handles and remove buttons based on these flags
  • Updated TypeScript definitions and test snapshots to reflect the new properties

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/decap-cms-widget-list/src/schema.js Adds allow_remove and allow_reorder boolean properties to the widget schema
packages/decap-cms-widget-list/src/ListControl.js Passes the new flags from field configuration to the UI component
packages/decap-cms-ui-default/src/ListItemTopBar.js Implements conditional rendering logic for drag handles and remove buttons
packages/decap-cms-core/src/types/redux.ts Adds TypeScript type definitions for the new properties
packages/decap-cms-widget-list/src/tests/snapshots/ListControl.spec.js.snap Updates test snapshots to include the new props

kyoshino added a commit to sveltia/sveltia-cms that referenced this pull request Aug 11, 2025
@martinjagodic martinjagodic merged commit ff961f4 into decaporg:main Aug 12, 2025
7 checks passed
@martinjagodic martinjagodic deleted the allow-remove_reorder branch August 12, 2025 11:13
martinjagodic added a commit to poslovnimediji/decap-cms that referenced this pull request Sep 4, 2025
* feat: add allow_remove and allow_reorder flags

* fix: update snapshots
martinjagodic added a commit to decaporg/decap-website that referenced this pull request Oct 10, 2025
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.

Add allow_delete property in list widget

3 participants