Skip to content

Add the Verktøykasse (VK-01–VK-08, TO-07) - #68

Merged
ugedal1 merged 7 commits into
mainfrom
feat/verktoykasse
Nov 19, 2026
Merged

ugedal1 merged 7 commits into
mainfrom
feat/verktoykasse

Conversation

@ugedal1

@ugedal1 ugedal1 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Adds the Verktøykasse: a library of recommended methods, templates, guides and tools that everyone signed in can browse. Teams register the tools they use from it.

Requirements: VK-01, VK-02, VK-03, VK-04, VK-05, VK-06, VK-07, VK-08, TO-07

CMS

  • New collection, verktoy (Tools.ts). Each tool has:

    • a name;
    • «Verktøytype» (VK-02): a fixed list of Mal, Metode, Veileder and Verktøy. It's a select rather than a collection because nothing else points to it.
    • «Beskrivelse» (VK-03): one field for the short description and the purpose;
    • «Teamtyper» (VK-05): empty when the tool suits every team type;
    • «Lenke til verktøyet» (VK-08): only for tools Digdir has a licence for;
    • «Ressurser» (VK-07): links with a label.

    Everyone signed in reads the tools, and only administrators edit them. Team editors don't see the collection in the menu, but can still pick tools on their team. In the admin panel, each tool lists the teams that use it.

  • Links are checked (utils/links.ts). A link without https://, such as www.figma.com, would otherwise become a broken relative link on our own site, so it's refused with «Lenken må starte med https://». javascript: and similar links are refused too.

  • Teams get «Verktøy teamet bruker» (VK-06). The teameier and teamleder edit it through the access they already have on the team (TO-08).

  • Seed data: the 14 tools from the prototype's TOOLS. Real links are added only where the prototype names a real site. Three teams use some of the tools.

Frontend

  • /verktoy/verktoykasse (VK-01–VK-05): the tools as linked cards, like the team cards, each with its type, name and description.
    • Search covers the name and the description.
    • There are two rows of chips, «Verktøytype» and «Teamtype». A tool with no team types shows under every team type.
  • /verktoy/verktoykasse/[id]: the type, the description, «Passer for», «Åpne verktøyet» when the tool has a link (VK-08), and «Ressurser» (VK-07), with breadcrumbs from the layout.
  • Team page (TO-07): a «Verktøy teamet bruker» card, linking to each tool.
  • Menu: Verktøykasse is now built.
  • ListFilter takes several rows of chips (its own commit). chips is a list of rows, each with a key, and items carry data-filter-<key>. Roller and Teamoversikt move to the new format with one row each and behave as before.
  • The queries leave out the list of teams that use each tool. They send joins: { teams: false }; that list is for the admin panel. The SDK drops joins: false, so turning off just that join is the way to do it.

Tests

  • CMS:
    • Everyone signed in reads tools, with all their parts; nobody reads them when not signed in (NF-11), and integrations can't either.
    • Only administrators create, change and delete tools.
    • Unknown tool types are refused.
    • Each kind of bad link gets the https:// message.
    • The join shows which teams use a tool.
    • VK-06: the teamleder sets their own team's tools but no other team's, and a member can't.
  • Frontend:
    • the list, both rows of chips, search, and the empty states;
    • the tool page, its links and the 404;
    • the team page's tools (TO-07);
    • ListFilter with two rows.

Tried in the running app as teamleder@example.com: the list, tool pages, the team page, and the REST join turned off.

Notes

  • Specification: no changes. This builds VK-01–VK-08 as written. Prototype-only extras, such as the ROS/DPIA badge, «Ansvarlig», «For hvem» and a longer text, are left out until VSU wants them in the spec.
  • Database: this adds the tools table and a teams_rels table for the team's tools. In development, pnpm db:seed:reset fills them.
  • Follow-up: a shared LinkCard component for the linked cards (team, tool, sub-unit, wizard answers), in its own refactor PR after this one is merged.

🤖 Generated with Claude Code

ugedal1 and others added 2 commits November 18, 2026 13:58
The toolbox filters by tool type and by team type at once, so `chips` is
now a list of rows. Each row has a key, and items carry their values for
it in `data-filter-<key>`. An item shows when it matches the chosen chip
in every row. Roller and Teamoversikt move to the new format with one row
each, keyed `type`; they behave as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A library of recommended methods, templates, guides and tools that
everyone signed in can browse, and that teams register their tools from.

- The collection `verktoy` (VK-01–VK-03, VK-05, VK-07, VK-08):
  - name;
  - Verktøytype, a fixed list (Mal, Metode, Veileder, Verktøy);
  - Beskrivelse;
  - the team types the tool suits;
  - a link to the tool where Digdir has a licence;
  - resources.
  Administrators maintain it. Links must be absolute http(s) links.
- Teams get «Verktøy teamet bruker» (VK-06). The teameier and teamleder
  edit it like the rest of the team.
- `/verktoy/verktoykasse` lists the tools as linked cards, with search and
  chips for tool type and team type (VK-04, VK-05).
  `/verktoy/verktoykasse/[id]` shows a tool, its team types, «Åpne
  verktøyet» and its resources.
- The team page shows the tools the team uses (TO-07).
- Seed data: the 14 tools from the prototype. Three teams use some of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ugedal1
ugedal1 marked this pull request as draft November 18, 2026 13:00
ugedal1 and others added 5 commits November 19, 2026 08:00
«Åpne verktøyet» takes the visitor away from ilag, so it is a link, like
the resources under it and the tool links in the prototype. Designsystemet
keeps buttons for actions on the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the conflict with the admin panel's collection groups (#74):
- Verktøy goes in the «Team» group, after the team type wizard, in the
  order main sets.
- The generated types are regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header stays on the page, and «Passer for» and «Ressurser» each get a
neutral card below it. The team types under «Passer for» are light blue
(info), like team types everywhere else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All of a tool's links are now in one card. The tool itself comes first,
as «Åpne <tool>», and the guidance about it follows. «Ingen ressurser er
lenket opp ennå.» shows only when the tool has no links at all. The CMS
keeps the two as separate fields: only the tool link is for tools Digdir
has a licence for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tool itself and the guidance about it are different things, so the
tool's link moves out of «Ressurser» into a small card above it. Only tools
with a link get the card. «Ressurser» has only the guidance links again,
with its own empty text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ugedal1
ugedal1 marked this pull request as ready for review November 19, 2026 08:30
@ugedal1
ugedal1 merged commit c096e2e into main Nov 19, 2026
6 checks passed
@ugedal1
ugedal1 deleted the feat/verktoykasse branch November 19, 2026 08:30
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.

1 participant