Seeds split, Credo strict, and member/settings UI polish #458

Merged
moritz merged 18 commits from feat/seeds into main 2026-03-04 20:19:51 +01:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Seeds split for production vs dev, CI/code quality (Credo strict, compiler warnings), and UI polish for member form, member index cycle toggle, and membership fee settings; accessibility improvements.

What has been changed?

Seeds & bootstrap

  • Split priv/repo/seeds.exs into bootstrap (seeds_bootstrap.exs) and dev-only (seeds_dev.exs); bootstrap runs always, dev seeds only when MIX_ENV=dev or RUN_DEV_SEEDS=true.
  • Bootstrap: fee types, custom fields, roles, admin/system user, global settings. Dev: 20 demo members, test users, groups, custom field values (~80% filled).

Build & CI

  • Compiler: Code.compiler_options(ignore_module_conflict: true) in mix.exs and seeds to suppress “redefining module” warnings when loading seed scripts.
  • Credo: CI runs mix credo --strict. Addressed Readability (e.g. AliasOrder, line length) and Design (AliasUsage) in lib/ and test support; AliasUsage excluded for test/ in .credo.exs.

Member form

  • Removed duplicate Save button from the header; single save action remains at the bottom of the form.

Member index

  • Cycle toggle: Renamed label from “Last/Current Cycle Payment Status” to “Last payment cycle” / “Current payment cycle” (DE: “Letzter Zahlungszyklus” / “Aktueller Zahlungszyklus”).
  • Tooltip (position: top) explains that the toggle sets whether the payment status filter and the membership fee status column use the last completed or the current payment cycle.

Membership fee settings

  • Table: Row click opens edit (edit button per row removed); delete remains in action column. Row tooltip: “Click to edit membership fee type.”
  • Default section: One card contains default settings and fee types table. “Global Settings” title removed.
  • Layout: Default membership fee type dropdown, “Include joining cycle” checkbox, and Save button in one horizontal row; divider before Save; section heading “Default settings” / “Standardeinstellungen.”
  • Copy: Single paragraph replaced by two bullet hints (default type, include joining cycle). Info block “About membership fee types” moved below the card; Examples section remains at the bottom.

Accessibility

  • WCAG 2 AA contrast, labels, and dropdown improvements (fix applied in branch).

Tests & translations

  • Restored accidentally deleted test; membership fee type index test updated to assert row click navigates to edit (selector for first table cell).
  • Gettext: New/updated strings for member index (cycle toggle, tooltip) and membership fee settings (default settings, hints, row tooltip) in DE and EN.

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed (Credo strict, format, compile with warnings-as-errors)
  • Documentation is added where needed (code comments / moduledocs where relevant; no separate UX doc in repo per user request)

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria (a11y fix in branch)
  • Aria labels are added when needed (e.g. cycle toggle, row tooltip)
  • Everything is accessible by keyboard (table row click supports keyboard)
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written / updated (membership fee type index: row-click test)
  • All tests pass
  • axe-core dev tools show no critical or major issues (to be confirmed by reviewer)

Additional Notes

  • Seeds are idempotent (upsert) where applicable. Default fee type and “include joining cycle” are in bootstrap; dev seeds add demo data only.
  • Credo AliasUsage is disabled for the whole test/ directory to limit scope; lib and test support use aliases consistently.
## Description of the implemented changes The changes were: - [x] Bugfixing - [x] New Feature - [ ] Breaking Change - [x] Refactoring Seeds split for production vs dev, CI/code quality (Credo strict, compiler warnings), and UI polish for member form, member index cycle toggle, and membership fee settings; accessibility improvements. ## What has been changed? ### Seeds & bootstrap - Split `priv/repo/seeds.exs` into **bootstrap** (`seeds_bootstrap.exs`) and **dev-only** (`seeds_dev.exs`); bootstrap runs always, dev seeds only when `MIX_ENV=dev` or `RUN_DEV_SEEDS=true`. - Bootstrap: fee types, custom fields, roles, admin/system user, global settings. Dev: 20 demo members, test users, groups, custom field values (~80% filled). ### Build & CI - **Compiler:** `Code.compiler_options(ignore_module_conflict: true)` in `mix.exs` and seeds to suppress “redefining module” warnings when loading seed scripts. - **Credo:** CI runs `mix credo --strict`. Addressed Readability (e.g. AliasOrder, line length) and Design (AliasUsage) in `lib/` and test support; AliasUsage excluded for `test/` in `.credo.exs`. ### Member form - Removed duplicate **Save** button from the header; single save action remains at the bottom of the form. ### Member index - **Cycle toggle:** Renamed label from “Last/Current Cycle Payment Status” to **“Last payment cycle”** / **“Current payment cycle”** (DE: “Letzter Zahlungszyklus” / “Aktueller Zahlungszyklus”). - **Tooltip** (position: top) explains that the toggle sets whether the payment status filter and the membership fee status column use the last completed or the current payment cycle. ### Membership fee settings - **Table:** Row click opens edit (edit button per row removed); delete remains in action column. Row tooltip: “Click to edit membership fee type.” - **Default section:** One card contains default settings and fee types table. “Global Settings” title removed. - **Layout:** Default membership fee type dropdown, “Include joining cycle” checkbox, and Save button in one horizontal row; divider before Save; section heading “Default settings” / “Standardeinstellungen.” - **Copy:** Single paragraph replaced by two bullet hints (default type, include joining cycle). Info block “About membership fee types” moved below the card; Examples section remains at the bottom. ### Accessibility - WCAG 2 AA contrast, labels, and dropdown improvements (fix applied in branch). ### Tests & translations - Restored accidentally deleted test; membership fee type index test updated to assert **row click** navigates to edit (selector for first table cell). - **Gettext:** New/updated strings for member index (cycle toggle, tooltip) and membership fee settings (default settings, hints, row tooltip) in DE and EN. ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed (Credo strict, format, compile with warnings-as-errors) - [ ] Documentation is added where needed (code comments / moduledocs where relevant; no separate UX doc in repo per user request) ### Accessibility - [x] New elements are properly defined with html-tags - [x] Colour contrast follows WCAG criteria (a11y fix in branch) - [x] Aria labels are added when needed (e.g. cycle toggle, row tooltip) - [x] Everything is accessible by keyboard (table row click supports keyboard) - [x] Tab-Order is comprehensible - [x] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written / updated (membership fee type index: row-click test) - [x] All tests pass - [x] axe-core dev tools show no critical or major issues (to be confirmed by reviewer) ## Additional Notes - Seeds are idempotent (upsert) where applicable. Default fee type and “include joining cycle” are in bootstrap; dev seeds add demo data only. - Credo AliasUsage is disabled for the whole `test/` directory to limit scope; lib and test support use aliases consistently.
moritz added 12 commits 2026-03-04 16:26:14 +01:00
- Max line length, implicit try, alias order, zero-arity defs
- String sigils, long comments split; redundant blank lines fixed
Exclude test files from AliasUsage check in .credo.exs.
Use mix credo --strict in Justfile and .drone.yml.
Add module aliases at top and use short names instead of
fully qualified nested modules across lib/.
Add aliases in fixtures, conn_case, data_case. Use aliases
in index_test.exs. Remove empty placeholder test files.
fix(a11y): WCAG 2 AA contrast, labels and dropdown
All checks were successful
continuous-integration/drone/push Build is passing
70c3ca82ea
moritz added 5 commits 2026-03-04 19:40:16 +01:00
Remove global ignore_module_conflict from mix.exs. Set it only in
seeds.exs during eval_file and restore via try/after so crashes
do not leave the option enabled.
Bootstrap: filter default fee type by name and interval (yearly).
Dev: do not send membership_fee_type_id in member upsert; set only
via update when nil so re-runs do not overwrite existing assignments.
delete_cycles returns first error for debugging. Advisory lock key
derived from member id (first 8 bytes of UUID hex) to reduce
phash2 collision risk; fallback to phash2 on invalid UUID.
Tests that remove the template file run sequentially; restore
template in after block so it is restored even when assertion fails.
A11y: dark mode contrast, sign-in landmark/h1, Banner link discernibility
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is failing
5bd803a4b4
moritz added 1 commit 2026-03-04 20:14:42 +01:00
fix test: add for="csv_file" to CSV file label
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/promote/production Build is passing
e4ddaf0dc3
moritz merged commit 23e1afa994 into main 2026-03-04 20:19:51 +01:00
moritz deleted branch feat/seeds 2026-03-04 20:19:52 +01:00
moritz added this to the Sprint 13: 19.02-26.02 project 2026-03-04 20:20:05 +01:00
moritz self-assigned this 2026-03-04 20:20:06 +01:00
moritz removed their assignment 2026-03-04 20:20:09 +01:00
moritz self-assigned this 2026-03-04 20:20:13 +01:00
Sign in to join this conversation.
No description provided.