Altinn / Altinn/app-frontend-react

Nested isCompact in Summary2

Open
#2,643 0 comments 0 reactions 0 assignees View on GitHub
area/summary kind/feature-request
Dominant language
TypeScript
Stars
21
Forks
33
Avg merge
6d 23h
Merged PRs (30d)
3

Description

As a Service Owner I want to be able to customize what components will be shown as compact.

Context

Today we support setting isCompact like this:

```
{
"id": "MySummary2ID",
"type": "Summary2",
"target": {
"type": "component",
"id": "MyComponentID"
},
"isCompact": true,
"overrides": [
{
"componentId": "MyComponentID",
"displayType": "list"
},
{
"componentId": "MyComponentID2",
"displayType": "string"
}
],
}
```

This will set isCompact to the whole summary.
There is a need also be able to set isCompact for individual components, or exclkude isCompact for certian components.

We therefore suggest implementing isCompact in overrides like this:

```
{
"id": "MySummary2ID",
"type": "Summary2",
"target": {
"type": "component",
"id": "MyComponentID"
},
"isCompact": true,
"overrides": [
{
"componentId": "MyComponentID",
"displayType": "list",
"isCompact": false,
},
{
"componentId": "MyComponentID2",
"displayType": "string"
}
],
}
```

In this case, the override will supersede the component isCompact.

This means you could also set isCompact for a single component only:

```
{
"id": "MySummary2ID",
"type": "Summary2",
"target": {
"type": "component",
"id": "MyComponentID"
}
"overrides": [
{
"componentId": "MyComponentID",
"displayType": "list",
"isCompact": true,
},
{
"componentId": "MyComponentID2",
"displayType": "string"
}
],
}
```

Acceptance critereas

- [ ] Possible to set isCompact in overrides
- [ ] isCompact in override supersedes isCompact in component
- [ ] isCompact in component allows setting isCompact for individual components

Contributor guide

Open the contributing guide

Research direction

Start by locating the Summary2 implementation and the handling of its overrides. Trace how component and summary-level isCompact values are resolved, then add coverage showing that override values take precedence and that individual components can set isCompact; done means all three acceptance criteria pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.