-
Notifications
You must be signed in to change notification settings - Fork 4
Add flag to indicate that a dialog should not be visible in portal GUIs such as arbeidsflate #2033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fake news:
Edit:
|
## Description This change introduces a mechanism to indicate that a dialog is API-only, hiding it from portal systems aimed at humans. Key changes: - Add IsApiOnly boolean flag to dialog entity (default false), only for create - Added existing dialog lookup in update command validator - Add IncludeApiOnly query parameter to search endpoints (default true) - Make dialog- and transmission level content for API-only dialogs optional - Add database migration for new column - Add K6 tests to verify functionality ## Related Issue(s) * #2033 ## Verification - [x] **Your** code builds clean without any errors or warnings - [x] Manual testing done (required) - [x] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Ole Jørgen Skogstad <skogstad@softis.net> Co-authored-by: Magnus Sandgren <5285192+MagnusSandgren@users.noreply.github.com>
@elsand burde dette heller vært satt opp slik at GUIs som arbeidsflate slipper å forholde seg til disse. Slik jeg forstår det driver de nå i Altinn/dialogporten-frontend#2056 å oppdaterer ulike søk med "ExcludeApiOnly = true". Det betyr at et hvert frontend må ha dette kriteriet med i alle søk. |
Nei, disse dialogene må være default inkludert mht til discoverability. Generiske GUI-er som Arbeidsflate er den minst utbredte typen SBS - det vil være vesentlige flere fagsystemer og andre integrasjoner som vil kunne ha interesse av denne type dialoger. |
Mistenkte noe slikt. Legger merke til at du sider "det vil være" og ikke "det er". Så dette er noe man vil onboarde på, men som ikke er like utbredt i dag? |
Stemmer, dette er såvidt meg bekjent ikke brukt av noen i dag. |
Test (via arbeidsflate)Arbeidsflate kan kun teste at de med false inkluderes og de med true eksluderes. Opprettet disse to:
I arbeidsflate vises nå kun den med "isApiOnly": false på grunn av filter
|
Test (via Postman)TC-100 - Filtering API-only dialogs in search results🟢 Test via arbeidsflate oppdatert med logikk for 🟢 Dette kallet inkluderer kun de med false:
TC-200 - Retrieving API-only dialogs in search results (by request)
🟢 Dette kallet inkluderer rubbel og bit av både true og false:
TC-250 - Retrieving API-only dialogs in search results (default)🟢 Test via Postman med gamle kall der parameter ikke amgis gir begge varianter (true og false) i retur. TC-250 - Retrieving API-only dialogs in search results (don't care)🟢 Å angi parameter spesifikt til null som i kommentar (ExcludeApiOnly=null: Gi meg begge (apiOnly=true/false))
TC-300 - Creating an API-only dialog🟢 Å opprette en ny dialog med "isApiOnly":true, fungerer. TC-400 - Updating an existing dialog to API-only (=negativ test, skal gi feilmelding)🟡 Å gjøre UPDATE fra "isApiOnly": false til "isApiOnly": true medfører ingenting.
TC-500 - Preventing unnecessary content for API-only dialogs🔴 Selv om "isApiOnly":true forlanger dialogporten: |
@MagnusSandgren kan du se om denne er implenentert rett? Eller om jeg har tolket forventet resultat feil?
Er det ment at selve parameteret alltid må være angitt men at de kan være tom streng eller null hvis isApiOnly=true Problemet er det samme om man kun utelater en av de to som skal kunne utelates. |
Oppdatert akseptkritereScenario: Preventing unnecessary content for API-only dialogs Test - TC 500Negativ test - isApiOnly=falsePositiv test - isApiOnly=true🟢 isApiOnly=true tillater at hele "content" sløyfes. |
Uh oh!
There was an error while loading. Please reload this page.
Introduction
Some dialogs are meant for API consumption only, and is not appropiate for GUIs such as arbeidsflate
Description
Altinn 3 instances can be configured to not have any "message box" representation, ie. not be visible in Altinn 2 Innboks. The Dialogporten Storage Adapter will consider this flag, and not make dialogs at all.
A need has been put forward from a service owner (not utilizing Altinn Studio) to similarly create dialogs referring to API services at its own platform and flag those such that they are not visible in Arbeidsflate. A mechanism to indicate that a given dialog is "API-only" could be used by the Storage Adapter as well, to allow EUS-es to still utilize the generic mechanisms via Dialogporten (eg. create/updated events).
Dialogs that are API-only should be easily filtered out by Arbeidsflate and similar systems, and should not require human-readable content (title and summary) to be set.
Implementation
This is likely most easily solved by a top-level bool flag, "isApiOnly", which is default false. Filtering should be a bool query parameter available on both SO and EU search endpoints, "ExcludeApiOnly" which is default false
All DTOs should include the flag.
Tasks
Threat Modelling
Acceptance criteria
Scenario: Filtering API-only dialogs in search results
GIVEN a request is made to search for dialogs
WHEN the query parameter
ExcludeApiOnly=true
is providedTHEN dialogs with
isApiOnly=true
are excluded from the resultsScenario: Retrieving API-only dialogs in search results
GIVEN a request is made to search for dialogs
WHEN the query parameter
ExcludeApiOnly=false
is provided (or omitted)THEN dialogs with
isApiOnly=true
are included in the resultsScenario: Creating an API-only dialog
GIVEN a request is made to create a new dialog
WHEN the
isApiOnly
flag is set totrue
THEN the dialog is stored with
isApiOnly=true
Scenario: Updating an existing dialog to API-onlyGIVEN an existing dialog with
isApiOnly=false
WHEN it is updated with
isApiOnly=true
THEN the updated dialog is stored with
isApiOnly=true
(Requirement changed, flipping this flag not allowed)
Scenario: Preventing unnecessary content for API-only dialogs
GIVEN a new dialog is created with
isApiOnly=true
WHEN no title or summary is provided
THEN the request is accepted and stored without requiring human-readable content
GIVEN a migration is run on an existing database
WHEN the schema is updated
THEN existing dialogs should have
isApiOnly
set tofalse
by defaultThe text was updated successfully, but these errors were encountered: