Skip to content
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

updated summary2 docs #1802

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions content/altinn-studio/reference/ux/components/Summary2/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,12 @@ It is also possible to render a summary of an entire layoutSet. In this case, yo
"id": "MySummary2ID",
"type": "Summary2",
"target": {
"type": "layoutSet",
"id": "MyLayoutSet"
"type": "layoutSet"
}
}
```

In this case, you would have a layoutSet called ```MyLayoutSet``` in your project.
This would render a summary of all the pages and components in the layoutSet.
This would render a summary of all the pages and components in the layoutSet, in the current task.

#### Rendering summaries of previous tasks

Expand All @@ -107,10 +105,31 @@ To do this, simply specify the ```target.taskId``` like so:

The behaviour is exactly like before with regard to ```target.type``` and ```target.id```, except that a ```taskId``` property has been added.

### Hide empty fields

It is possible to hide fields that have not been filled out by the user by setting the property ```hideEmptyFields```:

```json{hl_lines="6-"}
{
"id": "MySummary2ID",
"type": "Summary2",
"hideEmptyFields": true,
"target": {
"type": "component",
"id": "MyComponentID"
}
}
```

Note that fields that are set to required will still be shown even if they are empty.

### Overrides

For each component in your summary, you can configure different overrides to suit your needs.

If you are rendering a page, layoutSet or a component with children (group, accordion etc.), you can target their children
components in the same way, using the ID of the child component.

To configure an override, use the override field of the Summary2 component like so:

```json{hl_lines="6-"}
Expand Down Expand Up @@ -138,7 +157,6 @@ Here are the overrides that are common for all components:
| hidden | boolean | no | Exclude the component from summary |
| forceShow | boolean | no | Will force show the component in a summary even if hideEmptyFields is set to true in the summary component. |
| emptyFieldText | string | no | Custom text to show for empty fields. |
| hideEmptyFields | boolean | no | Exclude empty fields for summary. Only works if the field is not required. |

In addition, a few components support component-specific overrides:

Expand All @@ -148,8 +166,3 @@ In addition, a few components support component-specific overrides:
|-----------------|----------------------------|----------|-----------------------------------------|
| displayType | enum: ```list \| string``` | no | Display the summary as a list or string |

#### Group

| Parameter | Type | Required | Description |
|-----------------|---------|----------|-----------------------------------------------|
| isCompact | boolean | no | Option to display a compact version of groups |
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ Det er også mulig å vise en oppsummering av et helt layoutSet. I dette tilfell
"id": "MySummary2ID",
"type": "Summary2",
"target": {
"type": "layoutSet",
"id": "MyLayoutSet"
"type": "layoutSet"
}
}
```

I dette tilfellet må du ha et layoutSet kalt ```MyLayoutSet``` i prosjektet ditt. Dette vil vise en oppsummering av alle sidene og komponentene i layoutSet-et du peker på.
Dette vil vise en oppsummering av alle sidene og komponentene i layoutSet-et du peker på, i inneværende task.

#### Vise oppsummeringer av tidligere oppgaver

Expand All @@ -106,10 +105,30 @@ For å gjøre dette, spesifiserer du ganske enkelt ```target.taskId``` slik:

Konfigurasjonen er nøyaktig som før med hensyn til ```target.type``` og ```target.id```, bortsett fra at du i tillegg spesifiserer ```taskId```.

### Skjul tomme felt

Det er mulig å skjule felt som ikke er fylt ut av brukeren ved å sette egenskapen ```hideEmptyFields```:

```json{hl_lines="6-"}
{
"id": "MySummary2ID",
"type": "Summary2",
"hideEmptyFields": true,
"target": {
"type": "component",
"id": "MyComponentID"
}
}
```

Merk at felt som er satt til påkrevd vil fortsatt vises, selv om de er tomme.

### Overstyringer

For hver komponent i oppsummeringen din kan du konfigurere forskjellige overstyringer for å passe dine behov.

Hvis du renderer en side, layoutSet eller en komponent med underkomponenter (gruppe, accordion, osv.), kan du overstyre underkomponentene på samme måte, ved å bruke ID-en til underkomponenten.

For å konfigurere en overstyring, bruk ```overrides```-feltet til Summary2-komponenten slik:

```json{hl_lines="6-"}
Expand Down Expand Up @@ -137,7 +156,6 @@ Her er overstyringene som er felles for alle komponenter:
| hidden | boolean | nei | Ekskluder komponenten fra oppsummeringen |
| forceShow | boolean | nei | Vil tvangsvise komponenten i en oppsummering selv om hideEmptyFields er satt til true i oppsummeringskomponenten. |
| emptyFieldText | string | nei | Egendefinert tekst som skal vises for tomme felt. |
| hideEmptyFields | boolean | nei | Ekskluder tomme felt fra oppsummeringen. Fungerer bare hvis feltet ikke er påkrevd. |

I tillegg støtter noen komponenter komponentspesifikke overstyringer:

Expand All @@ -147,8 +165,3 @@ I tillegg støtter noen komponenter komponentspesifikke overstyringer:
|-----------------|----------------------------|---------|------------------------------------------|
| displayType | enum: ```list \| string``` | nei | Vis oppsummeringen som en liste eller streng |

#### Group

| Parameter | Type | Påkrevd | Beskrivelse |
|-----------------|---------|---------|-----------------------------------------------|
| isCompact | boolean | nei | Mulighet for å vise en kompakt versjon av grupper |