Skip to content

Adapt work package lists for semantic identifiers#22719

Draft
akabiru wants to merge 4 commits intofeature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiersfrom
feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers
Draft

Adapt work package lists for semantic identifiers#22719
akabiru wants to merge 4 commits intofeature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiersfrom
feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers

Conversation

@akabiru
Copy link
Copy Markdown
Member

@akabiru akabiru commented Apr 10, 2026

Ticket

https://community.openproject.org/work_packages/73717

What are you trying to accomplish?

Use the new formattedId property consistently across all work package list and card views, replacing hard-coded #{{ wp.id }} patterns that would show the numeric PK instead of the semantic identifier.

Screenshot 2026-04-13 at 5 24 33 PM

What approach did you choose and why?

PR #22704 added displayId and formattedId to WorkPackageBaseResource. formattedId conditionally prefixes # only for classic numeric IDs — semantic identifiers like PROJ-42 are self-describing and render without a prefix, matching Jira's convention.

This PR updates all remaining display sites to use them:

  • Card view, relation rows, single view header, and quickinfo macro — switched from #{{ wp.id }} to {{ wp.formattedId }}
  • Destroy modal, in-app notifications, and timer modal — same pattern, these were still using #{{ wp.id }} or '#' + workPackage.id
  • Display field modules (WorkPackageDisplayField, LinkedWorkPackageDisplayField) — added wpFormattedId getter with semantic ID support: when the linked resource is loaded, it reads displayId and applies the same conditional hash logic; otherwise it falls back to hash-prefixed numeric ID from the self-link href

This means every place that shows a work package identifier to users now goes through formattedId, so PROJ-42 renders correctly in semantic mode and #123 in classic mode, with no per-view conditional logic.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@akabiru akabiru self-assigned this Apr 10, 2026
@akabiru akabiru marked this pull request as draft April 10, 2026 15:26
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 1f8bf4c to a88120e Compare April 10, 2026 15:37
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from f134595 to ad322ec Compare April 10, 2026 15:37
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from a88120e to d517a42 Compare April 10, 2026 15:47
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from ad322ec to e6d8ead Compare April 10, 2026 15:47
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from d517a42 to 39ffe42 Compare April 10, 2026 16:04
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch 2 times, most recently from 16ee4b5 to 6895b28 Compare April 10, 2026 16:33
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 39ffe42 to a0ef1df Compare April 10, 2026 16:33
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from 6895b28 to 8f40e32 Compare April 10, 2026 17:11
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from a0ef1df to eef1772 Compare April 10, 2026 17:11
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch 2 times, most recently from cc59e9c to 22f55c6 Compare April 10, 2026 17:51
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from d3017b4 to 927e856 Compare April 10, 2026 17:51
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from 22f55c6 to c12fe21 Compare April 10, 2026 18:04
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 927e856 to 99543cc Compare April 10, 2026 18:04
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from c12fe21 to e3ccb40 Compare April 10, 2026 18:13
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 99543cc to 6266550 Compare April 10, 2026 18:13
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from 78767de to 8f012b3 Compare April 13, 2026 10:37
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 7d160d6 to 0c3e8bd Compare April 13, 2026 10:42
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from 8f012b3 to e76ab89 Compare April 13, 2026 10:42
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 0c3e8bd to c6b4d48 Compare April 13, 2026 11:05
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from e76ab89 to 9372285 Compare April 13, 2026 11:05
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 257e36d to abe86e8 Compare April 14, 2026 14:59
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from 9372285 to ac24e63 Compare April 14, 2026 15:06
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from abe86e8 to 95be852 Compare April 14, 2026 15:25
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from ac24e63 to 42408c8 Compare April 14, 2026 15:30
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch 2 times, most recently from 2fb1cff to 4c1b1a6 Compare April 15, 2026 12:55
@akabiru akabiru force-pushed the feature/73716-adapt-work-package-show-view-for-project-based-semantic-work-package-identifiers branch from 4c1b1a6 to 26f87c6 Compare April 15, 2026 16:35
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch from 42408c8 to bf9dcb1 Compare April 15, 2026 16:38
akabiru added 4 commits April 15, 2026 20:01
Replace hardcoded `#{{ wp.id }}` patterns with `wp.displayIdWithHash`
across all display sites: cards, relations, quickinfo macros, destroy
modal, notifications, and timer modal. This ensures semantic identifiers
(e.g. #PROJ-42) render correctly in all views.
Override valueString in WorkPackageIdDisplayField to return the
semantic identifier from displayId instead of the numeric PK, so
the table ID column shows "PROJ-42" in semantic mode.
The render() method passed this.value (numeric PK) as both the routing
ID and the visible link content. The displayText parameter — which
carries the user-facing identifier from valueString — was only used as
the title attribute.

Change the third argument to linkToShow() from this.value to
displayText so the link's textContent shows "PROJ-7" (semantic) or
"123" (classic) instead of always showing the numeric PK.

Add spec covering valueString fallback and render output assertions.
Follow-up to the base branch rename. Also updates wpFormattedId
to apply conditional hash logic: semantic identifiers (containing
letters) render without #, numeric IDs keep the # prefix.
@akabiru akabiru force-pushed the feature/73717-adapt-work-package-lists-for-project-based-semantic-work-package-identifiers branch 2 times, most recently from e1a7da3 to e1cac12 Compare April 15, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant