9 Commits

Author SHA1 Message Date
Henriette Darge c7afb4968f Get inplaceEditField for customField dynamically by the format instead of registring them all directly 2026-03-20 08:40:33 +01:00
Henriette Darge a445cc196c * Take care that newly created CF are also correctly registered
* Introduce spec helper for inplace edit fields
* Preserve system_arguments for calculated fields when they are updated
2026-03-17 15:13:21 +01:00
Alexander Brandon Coles c64f2a9278 Add .default class method to both registries
Adds `attr_reader :default` to `FieldRegistry` and `UpdateRegistry`
inside their `class << self` blocks, exposing the pre-built `@default`
instance via `.default`. Updates `InplaceEditFieldComponent` and
`InplaceEditFieldsController` to reference `.default` instead of
the class itself, so the parameter is consistently an instance.
2026-03-05 07:13:51 -03:00
Alexander Brandon Coles 88811082fa Apply same instance-based registry pattern to UpdateRegistry
For symmetry with the previous `FieldRegistry` commit: extract the
registry state into instance methods, back the class-method API with a
`@default` instance via `delegate`, and update the spec to use
`described_class.new` so tests are isolated from global state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 06:24:30 -03:00
Alexander Brandon Coles e358f913c5 Fix flaky inplace_edit_field_component_spec
`FieldRegistry` used a single class-level hash, so test registrations
in `field_registry_spec` leaked into other specs depending on run order.

Reproduce with:
  bundle exec rspec \
    './spec/components/open_project/common/inplace_edit_field_component_spec.rb[1:1:2]' \
    './spec/lib/open_project/inplace_edit/field_registry_spec.rb[1:2:1]' \
    --seed 50000

Fix: extract the registry into an instance (`FieldRegistry#register`,
`#fetch`), with a `@default` instance backing the existing class-method
API. The spec now uses `described_class.new` for a clean slate per
example, so the global default is never touched.
2026-03-05 06:24:30 -03:00
Henriette Darge 71592a79fc Remove eager loading option from the inplace edit fields. Now all fields are rendered the same way, making it easier to understand und use the code. 2026-01-29 14:37:14 +01:00
Henriette Darge 1b7e30eb49 Do a permission check in the InplaceEditField based on the contracts 2026-01-29 14:37:06 +01:00
Henriette Darge 13664c2fe8 Create a update handler registry to be able to update different models from the inplaceEditField component 2026-01-29 14:37:03 +01:00
Henriette Darge bd88659079 First draft of a registry for inline edit components (wip) 2026-01-29 14:37:02 +01:00