[FND-209] Remove custom field configuration screen in favor of variants - #24801
Draft
dfriquet wants to merge 6 commits into
Draft
[FND-209] Remove custom field configuration screen in favor of variants#24801dfriquet wants to merge 6 commits into
dfriquet wants to merge 6 commits into
Conversation
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
The shared project-mapping components stay: project attributes subclass them and now supply the endpoint the deleted work package screen used to provide.
The variant migration switches to reading custom_fields_projects directly, since nothing else consults it now and those rows are what it converts.
TypeVariant#activate_custom_fields_in_effective_projects! had no callers left and carried a TODO naming this migration, so it goes with the writers. The development seeder gains the form configuration link it never had, in place of the activation.
dfriquet
force-pushed
the
fnd-209-hide-custom-field-screen-with-variants
branch
from
August 18, 2026 11:04
058b7db to
060d7ee
Compare
dfriquet
force-pushed
the
fnd-209-hide-custom-field-screen-with-variants
branch
from
August 18, 2026 13:58
1aafd23 to
7502992
Compare
The table and CustomFieldsProject stay for FND-113's migration to read; its specs create the rows through that model rather than through an association.
dfriquet
force-pushed
the
fnd-209-hide-custom-field-screen-with-variants
branch
from
August 18, 2026 14:09
7502992 to
52a397f
Compare
Project.visible admits every active public project to any logged-in user, so merely seeing a project would have been enough to read a list field's option labels through the API. The scope now accepts the reach its caller needs.
Detaching a mapping is only possible while the project is active, which the removed permission check enforced on the project's behalf. The feature specs follow the removal: the deleted settings page object, the checkbox work package fields no longer carry, and a context whose premise the form configuration replaced.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ticket
https://community.openproject.org/wp/FND-209
Important
Stacked on FND-113 (removes the
type_variantsfeature flag and runs the variant migration). That PR does not exist yet. This one must not merge before it: the code here assumes the flag is gone.What are you trying to accomplish?
Remove the per-project custom field configuration outright. A type variant's form configuration becomes the only thing that decides which custom fields a work package offers.
Gone:
select_custom_fieldspermission, the settings tab, the landing redirect branch, the menu clause,permitted_paramscustomFieldsAPI link inWorkPackageRepresenter,WorkPackageCollectionRepresenter,CreateFormRepresenter,CreateWorkspaceFormRepresentercustom_fields_projects:all_work_package_custom_fields,custom_fields_activated_in/custom_fields_for_all, thecfpjoin inOnVisibleTypeAndProject,custom_field_allowed?in the PDF export,custom_field_in_project?inType::AttributesTypeVariant#activate_custom_fields_in_effective_projects!,Projects::Types::BaseService,UpdateProjectsTypesServiceTightened rather than removed:
GET /api/v3/custom_options/:idnow requires the caller to see the work packages of a project the field applies to, not merely the project.Project.visibleadmits every active public project to any logged-in user, so the looser check would have exposed a list field's option labels to anyone guessing an id.Kept: the
custom_fields_projectstable and itsCustomFieldsProjectmodel, so FND-113's migration can still read the rows it converts. Dropping the table is a follow-up WP, along withis_for_all, which is now inert for work package custom fields — its checkbox and its admin index column are gone, but the column stays because project attributes still use it and the migration reads it to tell a field that was available everywhere from one a project narrowed away.Screenshots
None.
What approach did you choose and why?
Three commits, in dependency order. Removing the configuration surface, then making the form configuration the sole authority, then stopping the writes. The middle commit is where the behaviour changes, so its spec fallout rides with it.
The migration reads the join table directly.
BuildVariantFromProjectServiceusedall_work_package_custom_fields, which is now gone. Had it kept borrowing a helper that stops consulting the table, it would compute an empty exclusion set and convert nothing — silently, since the job just reports every project as unchanged.Two follow-on effects worth reviewing:
WorkPackageCustomField.visiblehad a short-circuit grantingselect_custom_fieldsholders every field. With the permission gone it collapses toon_visible_type_and_project, so visibility always resolves through the form configuration. That reshaped the shared visibility fixtures and both hierarchy API specs, which had used the permission as their authorising condition.editable_custom_fieldswas(∩ project activations) ∩ (∪ variants' fields)and is now just the union across the selected projects' variants. Tightening it to an intersection would be a real improvement, but it is not "remove project narrowing".The development seeder was broken, not just made redundant.
attribute_groups=never populatedcustom_fields_types, so theCF DEV%fields were never actually available — the project activation only ever supplied half the condition.extend_groupnow links them to the form configuration.Query pickers no longer narrow by project. Scoping them through
on_visible_type_and_project(project:)coupled picker contents toUser.currentand returned empty query results, so they now list every filterable or searchable field — the same behaviour they already had outside a project context. Scoping them by form configuration instead is worth doing, but needs a project-scoped, user-independent scope that does not exist yet.Merge checklist