digdir / dialogporten

Dialogporten - common API and and metadata state store for digital dialogs
https://docs.altinn.studio/dialogporten
MIT License
1 stars 3 forks source link

Move front channel embeds to content (localized) #856

Closed elsand closed 3 months ago

elsand commented 3 months ago

Introduction

Front channel embeds should be a part of content in order to be localized

Description

As a part of the redesign of the model, front channel embeds are removed from dialog elements and placed within the content-structure

Implementation

Here is a suggestion to how this can be implemented. We add a "mediaType" property to content, which - if recognized and valid - lets arbeidsflate know that this is to be rendered as a front channel embed.

We define some value for "type" which is used for this. This should typically be rendered immediately after "AdditionalInfo"

{ 
    "type": "MainContentReference",
    "mediaType": "application/vnd.dialogporten.frontchannelembed+json;type=markdown", 
    "value": [ { "cultureCode": "nb_NO", "value": "https://someendpoint-supporting-cors-and-dialogtokens.com/somemarkdown_nb.md" } ]
}
### Tasks
- [x] Add type to content-validation
- [x] Add mediaType to content
- [x] Add e2e-test (if relevant)
- [x] Remove all traces of front channel embeds from dialogelement (now transmissions)
- [x] Prepare documentation (if relevant - either update working document, or add a new file in `docs`)
### Threat modelling
- [x] Does this change introduce any potential security issues?

Acceptance criteria

GIVEN ... WHEN .... THEN ...

GIVEN ... WHEN .... THEN ...