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

Sort button for related contents #1191

Merged
merged 11 commits into from
Oct 29, 2024
Merged

Conversation

didoda
Copy link
Member

@didoda didoda commented Oct 16, 2024

This introduces a "sort" section to sort by title (asc or desc) related contents for a specific object and relation.

image

Feature is available if BEdita API is at least 5.31.0 (waiting for bedita/bedita#2102 to be merged, to have release 5.31.0).

Sort fields can be configured per relation by RelationsSortFields config. An example follows:

    /**
     * Relations sort fields.
     * Define sortable fields per relation.
     */
    'RelationsSortFields' => [
        'composed_by' => [
            ['label' => 'Short title', 'value' => 'short_title'],
            ['label' => 'Title', 'value' => 'title'],
        ],
        'composed_by_default' => 'short_title',
        'part_of' => [
            ['label' => 'Short title', 'value' => 'short_title'],
            ['label' => 'Title', 'value' => 'title'],
        ],
        'part_of_default' => 'short_title',
    ],

On "save" click, a modal confirm pops up: you can decide if continue or skip.

image

@didoda didoda added feature New feature or request release:minor labels Oct 16, 2024
@didoda didoda added this to the 4.x milestone Oct 16, 2024
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.70%. Comparing base (669fbff) to head (7b398c4).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1191   +/-   ##
=========================================
  Coverage     99.70%   99.70%           
- Complexity     1310     1312    +2     
=========================================
  Files            97       97           
  Lines          5113     5117    +4     
=========================================
+ Hits           5098     5102    +4     
  Misses           15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@didoda didoda marked this pull request as ready for review October 16, 2024 09:22
@manuelzane
Copy link
Member

I would only change the labels to something more explicit, like this:

sort

@didoda didoda merged commit c1a9d1d into bedita:master Oct 29, 2024
19 checks passed
@didoda didoda deleted the feat/sort-related branch October 29, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request release:minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants