hopps admin app - #750
Open
s0582346 wants to merge 65 commits into
Open
Conversation
…nhance sidebar navigation
…add tests for admin resource
… receipt usage, and token trends
…minOrganizationResource
… adjust localization
…monthly upload activity endpoint
…nizationDetailView
…nents and locales
…just related API responses
…OrganizationDetailView
…pository for activity accumulation
…m layouts and improved localization
…mpersonationTicket DTO
…ialog and API integration
# 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>
…oard and AdminOrganization tests
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.
Admin-Anwendung (
frontend/admin)Frontend — neue Anwendung, 66 Dateien
Backend —
app.hopps.orgGET/DELETE /admin/organizations,/admin/organizations/{id}samt Aktivitäts-, Upload- und Erfassungsweg-EndpunktenGET /admin/dashboard— bestandsweite Kennzahlen in einem AufrufPOST /admin/organizations/{id}/impersonatemit Audit-EintragPOST /member/activity/heartbeat— Präsenzsignal aus der SPAV1.0.20–V1.0.23(Admin-Felder,last_seen_at,member_activity_day,impersonation_audit)SPA
useActivityHeartbeatim 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.