4 Commits

Author SHA1 Message Date
Tomas Hykel 948fa43321 chore: Remove feature flag for project-based work package identifiers 2026-05-25 17:45:06 +02:00
Kabiru Mwenja d39b720e6e Expose semanticId in API v3 work package endpoints
Adds the computed semanticId property to the HAL representer,
SQL collection representer, and schema representer. The property is
gated behind the semantic_work_package_ids feature flag and returns the
value from WorkPackage#identifier. Includes OpenAPI docs
and the translation key for the schema name.
2026-04-13 14:04:38 +03:00
Kabiru Mwenja d3734a7485 Rename work_packages_identifier setting values to "classic" and "semantic"
The setting previously used "numeric" and "alphanumeric" as its allowed
values. Rename them to "classic" and "semantic" to better align with the
product terminology for the work package identifier modes.

Includes a migration to update any stored setting values in the database,
updated constants and helper methods on Setting::WorkPackageIdentifier,
and all corresponding references across models, components, forms,
frontend controllers, locales, and specs.
2026-03-28 10:01:57 +03:00
Kabiru Mwenja f02ef008db Fix WorkPackageIdentifier encapsulation and lazy-load guard
Three issues corrected:

1. Bug fix: ALLOWED_VALUES is an Array; ALLOWED_VALUES[:alphanumeric] raises
   TypeError at runtime (symbols are not valid Array indices). Extract named
   string constants NUMERIC and ALPHANUMERIC so comparisons are explicit.

2. Lazy-load guard: ProjectHandleSuggestionGenerator ran a DB query on every
   component render, even in numeric mode where the result is never used.
   Now the query only runs when alphanumeric? is true; numeric mode gets [].

3. show_autofix_section? simplified: the alphanumeric? guard moved into the
   initializer, so the private method is now just projects_data.any?.

Also: wrap definition.rb's `allowed:` in a lambda to defer constant
resolution past Rails autoload (fixes a load-order error in specs), and
add a spec for Setting::WorkPackageIdentifier covering the bug scenario.
2026-02-25 23:34:01 +03:00