Skip to content

feat: tilføj kommune- og datafølsomhedsfilter til kataloget - #226

Open
martinydeAI wants to merge 1 commit into
developfrom
feature/issue-225-catalog-filters
Open

feat: tilføj kommune- og datafølsomhedsfilter til kataloget#226
martinydeAI wants to merge 1 commit into
developfrom
feature/issue-225-catalog-filters

Conversation

@martinydeAI

Copy link
Copy Markdown
Collaborator

Links to issues

Closes #225

Leantime tickets: 8213, 8220.

Description

8220 — Kommune filter. Kommune is the most obvious way into the catalogue
(a caseworker looks for what a comparable municipality already solved) and there
was no way to filter on it.

8213 — Datafølsomhed filter + duplicate chips. The classification was shown
on every assistant without being filterable, and the two chips in the detail
header repeated what the meta aside already says.

  • Both facets follow the recipe CatalogCriteria documents on itself, and are
    appended after the tag facet so existing chip positions are untouched.
  • Kommune groups on the organisation name, keeping URLs readable.
  • Datafølsomhed keys on the enum backing value and renders the translated
    label, so nobody is shown ordinary_personal.
  • The framework and data-sensitivity chips are gone from
    templates/assistant/show.html.twig. The assistant's own tags are unaffected
    and still render in the Beskrivelse tab.

Screenshot of the result

Not included — the catalogue and detail pages sit behind authentication and I
could not drive the stateless-CSRF login from the sandbox. The filter rail
gains two groups and the detail header loses a row, so a reviewer should look
at both pages.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

Markdown lint could not be run locally: itkdev/markdownlint's arm64 manifest
entry contains x86-64 binaries, so the container exits with exec format error
on aarch64. CI will cover it.


Details - AI specificities

Merge order. This PR deletes templates/assistant/show.html.twig:39-66.
PR #222 rewrites that block's comment and PR #224 adds no_personal
to its colour map, so both will conflict here. Merge this one last; the
resolution is to keep the deletion. Nothing else in either PR overlaps.

Two deliberate behaviours, both pinned by tests:

  • Assistants with no organisation contribute to no kommune bucket — the inner
    join drops them, exactly as an untagged assistant behaves in the tag facet.
    The fixture baseline has 21 assistants but only 9 with an organisation, so
    the bucket total is intentionally below the catalogue size.
  • An unrecognised ?data_sensitivity[]= value (hand-edited URL) falls back to
    displaying itself rather than rendering a blank chip.

Chip labels now pass through |trans. The sensitivity chip carries the
enum's translation key; every other facet's label is already the raw value, and
trans returns an unknown id unchanged, so this is a no-op for them.

dataSensitivityFacetCounts() normalises its own hydration. Array hydration
of an enumType column has returned both the case and the backing string across
ORM versions, so the method handles either rather than assuming.

Test changes (approved in advance):

  • AssistantControllerTest:63 — the one existing assertion that moved. It
    asserted 'Fortrolige data' appears inside <article>, which was the removed
    header pill. It now asserts both labels are absent from the article; the same
    test already checks the aside separately via $runtime, so aside coverage is
    unchanged.
  • CatalogCriteriaTest and AssistantRepositoryTest — additive only, six and
    five new methods covering the facets, chip ordering, removal maths, and the
    fallback above.

Verification. task test — 701 tests, 2075 assertions, green (up 11).
task test-coverage is 100% once src/DataFixtures/LocalUserFixtures.php is
excluded; that file is gitignored and untracked, so it does not exist in CI.
PHP CS Fixer, Twig CS Fixer, and Prettier all pass.

Non-goals. 8217 (missing kommune name on one assistant, purge test data) is
the remaining Catalog ticket and is not addressed here.

Kommune er det mest oplagte udgangspunkt når en medarbejder
leder efter noget en anden kommune allerede har løst, men man
kunne ikke filtrere på det. Datafølsomhed blev vist på hver
assistent uden at kunne filtreres på.

Begge facetter følger den opskrift CatalogCriteria selv
dokumenterer, og lægges efter tag-facetten, så eksisterende
chip-rækkefølge er uændret. Kommune-facetten grupperer på
organisationens navn, så URL'erne forbliver læsbare;
assistenter uden organisation falder ud af joinet — samme
adfærd som en assistent uden tags har i dag.
Datafølsomheds-facetten grupperer på enum-værdien og oversætter
labelen, så ingen får vist "ordinary_personal".

Samtidig fjernes de to øverste chips fra detaljesidens header.
Både rammeværk og datafølsomhed står allerede i meta-asiden i
højre side, så headeren gentog sig selv. Assistentens egne tags
er urørte og vises fortsat i Beskrivelse-fanen.

Refs #225

Co-Authored-By: Claude Opus 5 (1M context) <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.

task: tilføj kommune- og datafølsomhedsfilter, ryd op i detaljesidens chips

1 participant