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

Enhance item count #22519

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Enhance item count #22519

wants to merge 3 commits into from

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented May 17, 2024

Scope

  • Provide relative count of items (currently shown items of total items) in non-paginated layouts (Calendar, Kanban, Map).
    • Previously, users had no way to tell whether all resp. how many items are currently displayed vs. how many actually exist. Users would have to switch to a paginated layout to find this out.
    • Before / After
      Before
      After
    • Similar to paginated layouts where the same information (current & total) is also given:
    • Displaying total count if no compatible field has been found (e.g. no date field in Calendar layout), so users can still retrieve this information and see whether a collection is empty or not. A corresponding info about such missing fields will follow in a separate PR.
  • In non-paginated layouts, inform via header when there are no items.
    • The layouts are still rendered, since they potentially already provide some context (e.g. groups in Kanban) and this also leaves the door open if we later want to add the possibility to create new items directly via these layouts (e.g. with click on map).
    • Before / After
      Before
      After
  • Fix total count, by accounting for the system filter (usually the archived state).
    • Required to get the correct number for the new relative count in non-paginated layouts.
    • The filter check for formatting the count in paginated layouts was inaccurate because of this when filtering in collections with hidden archived items.
      Before / After
      Before
      After
  • Consistent number formatting (with n()), previously not applied in all cases.
  • Consistent capitalization of item counts, e.g. 1-25 of 30 Filtered Items instead of 1-25 of 30 filtered items. Also removing obsolete count translations.
  • Align the limit warnings in Kanban and Calendar layouts (dynamic check, same styling & fix Calendar layout height when shown)

Potential Risks / Drawbacks

  • Changes to several files, but about the same everywhere.

Review Notes / Questions

--


Related to #21539 - while we still only fetch the items for the current view in Calendar layout, we now provide the information about total count of items

Copy link

changeset-bot bot commented May 17, 2024

🦋 Changeset detected

Latest commit: 3e7e143

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@directus/composables Minor
@directus/app Patch
@directus/extensions-sdk Patch
@directus/api Patch
create-directus-extension Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hanneskuettner hanneskuettner self-assigned this May 21, 2024
@alexchopin alexchopin linked an issue May 21, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 Needs Triage
Development

Successfully merging this pull request may close these issues.

Inconsistency records fetched in calendar layout
3 participants