-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[73968, 73089] Extend and improve design of WorkPackageCardComponent #23175
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
Merged
HDinger
merged 6 commits into
dev
from
feature/73089-restyled-work-package-card-in-backlogs-and-sprints-view
May 19, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
91de331
Extend the WorkPackageCardComponent with new optionss
HDinger 7dc866d
Avoid that the status scheme is always set and status specific highli…
HDinger 5691c55
Include parent, assignee and priority into the call directly to avoid…
HDinger e0523a5
Merge remote-tracking branch 'origin/dev' into feature/73089-restyled…
HDinger 5bec5c6
Merge branch 'dev' into feature/73089-restyled-work-package-card-in-b…
HDinger 8d2586b
Merge branch 'dev' into feature/73089-restyled-work-package-card-in-b…
HDinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| The `WorkPackageCard` is a compact representation of a work package, designed for use in list and board views such as sprint and backlog views. | ||
|
|
||
| ## Overview | ||
|
|
||
| <%= embed OpenProject::Common::WorkPackageCardComponentPreview, :default %> | ||
|
|
||
| ## Anatomy | ||
|
|
||
| The card is structured in up to three rows: | ||
|
|
||
| **Row 1 — Metadata** | ||
| Contains the info line (type, ID, status), followed by optional elements: assignee, metric (e.g. story points), priority, and the actions menu. When `show_drag_handle: true`, a drag handle icon appears on the far left, spanning all rows, aligned to the top (row 1). | ||
|
|
||
| **Row 2 — Subject** | ||
| The work package title, always visible. | ||
|
|
||
| **Row 3 — Footer** *(only rendered when content is present)* | ||
| Shows a link to the parent work package (when `show_parent: true` and a parent exists) and/or the `with_additional_details` slot. | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Default | Description | | ||
| |---|---|---|---| | ||
| | `work_package` | `WorkPackage` | required | The work package to display | | ||
| | `menu_src` | `String` | `nil` | Optional lazy-load URL for the actions menu | | ||
| | `show_assignee` | `Boolean` | `false` | Show the assignee icon and name | | ||
| | `show_priority` | `Boolean` | `false` | Show a priority badge | | ||
| | `show_drag_handle` | `Boolean` | `false` | Show a drag handle icon | | ||
| | `show_parent` | `Boolean` | `false` | Show a link to the parent work package in row 3. Only rendered when `work_package.parent` is present. | | ||
| | `status_scheme` | `Symbol` | `:default` | Status label style: `:default` (highlighted) or `:secondary` (neutral label) | | ||
|
|
||
| ## Slots | ||
|
|
||
| | Slot | Description | | ||
| |---|---| | ||
| | `with_metric` | Numeric value shown in row 1 (e.g. story points) | | ||
| | `with_menu` | Custom actions menu, replaces the default lazy menu | | ||
| | `with_additional_details` | Additional content appended to row 3 | | ||
|
|
||
| ## Variants | ||
|
|
||
| <%= embed OpenProject::Common::WorkPackageCardComponentPreview, :playground, panels: %i[params source] %> | ||
|
|
||
| ## Code structure | ||
|
|
||
| ```ruby | ||
| render OpenProject::Common::WorkPackageCardComponent.new( | ||
| work_package: @work_package, | ||
| show_assignee: true, | ||
| show_priority: true, | ||
| show_parent: true, | ||
| status_scheme: :secondary | ||
| ) do |card| | ||
| card.with_metric { @work_package.story_points } | ||
| card.with_menu do |menu| | ||
| menu.with_item(label: "Open", href: work_package_path(@work_package)) | ||
| end | ||
| card.with_additional_details do | ||
| # Whatever else you want to show | ||
| end | ||
| end | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.