Altinn / Altinn/app-lib-dotnet

Support for dynamic layouts

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
kind/feature-request
Dominant language
C#
Stars
8
Forks
27
Avg merge
1h 21m
Merged PRs (30d)
7

Description

### Description

Currently, layout sets and layout files (`.json`) are static files on disk, as these files are what Studio generates and puts into your app repo when using the Designer app.

This functionality is great for most apps, but some need more advanced functionality. Having an option in your app to provide dynamically generated layout files could solve lots of advanced use-cases, and exposing such functionality could also make our components simpler. One example here is the Likert component, which relies on fetching the actual questions from more dynamic structures (be it dynamic options, or the data model). It should be possible to declare a 'static'/simple Likert component, and possibly move more advanced needs into implementing a dynamically generated layout.

It should also be considered if supporting dynamic layout sets/layout settings is needed.

When it comes to implementation, I think (or hope) this could be as simple as exposing an option to implement a `LayoutHandler` (?) which intercepts requests to some layouts and returns a generated one instead. It should also be possible to read a static `.json` file from this code and extend the layout with something dynamic (that way Studio could still work for the static parts).

### Relevant links:
- https://altinndevops.slack.com/archives/C045EB3JA9X/p1665583127068159

Contributor guide

Open the contributing guide

Research direction

No implementation files or tests are identified. Start by locating how static layout sets and .json layout files are loaded, then investigate where a proposed LayoutHandler could intercept or extend them. Done would mean apps can provide generated layouts while retaining support for static files, with the need for dynamic layout sets or settings resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.