Replaces `Filters::FilterForm` (an `ApplicationForm` subclass) with
`Filters::FilterFormComponent` (an `ApplicationComponent`). The old form
overrode `:nodoc:` Primer hooks (`before_render`, `perform_render`) and
read semi-public ivars (`@builder`, `@view_context`). The new component
receives the builder as an explicit keyword arg and uses a standard ERB
template, reducing Primer internal coupling from five semi-public APIs
to one (`FormList`).
https://community.openproject.org/wp/OP-19415
Work package results on the search page build their link through the
acts_as_event url proc, which passed the numeric primary key instead of
the work package's display id. In semantic mode this rendered
/work_packages/<id> even though the row showed the semantic identifier,
unlike Rails URL helpers that already resolve the object via to_param.
Pass display_id so the link follows the same convention everywhere.
Sort WP lists by project identifier, not project_id, in semantic mode
The semantic-mode "ID" sort grouped projects by project_id (insertion
order) before the per-project sequence. Projects added after others
landed below them in the list even when their identifier sorted
alphabetically earlier. Sort by projects.identifier instead so the order
matches the visible "<project identifier>-<sequence>" column.
The projects table is already joined for every work-package list query,
so the new sort term costs no extra round-trip.
* Show filed type beside its name
* Add feature spec
* Add a comment for field_type_label
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Add custom field type label assertion to feature spec
* Move custom field to active group before asserting type label
* Rename the displayed field format value from field_type to
field_format_label and reuse CustomFieldsHelper for custom field format
labels.
* Make the table configuration modal wait more and embedded work package table loading take longer to avoid flaky failures when the modal or embedded table is still refreshing in CI
* Undo changes for switch_to method
* Undo changes for the tests that are sometimes failing on CI
* Update spec/features/types/form_configuration_spec.rb
Co-authored-by: Henriette Darge <h.darge@openproject.com>
* Update spec/helpers/types_helper_spec.rb
Co-authored-by: Henriette Darge <h.darge@openproject.com>
* Rubocop errors fixed
* Fix flaky field format labels spec by revisiting page after custom field creation
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Henriette Darge <h.darge@openproject.com>
Lift the static-anchor label composition out of LinkHandlers and into
a small Helpers::StaticMacroLabel module so the envelope path
(MentionFilter) and the text-reference path (LinkHandlers) share one
shape — same module called from both, no cross-class reach-through.
Batch the User and Group mention preloads alongside the existing WP
preload so a note with N principals costs one SELECT per type rather
than N. Class lookup now reads from indexed hashes; visibility-gating
stays where it was (at the find for principals, separate from the
label for WPs).
Rename SemanticIdentifier.format → with_hash_prefix; the prior name
was broad enough to invite misuse for arbitrary work-package values.
Override StaticHtmlFormatter#filters explicitly so a future filter
appearing in Formatter#filters is a deliberate decision to apply to
mailer-side rendering, not an automatic one.
Spec coverage: classic-mode quickinfo and inaccessible-WP paths
(symmetric with the existing semantic-mode contexts), a principal
preload N+1 guard, and an anonymous current_user smoke test that
confirms the static-HTML pipeline doesn't raise when invoked without
an authenticated viewer.
Pairs unscoped label resolution and viewer-scoped link gating in a
WorkPackagePreloadCache instead of two RequestStore keys with a
five-method save/restore protocol. Exposes one `current_cache` reader;
consumers ask the cache directly via `fetch` and `visible?`.
Extracts a `text_only?` predicate in the WP link handler so the
`context[:plain_text]` and invisible-WP guards collapse into a single
call site. `SemanticIdentifier.format` renames its parameter to
reflect that the input may or may not be semantic.
The `mentioned` and `watcher_changed` text-mailer bodies surfaced raw
journal markdown — numeric `#42` references stayed numeric in semantic
mode, and `<mention>` envelopes leaked as HTML source.
Introduces `:plain_text` as a sibling format inside the existing Plain
module. The filter chain mirrors the markdown pipeline (markdown,
sanitization, mention, pattern-matcher) and finishes with a new
`PlainTextOutputFilter` that collapses the DOM to text. The
`WorkPackages` link handler and `MentionFilter` get plain-text branches
keyed off `context[:plain_text]` so identifier resolution stays in one
place across rich and plain channels.
Closes https://community.openproject.org/wp/74762