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

Enable expressions for TextResourceBindings and per row in repeating groups #714

Merged
merged 21 commits into from
Dec 13, 2022

Conversation

Magnusrm
Copy link
Contributor

@Magnusrm Magnusrm commented Dec 6, 2022

Description

Enables expressions to be used for TextResourceBindings
Enables expressions to be calculated using row-specific values when useExpressions is given a rowIndex in a group component context.

The use of TextResourceBindings have been updated to run expressions using useExpressions before being taken into use by components.

useExpressions have been updated to check whether the given component is a group, and if a rowIndex is given the expression will run using a the context of a child-component in the given index.

Related Issue(s)

Verification

  • Manual testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added
    • Cypress E2E test(s) have been added
    • No automatic tests are needed here
    • I want someone to help me make some tests
  • User documentation @ altinn-studio-docs
    • Has been updated
    • No changes/updates needed
  • Changes/additions to component properties
    • Changes are reflected in both layout/index.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

@Magnusrm Magnusrm added the kind/product-feature Pull requests containing new features label Dec 6, 2022
@github-actions github-actions bot added area/instantiation area/test related to automated and functional testing labels Dec 6, 2022
@bjosttveit
Copy link
Member

Looking forward to all of the merge conflicts i'm gonna get 😩

@Magnusrm Magnusrm changed the title Enable expressions for TextResourceBindingsper and per row in repeating groups Enable expressions for TextResourceBindings and per row in repeating groups Dec 7, 2022
@Magnusrm Magnusrm marked this pull request as ready for review December 9, 2022 11:12
@Magnusrm Magnusrm marked this pull request as draft December 9, 2022 11:12
Ole Martin Handeland added 3 commits December 9, 2022 12:46
…ng-groups

# Conflicts:
#	src/components/molecules/AltinnMobileTableItem.tsx
#	src/features/form/containers/RepeatingGroupTable.tsx
#	src/features/form/containers/RepeatingGroupTableRow.tsx
@Magnusrm Magnusrm marked this pull request as ready for review December 9, 2022 12:16
Copy link
Contributor

@olemartinorg olemartinorg left a comment

Choose a reason for hiding this comment

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

🥳

cypress/e2e/integration/app-frontend/group.js Outdated Show resolved Hide resolved
src/features/expressions/index.ts Outdated Show resolved Hide resolved
src/features/expressions/useExpressions.ts Show resolved Hide resolved
Magnusrm and others added 4 commits December 12, 2022 14:51
Co-authored-by: Ole Martin Handeland <github@olemartin.org>
…alue for all the values in that object containing an expression
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

87.0% 87.0% Coverage
0.0% 0.0% Duplication

@Magnusrm Magnusrm merged commit 11696b9 into main Dec 13, 2022
@Magnusrm Magnusrm deleted the feature/61-expressions-for-prefil-in-repeating-groups branch December 13, 2022 10:46
standeren pushed a commit that referenced this pull request Dec 13, 2022
…groups (#714)

* expressions per row and use expressions for textresourcebindings

* comply with tests

* create cypress test

* default values for textResourceBindings, some cleanup

* update layout.schema

* refactor repeatingGroupRow, some cleanup

* Minor changes to make future merge easier (will be reverted)

* Cleaning up after merge

* change edit button color

* Add breakword

* Fix styling

* fix mobile button placement

* fix lint errors

* Update cypress/e2e/integration/app-frontend/group.js

Co-authored-by: Ole Martin Handeland <github@olemartin.org>

* Implementing a magic key in an object that can be used as a default value for all the values in that object containing an expression

* merge origin/main into branch

Co-authored-by: Ole Martin Handeland <git@olemartin.org>
Co-authored-by: = <bjosttveit@gmail.com>
Co-authored-by: Ole Martin Handeland <github@olemartin.org>
olemartinorg pushed a commit that referenced this pull request Dec 13, 2022
… the shared test framework. We had support for this in useExpressions() after #714, but this is not natively supported in the shared test bootstrapping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/instantiation area/test related to automated and functional testing kind/product-feature Pull requests containing new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants