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

feat: apply item row operations, e.g. filter, on task progress bar data rows #2543

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jfmcquade
Copy link
Collaborator

@jfmcquade jfmcquade commented Nov 20, 2024

PR Checklist

  • PR title descriptive (can be used in release notes)

Description

Makes the following changes to the task_card and task_progress_bar components:

  • Both components can now take parameters matching the item data pipe operations, namely shuffle, sort, filter, reverse and limit. These operations will be applied to the data list rows of subtasks that make up the progress through the named task group.
    • E.g., in component parameter list, filter: @item.id !== @local.excluded_task_id;
    • The immediate use case is for filter, as requested by [FEATURE] Ability to filter task groups #2537
    • The other operations are unlikely to be useful: as the data rows (and their respective completion statuses) are just counted when passed to these components, the shuffle, sort and reverse operations will have no effect. However it makes sense to expose the same logic. It may make sense to just explicitly expose filter and limit as options, but currently all operations are technically applied.
  • Exposes the completed_column_name to the task-card component
    • This parameter already existed on the task_progress_bar, but was not exposed to the task_card component.
  • Fixes a styling issue where the padding around the content in the task card component was asymmetrical.

The filter parameter should function the same as it does when set on a data-items component row. This means it has the same limitations:

  • Does not support _index, _id, _first, _last metadata properties, since these are only applied in a data-items context
    • ID can be accessed just via @item.id
    • index can be accessed via @item.row_index

The task-card and task-progress-bar components contain logic for handling task completion status via two methods:

  1. Using fields
    • This should be considered legacy, but is still in active use by some deployments
  2. Using a data list column value that is updated by dynamic data updates

Further changes could be made to the code of these components to clarify this and potentially further separate the logic for each system, but that could be done in a follow-up PR.

Testing

Examine the linked templates below and test in-app to ensure they behave as expected.

Git Issues

Closes #2537, #2507

Screenshots/Videos

comp_task_card

Screenshot 2024-11-20 at 17 24 28 Screenshot 2024-11-20 at 17 28 18 Screenshot 2024-11-20 at 17 28 43

comp_task_progress_bar

Screenshot 2024-11-20 at 17 27 25 Screenshot 2024-11-20 at 17 25 39

@jfmcquade jfmcquade changed the title feat: apply item row operations on task progress bar data rows feat: apply item row operations, e.g. filter, on task progress bar data rows Nov 20, 2024
@jfmcquade jfmcquade marked this pull request as ready for review November 20, 2024 17:40
@github-actions github-actions bot removed the feature Work on app features/modules label Nov 20, 2024
@github-actions github-actions bot added the feature Work on app features/modules label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Work on app features/modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Ability to filter task groups
2 participants