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

Grid component #1118

Merged
merged 83 commits into from
Apr 26, 2023
Merged

Grid component #1118

merged 83 commits into from
Apr 26, 2023

Conversation

olemartinorg
Copy link
Contributor

Description

Here comes the Grid component! This component allows you to arrange static components as a table, where each cell can contain either text or a component reference. The number of rows and columns are fixed, according to what is configured in the layout, so this is not an alternative to repeating groups (where the number of rows are affected by user actions). In contrast to repeating groups, each row here can contain wildly different components (and rows can be styled as header rows or readOnly rows).

grid

More information, and configuration details for this component can soon be found in the documentation.

Important: This feature brings with it many changes to the frontend-test app, so until this PR is merged, many of our Cypress tests will be failing when testing on tt02. Sorry for blocking other PRs with this noise!

Related Issue(s)

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
  • Changes/additions to component properties
    • Changes are reflected in both src/layout/layout.d.ts and layout.schema.v1.json, and these are all backwards-compatible
    • No changes made
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Ole Martin Handeland added 30 commits February 27, 2023 10:07
…, this should be `ExprVal.String`, but that won't work great with the expression defaults, the way they are defined right now (they have no support for expressions inside array structures, such as `rows`). Deferring this part of the task.
# Conflicts:
#	src/components/summary/SummaryGroupComponent.tsx
#	src/features/form/containers/RepeatingGroupsEditContainer.tsx
#	src/layout/index.ts
#	src/utils/layout/hierarchy.ts
#	test/e2e/integration/app-frontend/summary.ts
…ays. Fixing the readOnly color, as it didn't match the input field.
# Conflicts:
#	src/layout/GenericComponent.tsx
…an't resolve it), and somebody _did_ rewrite the FullWidthWrapper to css modules! Hooray!
…de a node. The returned result will narrow the type of `this`.
…trial and error, I got it working fairly well. Rewriting the layout hierarchy generator to a more modularized one. With this change, we can have infinite levels of repeating groups (in theory, at least).
# Conflicts:
#	src/layout/Checkboxes/CheckboxesContainerComponent.tsx
#	src/layout/RadioButtons/ControlledRadioGroup.tsx
#	src/layout/index.ts
# Conflicts:
#	src/features/pdf/PDFView.tsx
#	src/features/pdf/data/generatePdfSagas.ts
#	src/layout/Group/RepeatingGroupTable.tsx
#	src/layout/Group/RepeatingGroupTableRow.tsx
#	src/layout/Group/RepeatingGroupsEditContainer.tsx
#	src/layout/Group/SummaryGroupComponent.tsx
#	src/layout/Group/index.tsx
#	src/layout/LayoutComponent.tsx
#	src/layout/Summary/SummaryBoilerplate.tsx
#	src/layout/Summary/SummaryComponent.tsx
#	src/utils/layout/LayoutNode.ts
#	src/utils/layout/hierarchy.test.ts
#	src/utils/layout/hierarchy.ts
# Conflicts:
#	src/utils/layout/hierarchy.ts
#	src/utils/layout/hierarchy.types.d.ts
#	test/e2e/integration/app-frontend/components.ts
#	test/e2e/support/navigation.ts
…implemented. One instance is always re-used for every component type, so that we can store state inside it to make group panel references easier to implement.
Ole Martin Handeland added 17 commits April 17, 2023 15:35
…ular components (but hiding header and readOnly rows)
…he actual target component, not the original grid reference
… was missing the 'empty summary' implementation.
…o the first page to fill out the form without going to the last page again before the sendIn button is clicked.
… This also unhides the components in headers and readOnly rows, making the mobile navigation.ts test work properly.
…rt radio group now was affected when in mobile mode. Restricting the change to only come into effect when rendered in a table/grid.
…der cell (and all other cells) because of object re-use.
# Conflicts:
#	src/components/Select.tsx
#	src/layout/Checkboxes/CheckboxesContainerComponent.tsx
#	src/layout/Dropdown/DropdownComponent.tsx
#	src/layout/MultipleSelect/MultipleSelectComponent.tsx
#	src/layout/RadioButtons/ControlledRadioGroup.tsx
#	test/e2e/integration/app-frontend/components.ts
#	test/e2e/integration/app-frontend/dynamics.ts
#	test/e2e/integration/app-frontend/summary.ts
@olemartinorg olemartinorg added the kind/product-feature Pull requests containing new features label Apr 25, 2023
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

36.5% 36.5% Coverage
0.0% 0.0% Duplication

@olemartinorg olemartinorg marked this pull request as ready for review April 25, 2023 13:14
Copy link
Contributor

@framitdavid framitdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mye og meget godt arbeid! :)

@olemartinorg olemartinorg merged commit a94c75a into main Apr 26, 2023
@olemartinorg olemartinorg deleted the feat/grid branch April 26, 2023 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/product-feature Pull requests containing new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New component: Grid
4 participants