Handle hidden and print fields without needing direct access to the hide/print flag fields #558
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.
See comment on #555 regarding the "hide" boolean fields. The "print" boolean fields are similar, though they operate independently (e.g. you can hide your email online, but opt to include it in print).
We currently use the "hide" booleans in the event list view, but only to manage the preview mode when editing (see #380). Otherwise, they're redundant because the backend properly provides or nulls private fields if they're supposed to be hidden.
This change alters the handling of those fields so that the preview function pulls the "hide" boolean values directly from the current state of the edit form. It also checks the "print" boolean fields, and if they're enabled, sets a special "print preview" field with the appropriate value.
After this change, the
events
endpoint should no longer need either the "hide" or "print" boolean fields, and we could consider removing them from that API response. (They would still be needed for themanage_event
andretrieve_event
endpoints.)