Skip to content

hopps admin app - #750

Open
s0582346 wants to merge 65 commits into
mainfrom
hopps-admin
Open

hopps admin app#750
s0582346 wants to merge 65 commits into
mainfrom
hopps-admin

Conversation

@s0582346

Copy link
Copy Markdown
Member

Admin-Anwendung (frontend/admin)

Frontend — neue Anwendung, 66 Dateien

  • Vereinsliste mit Suche, Sortierung und abgeleitetem Status (aktiv / ruhend / neu / nie aktiv)
  • Vereinsdetail: Stammdaten, Vorstand & Zugänge, drei Aktivitätscharts, Löschen mit Bestätigung
  • Impersonieren einzelner Mitglieder aus dem Detail heraus, auditiert
  • Übersicht: vier Kennzahlen (Vereine gesamt, aktive Vereine, Belege diesen Monat, KI-Auslese-Anteil) über zwei Trendcharts

Backend — app.hopps.org

  • GET/DELETE /admin/organizations, /admin/organizations/{id} samt Aktivitäts-, Upload- und Erfassungsweg-Endpunkten
  • GET /admin/dashboard — bestandsweite Kennzahlen in einem Aufruf
  • POST /admin/organizations/{id}/impersonate mit Audit-Eintrag
  • POST /member/activity/heartbeat — Präsenzsignal aus der SPA
  • Vier Migrationen: V1.0.20V1.0.23 (Admin-Felder, last_seen_at, member_activity_day, impersonation_audit)

SPA

useActivityHeartbeat im authentifizierten Layout, damit die Nutzungszeit überhaupt messbar wird.

Tests

Fünf neue Backend-Testklassen (AdminOrganizationResourceTests, AdminDashboardResourceTest, AdminImpersonationTests, MemberActivityRepositoryTest, MemberActivityResourceTest), inklusive der Akkumulator-Arithmetik: gezählte Lücken, verworfene Abwesenheit, Spam-Resistenz, Tagesgrenzen.

s0582346 added 30 commits July 10, 2026 17:17
@s0582346
s0582346 requested a review from manuelhummler July 31, 2026 06:31
@s0582346 s0582346 self-assigned this Jul 31, 2026
s0582346 and others added 13 commits July 31, 2026 08:36
# Conflicts:
#	backend/app.hopps.org/src/main/java/app/hopps/shared/bootstrap/DocumentDataLoader.java
#	backend/app.hopps.org/src/main/java/app/hopps/shared/bootstrap/TestdataConfig.java
#	backend/app.hopps.org/src/main/resources/testdata/testdata.yaml
#	frontend/api-client/src/services/OrgService.ts
#	frontend/pnpm-lock.yaml
Adds deployment, service, ingress and serviceaccount templates for the admin
SPA, modelled on the frontend service, plus the matching helper templates and
an `admin` values block. Keycloak and API configuration flows through
`admin.envVars`/`envFrom` like the frontend does; `admin.realmRole` is a
first-class value rendered as VITE_ADMIN_REALM_ROLE, mirroring how
`frontend.alphaVersion` works.

Bumps the chart to 0.2.8 so the release workflow publishes a new version.

Two deliberate deviations from the frontend templates, which contain bugs that
should not be propagated:

- The frontend deployment reads `.Values.org.replicaCount` for its own replica
  count; admin uses `.Values.admin.replicaCount`.
- The shared `imagePullSecrets` block renders invalid YAML when
  `global.imagePullSecrets` is set and the service-level list is empty, because
  `toYaml []` emits a bare `[]` beneath the merged list. Admin uses `concat`
  instead. The same latent bug remains in the org, frontend, az-document-ai and
  zugferd templates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The admin package declared `validate` -> `lint` -> `eslint src`, but shipped no
eslint config and no eslint dependency, so the script could never run. Adds the
config, a prettier config matching the SPA's, and the missing devDependencies.

Uses eslint-plugin-import-x rather than eslint-plugin-import. Version 2.x of the
latter does not support ESLint 10: its `order` rule throws
`sourceCode.getTokenOrCommentBefore is not a function` as soon as it has a
violation to report. The SPA carries the same combination and only passes
because its imports already happen to be ordered, so the crash is latent there
too. import-x is the maintained fork with the same rule semantics.

`react-hooks/purity` and `react-hooks/static-components` are set to warn,
following the precedent the SPA config sets for the React-Compiler rule family.
Both currently flag real issues in the organizations views, called out in a
comment so they can be fixed deliberately rather than silently muted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mechanical `eslint --fix` pass bringing the admin sources in line with the
prettier config added in the previous commit (4-space indent, single quotes,
160 column width). No behavioural changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The impersonation flow reads VITE_SPA_URL to open the member-facing SPA in a new
tab, and .env.example documents it, but neither the Dockerfile nor
replaceEnvs.sh carried it. The placeholder therefore survived into the deployed
bundle and impersonation redirected to a bogus URL.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mirrors the frontend workflow: lints and builds the admin app, publishes
ghcr.io/hopps-app/hopps/admin, and dispatches the hopps.cloud deploy for the
admin service on main. Without this nothing produced the image the chart's
admin deployment expects.

The build bakes the VITE_* placeholders into the bundle so that
docker/replaceEnvs.sh can swap them for real values at container start, letting
one image serve every environment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two build failures on this branch after main was merged in:

- Flyway refused to start ("Found more than one migration with version
  1.0.20/1.0.21/1.0.22") because the admin migrations reused versions main had
  meanwhile taken. Renumber the admin migrations after main's highest (1.0.22),
  preserving their relative order:
    1.0.20 organization_admin_fields -> 1.0.24
    1.0.21 member_last_seen_at        -> 1.0.25
    1.0.22 member_activity_day        -> 1.0.26
    1.0.23 impersonation_audit        -> 1.0.27
  main's 1.0.20 bank_match_amount_manual / 1.0.21 recompute_bank_transaction_
  coverage / 1.0.22 category_groups keep their versions. This unblocks the org
  tests that failed only because Quarkus could not start.

- eslint (react-hooks/purity) failed the frontend build on
  use-activity-heartbeat.ts: useRef(Date.now()) calls an impure function during
  render. Seed the ref to 0 and set the real timestamp on mount in the effect,
  before the first beat() — same behaviour, no impure render.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`useRef(Date.now())` calls an impure function during render, which
react-hooks/purity reports as an error and which failed the frontend workflow's
validate step. Seed the ref in the mount effect instead; mounting still counts
as the first interaction, so idle detection behaves as before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both sides fixed the react-hooks/purity error in useActivityHeartbeat
independently. Kept the remote version from 195f9bf — same change, fuller
comments — and dropped the local duplicate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…m main

Fixing the Flyway version collision let the previously-skipped admin resource
tests run again, and three assertions were stale: the main merge added 5 receipt
documents (transaction-linked, ids 1-5) to buehnefrei-ev (org 4), so it now has
33 documents (28 activity + 5 receipts) rather than 28, and the receipts are
created "now" so they land in the current-month bucket.

- shouldListOrganizations / shouldReturnDetail: belegeCount 28 -> 33
- shouldReturnDocumentActivity: months[5] (current month) 8 -> 13

Not touched (needs a testdata id realignment, out of scope here): the two
extraction-breakdown tests still hardcode `id in (1..10)` for their
extractionsource setup, but the merged testdata put org-4 activity docs at ids
101-128 and the receipts at 1-5, so ids 6-8 (the AI rows) no longer exist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants