Skip to content

Commit

Permalink
Cleaning up AddressComponent -> Address (for v4) and some other minor…
Browse files Browse the repository at this point in the history
… issues (#1473)

* Cleaning up AddressComponent -> Address (for v4)

* Fixing links to (and very long link titles for) code lists/options from repeating groups

* The data has a type, not the instance

* Adding missing schema references, adding space between "```json" and the props (which will fix missing schema validation in IntelliJ)

* Fixing some broken links/anchors

* Removing missing screenshot reference.

* Fixing some schema references, invalid component IDs ('name-1' is invalid in a layout, as it can be confused with components in repeating groups)

* Fixing figma prototyping broken link

---------

Co-authored-by: Ole Martin Handeland <[email protected]>
  • Loading branch information
olemartinorg and Ole Martin Handeland authored Mar 19, 2024
1 parent fdf6ac9 commit 23a8c23
Show file tree
Hide file tree
Showing 45 changed files with 968 additions and 926 deletions.
3 changes: 1 addition & 2 deletions content/app/app-dev-course-v2/modul2/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ Ja, en standardkomponent med forhåndsutfylt data vil i utgangspunktet være red

{{% expandsmall id="m2t2q2" header="Hvordan kan man hindre at en forhåndsutfylt verdi endres av sluttbrukeren?" %}}

Komponenten kan settes til `readOnly` ved å huke av ved "Det skal ikke være mulig å svare (read only)" for den aktuelle komponenten i Altinn Studio:
![Altinn Studio innstilling for 'read only'. Bilde](<screenshot-readonly-setting.png>)
Komponenten kan settes til `readOnly` ved å huke av ved "Det skal ikke være mulig å svare (read only)" for den aktuelle komponenten i Altinn Studio.


Alternativt kan man kjøre valideringer av dataen på serversiden for å verifisere at dataen i feltet matcher dataen fra forhåndsutfyllingskilden. Dette kan gjøres i prosesserings- eller valideringslogikken til applikasjonen.
Expand Down
3 changes: 1 addition & 2 deletions content/app/app-dev-course-v2/modul2/index.nb.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ Ja, en standardkomponent med forhåndsutfylt data vil i utgangspunktet være red

{{% expandsmall id="m2t2q2" header="Hvordan kan man hindre at en forhåndsutfylt verdi endres av sluttbrukeren?" %}}

Komponenten kan settes til `readOnly` ved å huke av ved "Det skal ikke være mulig å svare (read only)" for den aktuelle komponenten i Altinn Studio:
![Altinn Studio innstilling for 'read only'. Bilde](<screenshot-readonly-setting.png>)
Komponenten kan settes til `readOnly` ved å huke av ved "Det skal ikke være mulig å svare (read only)" for den aktuelle komponenten i Altinn Studio.


Alternativt kan man kjøre valideringer av dataen på serversiden for å verifisere at dataen i feltet matcher dataen fra forhåndsutfyllingskilden. Dette kan gjøres i prosesserings- eller valideringslogikken til applikasjonen.
Expand Down
2 changes: 1 addition & 1 deletion content/app/app-dev-course-v2/modul4/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tags: [apps, training, options, kodelister, dynamikk ]
weight: 40
---

I denne modulen skal du utvide applikasjonen du har laget i foregående moduler for å støtte enda fler av [kravene til Sogndal kommune](../case/#krav-fra-kommunen).
I denne modulen skal du utvide applikasjonen du har laget i foregående moduler for å støtte enda fler av [kravene til Sogndal kommune](../case/#requirements-from-the-municipality).

**Temaer som dekkes i denne modulen:**

Expand Down
1 change: 1 addition & 0 deletions content/app/app-dev-course-v2/modul4/_index.nb.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ weight: 40

I denne modulen skal du utvide applikasjonen du har laget i foregående moduler for å støtte enda fler av [kravene til Sogndal kommune](../case/#krav-fra-kommunen).


**Temaer som dekkes i denne modulen:**

- Kodelister/Options
Expand Down
17 changes: 8 additions & 9 deletions content/app/app-dev-course/modul1/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ App/config/texts/resources.en.json

```json
{
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/text-resources/text-resources.schema.v1.json",
"language": "en",
"resources": []
}
Expand Down Expand Up @@ -237,7 +238,7 @@ You will find the field name connected to the component under `dataModelBindings
App/ui/layouts/{page}.json
{{< /code-title >}}

```json{linenos=false,hl_lines="7"}
```json {linenos=false,hl_lines="7"}
{
...

Expand Down Expand Up @@ -269,7 +270,7 @@ The solution is to change the `type` field from `Input` to `TextArea` (highlight
App/ui/layouts/{page}.json
{{< /code-title >}}

```json{linenos=false,hl_lines="3"}
```json {linenos=false,hl_lines="3"}
{
"id": "mellomnavn",
"type": "TextArea",
Expand Down Expand Up @@ -323,6 +324,7 @@ App/config/texts/resource.nb.json

```json
{
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/text-resources/text-resources.schema.v1.json",
"language": "nb",
"resources": [
{
Expand Down Expand Up @@ -422,7 +424,7 @@ App/ui/layouts/innflytterPersonalia.json

```json
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4//schemas/json/layout/layout.schema.v1.json",
"data": {
"layout": [
{
Expand Down Expand Up @@ -474,8 +476,8 @@ App/ui/layouts/innflytterPersonalia.json
}
},
{
"id": "addressComponent",
"type": "AddressComponent",
"id": "address",
"type": "Address",
"dataModelBindings": {
"address": "Innflytter.Adresse.Gateadresse",
"zipCode": "Innflytter.Adresse.Postnr",
Expand Down Expand Up @@ -512,10 +514,7 @@ App/ui/layouts/innflytterPersonalia.json
{
"id": "NavigationButtons-yxdxMR",
"type": "NavigationButtons",
"componentType": "NavigationButtons",
"dataModelBindings": {},
"showBackButton": true,
"textResourceBindings": {}
"showBackButton": true
}
]
}
Expand Down
16 changes: 7 additions & 9 deletions content/app/app-dev-course/modul1/_index.nb.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ App/config/texts/resources.en.json

```json
{
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/text-resources/text-resources.schema.v1.json",
"language": "en",
"resources": []
}
Expand Down Expand Up @@ -237,7 +238,7 @@ Navnet på feltet som komponenten er koblet til finner du under `dataModelBindin
App/ui/layouts/{page}.json
{{< /code-title >}}

```json{linenos=false,hl_lines="7"}
```json {linenos=false,hl_lines="7"}
{
...

Expand Down Expand Up @@ -269,7 +270,7 @@ Løsningen er å endre `type`-feltet fra `Input` til `TextArea` (markert).
App/ui/layouts/{page}.json
{{< /code-title >}}

```json{linenos=false,hl_lines="3"}
```json {linenos=false,hl_lines="3"}
{
"id": "mellomnavn",
"type": "TextArea",
Expand Down Expand Up @@ -422,7 +423,7 @@ App/ui/layouts/innflytterPersonalia.json

```json
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4//schemas/json/layout/layout.schema.v1.json",
"data": {
"layout": [
{
Expand Down Expand Up @@ -474,8 +475,8 @@ App/ui/layouts/innflytterPersonalia.json
}
},
{
"id": "addressComponent",
"type": "AddressComponent",
"id": "address",
"type": "Address",
"dataModelBindings": {
"address": "Innflytter.Adresse.Gateadresse",
"zipCode": "Innflytter.Adresse.Postnr",
Expand Down Expand Up @@ -512,10 +513,7 @@ App/ui/layouts/innflytterPersonalia.json
{
"id": "NavigationButtons-yxdxMR",
"type": "NavigationButtons",
"componentType": "NavigationButtons",
"dataModelBindings": {},
"showBackButton": true,
"textResourceBindings": {}
"showBackButton": true
}
]
}
Expand Down
63 changes: 30 additions & 33 deletions content/app/app-dev-course/modul2/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ You can set the component to `readOnly` in one of two ways:
App/ui/layouts/{page}.json
{{< /code-title >}}

```json{linenos=false,hl_lines=["12"]}
```json {linenos=false,hl_lines=["12"]}
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json",
"data": {
"layout": [
{
Expand Down Expand Up @@ -395,9 +395,9 @@ We have placed the image and heading side by side using the `grid` property (hig
App/ui/layouts/info.json
{{< /code-title >}}

```json{linenos=false,hl_lines=["15-17", "28-30"]}
```json {linenos=false,hl_lines=["15-17", "28-30"]}
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json",
"data": {
"layout": [
{
Expand Down Expand Up @@ -437,8 +437,6 @@ App/ui/layouts/info.json
{
"id": "NavigationButtons-hateTR",
"type": "NavigationButtons",
"componentType": "NavigationButtons",
"dataModelBindings": {},
"showBackButton": true,
"textResourceBindings": {
"next": "navigation.next",
Expand All @@ -458,6 +456,7 @@ App/config/texts/resource.nb.json

```json
{
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/text-resources/text-resources.schema.v1.json",
"language": "nb",
"resources": [
...
Expand Down Expand Up @@ -528,9 +527,9 @@ New page for *Track 1*.
App/ui/layouts/info.json
{{< /code-title >}}

```json{linenos=false,hl_lines=["6-27"]}
```json {linenos=false,hl_lines=["6-27"]}
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json",
"data": {
"layout": [
...
Expand Down Expand Up @@ -575,9 +574,9 @@ As an option, you can test the value of the field directly (`["dataModel", "Innf
App/ui/layouts/ikke-for-deg.json
{{< /code-title >}}

```json{linenos=false,hl_lines="4-11"}
```json {linenos=false,hl_lines="4-11"}
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json",
"data": {
"hidden": [
"equals",
Expand All @@ -598,8 +597,6 @@ App/ui/layouts/ikke-for-deg.json
{
"id": "NavigationButtons-azt7sj",
"type": "NavigationButtons",
"componentType": "NavigationButtons",
"dataModelBindings": {},
"showBackButton": true,
"textResourceBindings": {
"back": "navigation.back"
Expand All @@ -617,9 +614,9 @@ This page will be hidden when the option for *not* meeting the service requireme
App/ui/layouts/innflytterPersonalia.json
{{< /code-title >}}

```json{linenos=false,hl_lines=["4-11"]}
```json {linenos=false,hl_lines=["4-11"]}
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json",
"data": {
"hidden": [
"equals",
Expand All @@ -645,9 +642,9 @@ Configure the `excludeFromPdf` property in `Settings.json` to exclude pages from
App/Settings.json
{{< /code-title >}}

```json{linenos=false,hl_lines="9"}
```json {linenos=false,hl_lines="9"}
{
"$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layoutSettings.schema.v1.json",
"pages": {
"order": [
"info",
Expand All @@ -667,8 +664,9 @@ New text resources:
App/config/texts/resource.nb.json
{{< /code-title >}}

```json{linenos=false,hl_lines=["5-20"]}
```json {linenos=false,hl_lines=["5-20"]}
{
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/text-resources/text-resources.schema.v1.json",
"language": "nb",
"resources": [
...
Expand Down Expand Up @@ -741,9 +739,9 @@ For a complete solution, please refer to the [Module 2 source code](https://alti
App/ui/layouts/innflytterPersonalia.json
{{< /code-title >}}

```json{linenos=false,hl_lines=["20", "24-26", "35", "39-41", "45-52"]}
```json {linenos=false,hl_lines=["20", "24-26", "35", "39-41", "45-52"]}
{
"$schema": "https://altinncdn.no/schemas/json/layout/layout.schema.v1.json",
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json",
"data": {
"hidden": [
"equals",
Expand Down Expand Up @@ -808,21 +806,20 @@ We have created a prefill file, `datamodel.prefill.json`, and configured prefill
App/models/datamodel.prefill.json
{{< /code-title >}}

```json{linenos=false,hl_lines=[""]}
```json {linenos=false,hl_lines=[""]}
{
"$schema": "https://altinncdn.no/schemas/json/prefill/prefill.schema.v1.json",
"allowOverwrite": true,
"ER": {
},
"DSF": {
"FirstName": "Innflytter.Fornavn",
"MiddleName": "Innflytter.Mellomnavn",
"LastName": "Innflytter.Etternavn",
"TelephoneNumber": "Innflytter.Kontaktinformasjon.Telefonnummer"
},
"UserProfile": {
"Email": "Innflytter.Kontaktinformasjon.Epost"
}
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/prefill/prefill.schema.v1.json",
"allowOverwrite": true,
"ER": {},
"DSF": {
"FirstName": "Innflytter.Fornavn",
"MiddleName": "Innflytter.Mellomnavn",
"LastName": "Innflytter.Etternavn",
"TelephoneNumber": "Innflytter.Kontaktinformasjon.Telefonnummer"
},
"UserProfile": {
"Email": "Innflytter.Kontaktinformasjon.Epost"
}
}
```

Expand Down
Loading

0 comments on commit 23a8c23

Please sign in to comment.