Skip to content

Conversation

@madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Apr 22, 2025

This PR refactors the sort-children-of entity action to eliminate the dependency on the document and media modules from the package. The PR introduces a sortChildrenOfContent entity action kind that manages the additional orderBy name and createDate logic.

Additional code changes

  • Changes the UI to use the umb-table element instead of a custom table. This helps align the UI and provides a common interface for describing table columns and rows. The sortChildrenOfContent uses this to add additional columns to the default sortChildrenOf action.
  • adds an additional sortable attribute to the umb-table element that sets the table into a sorting mode. This makes all rows draggable, and an event is emitted when the sorting is finished.

Breaking Changes / Behaviour:

  • The behaviour of sortChildrenOf entity action now only allows manual drag and drop to change the sort order
  • sortChildrenOfContent entity action kind has been introduced to handle ordering by name and createDate. This now has the same functionality has sortChildrenOf had before.

@madsrasmussen madsrasmussen marked this pull request as ready for review April 22, 2025 17:28
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 refactors the sorting functionality for content children to remove illegal dependencies from core modules and introduce a dedicated "sortChildrenOfContent" action for content items.

  • Splits the sort children action by moving content-specific logic into a separate entity action and modal.
  • Enhances the UmbTable element with a new "sortable" mode that enables drag‐and‐drop with associated visual feedback.
  • Adjusts module dependency checks by lowering the ILLEGAL_CORE_IMPORTS_THRESHOLD to tighten the allowed number of illegal core imports.

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.

File Description
src/packages/core/tree/entity-actions/sort-children-of/constants.ts Adds new export for sort children action kind manifest.
src/packages/core/components/table/table.element.ts Refactors table element to integrate sorting via UmbSorterController and new sortable attributes/styles.
src/packages/content/* Introduces new content tree types, sort children action, modal elements, and manifests for content sorting.
src/devops/module-dependencies/index.js Lowers the allowed illegal core imports threshold from 6 to 5.
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/devops/module-dependencies/index.js:5

  • Verify that lowering ILLEGAL_CORE_IMPORTS_THRESHOLD from 6 to 5 is an intentional change, as this stricter threshold might result in unexpected errors if any core module currently relies on a higher number of package imports.
const ILLEGAL_CORE_IMPORTS_THRESHOLD = 5;

Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

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

Changes looks good, just need to verify that it actually works.

@madsrasmussen madsrasmussen enabled auto-merge (squash) April 23, 2025 14:15
@madsrasmussen madsrasmussen merged commit 513f980 into v16/dev Apr 23, 2025
18 checks passed
@madsrasmussen madsrasmussen deleted the v16/chore/split-sort-children-of branch April 23, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants