Skip to content

Commit

Permalink
Use new table component in repeating groups (#650)
Browse files Browse the repository at this point in the history
* first step

* visuals

* error styling

* improved desktop layout

* of course safari has an edge-case for exactly 0 width 😤

* missing space

* fix width

* make nested group look good

* smaller padding for nested group

* column alignment

* update icon

* update design-system

* wcag

* mobile layout

* remove empty columns and fix group tests

* fix editRowIndex

* spacing (mobile)

* remove reference to altinn-mobile-table in unit test

* fix colspan

* fix french button

* Updating broken import

* move to fullwidthwrapper

Co-authored-by: Ole Martin Handeland <git@olemartin.org>
  • Loading branch information
bjosttveit and Ole Martin Handeland authored Dec 9, 2022
1 parent 1f7b7bf commit 08f73bc
Show file tree
Hide file tree
Showing 23 changed files with 696 additions and 699 deletions.
9 changes: 2 additions & 7 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"ignore": [
"/**/*.json"
]
"presets": ["@babel/preset-env", "@babel/preset-react"],
"ignore": ["/**/*.json"]
}
3 changes: 1 addition & 2 deletions cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ These instructions will get you run the integration tests on altinn-app-frontend
yarn --immutable # only needed first time, or when dependencies are updated
```

If you are running locally you need a copy of [altinn-studio](https://github.com/altinn/altinn-studio).
- Make sure you have followed instructions on [running apps locally](https://github.com/Altinn/altinn-studio/blob/5c05d4c32be1b24ddd5af9ddd661b2c78f65aad4/LOCALAPP.md).
If you are running locally you need a copy of [altinn-studio](https://github.com/altinn/altinn-studio). - Make sure you have followed instructions on [running apps locally](https://github.com/Altinn/altinn-studio/blob/5c05d4c32be1b24ddd5af9ddd661b2c78f65aad4/LOCALAPP.md).

### Test data prerequisite

Expand Down
78 changes: 39 additions & 39 deletions cypress/e2e/fixtures/allowed-parties.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
[
[
{
"partyId": 500000,
"partyTypeName": 2,
"orgNumber": "897069650",
"ssn": null,
"unitType": "AS",
"name": "DDG Fitness AS",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organization": null,
"childParties": [
{
"partyId": 500001,
"partyTypeName": 2,
"orgNumber": "897069651",
"ssn": null,
"unitType": "BEDR",
"name": "DDG Fitness Bergen",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organization": null,
"childParties": null
}
]
"partyId": 500000,
"partyTypeName": 2,
"orgNumber": "897069650",
"ssn": null,
"unitType": "AS",
"name": "DDG Fitness AS",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organization": null,
"childParties": [
{
"partyId": 500001,
"partyTypeName": 2,
"orgNumber": "897069651",
"ssn": null,
"unitType": "BEDR",
"name": "DDG Fitness Bergen",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organization": null,
"childParties": null
}
]
},
{
"partyId": 500600,
"partyTypeName": 2,
"orgNumber": "897069631",
"ssn": null,
"unitType": "AS",
"name": "EAS Health Consulting",
"isDeleted": true,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organization": null,
"childParties": []
}
]
"partyId": 500600,
"partyTypeName": 2,
"orgNumber": "897069631",
"ssn": null,
"unitType": "AS",
"name": "EAS Health Consulting",
"isDeleted": true,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organization": null,
"childParties": []
}
]
6 changes: 3 additions & 3 deletions cypress/e2e/fixtures/attachment.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "326e50d6-befd-445d-a2d2-999e411748c0",
"id": "326e50d6-befd-445d-a2d2-999e411748c0",
"dataType": "fileUpload-message",
"filename": "test.pdf",
"contentType": "application/pdf",
"contentType": "application/pdf",
"selfLinks": {
"apps": "https://altinn3local.no/ttd/frontend-test/instances/"
"apps": "https://altinn3local.no/ttd/frontend-test/instances/"
},
"size": 4,
"locked": false,
Expand Down
12 changes: 4 additions & 8 deletions cypress/e2e/pageobjects/app-frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ export default class AppFrontend {
rows: [0, 1].map((idx) => ({
uploadSingle: makeUploaderSelectors('mainUploaderSingle', idx, 3),
uploadMulti: makeUploaderSelectors('mainUploaderMulti', idx, 4),
editBtn: `#group-mainGroup-table-body > tr:nth-child(${idx + 1}) > td:nth-last-of-type(2n) > div > button`,
deleteBtn: `#group-mainGroup-table-body > tr:nth-child(${idx + 1}) > td:last-of-type > div > button`,
editBtn: `#group-mainGroup-table-body > tr:nth-child(${idx + 1}) > td:nth-last-of-type(2n) button`,
deleteBtn: `#group-mainGroup-table-body > tr:nth-child(${idx + 1}) > td:last-of-type button`,
nestedGroup: {
rows: [0, 1].map((subIdx) => ({
uploadTagMulti: makeUploaderSelectors('subUploader', `${idx}-${subIdx}`, 2, true),
Expand All @@ -208,12 +208,8 @@ export default class AppFrontend {
`#nestedOptions-${idx}-${subIdx} input[type=checkbox]:nth(1)`,
`#nestedOptions-${idx}-${subIdx} input[type=checkbox]:nth(2)`,
],
editBtn: `#group-subGroup-${idx}-table-body > tr:nth-child(${
subIdx + 1
}) > td:nth-last-of-type(2n) > div > button`,
deleteBtn: `#group-subGroup-${idx}-table-body > tr:nth-child(${
subIdx + 1
}) > td:last-of-type > div > button`,
editBtn: `#group-subGroup-${idx}-table-body > tr:nth-child(${subIdx + 1}) > td:nth-last-of-type(2n) button`,
deleteBtn: `#group-subGroup-${idx}-table-body > tr:nth-child(${subIdx + 1}) > td:last-of-type button`,
})),
groupContainer: `#group-subGroup-${idx}`,
saveBtn: `#add-button-grp-subGroup-${idx}`,
Expand Down
Loading

0 comments on commit 08f73bc

Please sign in to comment.