Let the board choose what members see and change per data field closes #669 #694

Merged
simon merged 12 commits from issue/mitgliederverwaltung-669 into main 2026-11-19 13:48:28 +01:00
Owner

closes #669

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Each data field gets a member access level: "Not visible", "Read only" or "Read and change". The board sets it on the data field's page with a radio group (one hint per option); the data fields table shows it in the column "Member access". Members see only the fields that are not hidden and change the ones set to "Read and change" on their own edit page; the server enforces both, forged values are refused. Existing data fields start at "Read only", so members see what they saw before and change nothing; a new data field starts at "Not visible".

What has been changed?

  • Store what members may do with each field
  • Keep fields hidden from members out of their reads
  • Let members change the custom fields set to read and change
  • Let the board choose what members may do with each data field
  • Show members their data fields and let them change the open ones
  • Name the member access levels in the glossary
  • Show all three member access levels in the demo data
  • Let members change and see the sample data fields on a new installation
  • Note member access per data field and that existing fields start read only
  • Let each pull request add its entry to the next release's file
  • Tell staff they now choose what members see of each data field

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

  • Reads: actors whose custom field read scope is :linked (members, and the read-only roles on their own record) never read hidden fields or their values — a filter on the CustomField and CustomFieldValue reads, so every page and export follows it.
  • Writes: update_contact_data takes custom_field_values; a validation allows only fields set to "Read and change". The CustomFieldValue create check runs on the changeset, the update check is a filter check, because nested manage_relationship updates run as atomic updates without a loaded record. Tests send forged values for hidden and read-only fields.
  • Required fields block a member's save only when the member may change them.
  • Migration 20261117233209_add_custom_field_member_access: the column is added with default visible (existing rows), then the default becomes hidden; a migration test pins both.
  • Seeds: new installations set a level per sample field on insert only; a forced re-seed keeps what the board chose.
  • Form component radio_group/1 (fieldset, legend, hint per option, errors referenced per radio); empty radios get a stronger border (3.87:1 light, 4.96:1 dark).

The CHANGELOG Unreleased section has an upgrade note: existing data fields start at "Read only"; new ones at "Not visible".

What's new: the entry for staff is in priv/whats_new/1.7.0.exs ("You now choose what members see of each data field", a task on Settings → Data fields; German texts in whats_new.po). It stays invisible until 1.7.0 runs. docs/whats-new.md and docs/releasing.md now say that each pull request adds its entry to the next release's file and the release only curates them (at most five).

closes #669 ## Description of the implemented changes The changes were: - [ ] Bugfixing - [x] New Feature - [ ] Breaking Change - [ ] Refactoring Each data field gets a member access level: "Not visible", "Read only" or "Read and change". The board sets it on the data field's page with a radio group (one hint per option); the data fields table shows it in the column "Member access". Members see only the fields that are not hidden and change the ones set to "Read and change" on their own edit page; the server enforces both, forged values are refused. Existing data fields start at "Read only", so members see what they saw before and change nothing; a new data field starts at "Not visible". ## What has been changed? - Store what members may do with each field - Keep fields hidden from members out of their reads - Let members change the custom fields set to read and change - Let the board choose what members may do with each data field - Show members their data fields and let them change the open ones - Name the member access levels in the glossary - Show all three member access levels in the demo data - Let members change and see the sample data fields on a new installation - Note member access per data field and that existing fields start read only - Let each pull request add its entry to the next release's file - Tell staff they now choose what members see of each data field ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [x] New elements are properly defined with html-tags - [x] Colour contrast follows WCAG criteria - [x] Aria labels are added when needed - [x] Everything is accessible by keyboard - [x] Tab-Order is comprehensible - [x] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [ ] axe-core dev tools show no critical or major issues ## Additional Notes - **Reads:** actors whose custom field read scope is `:linked` (members, and the read-only roles on their own record) never read hidden fields or their values — a filter on the CustomField and CustomFieldValue reads, so every page and export follows it. - **Writes:** `update_contact_data` takes `custom_field_values`; a validation allows only fields set to "Read and change". The CustomFieldValue create check runs on the changeset, the update check is a filter check, because nested `manage_relationship` updates run as atomic updates without a loaded record. Tests send forged values for hidden and read-only fields. - **Required fields** block a member's save only when the member may change them. - **Migration `20261117233209_add_custom_field_member_access`:** the column is added with default `visible` (existing rows), then the default becomes `hidden`; a migration test pins both. - **Seeds:** new installations set a level per sample field on insert only; a forced re-seed keeps what the board chose. - **Form component `radio_group/1`** (fieldset, legend, hint per option, errors referenced per radio); empty radios get a stronger border (3.87:1 light, 4.96:1 dark). The CHANGELOG `Unreleased` section has an upgrade note: existing data fields start at "Read only"; new ones at "Not visible". **What's new:** the entry for staff is in `priv/whats_new/1.7.0.exs` ("You now choose what members see of each data field", a task on Settings → Data fields; German texts in `whats_new.po`). It stays invisible until 1.7.0 runs. `docs/whats-new.md` and `docs/releasing.md` now say that each pull request adds its entry to the next release's file and the release only curates them (at most five).
simon merged commit 9211222e84 into main 2026-11-19 13:48:28 +01:00
simon deleted branch issue/mitgliederverwaltung-669 2026-11-19 13:48:28 +01:00
Sign in to join this conversation.
No description provided.