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

Add customreceipt as alternative to simplereceipt #823

Closed
wants to merge 1 commit into from

Conversation

standeren
Copy link
Contributor

@standeren standeren commented Jan 10, 2023

Description

Add customReceipt component as an alternative to simpleReceipt when autodeleteonprocessend is enabled.

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 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

@standeren standeren added the kind/product-feature Pull requests containing new features label Jan 10, 2023
@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 0 Code Smells

75.0% 75.0% Coverage
0.0% 0.0% Duplication

@bjosttveit
Copy link
Member

Have you tested this manually?

@olemartinorg
Copy link
Contributor

I agree with @bjosttveit here, please fill out the checklist. Having automatic tests for this functionality would be preferable. While this looks simple enough from the small amount of code changes, there might be significant implications of changes like these.

Application metadata is fetched fairly early in the runtime, and is not dependent on having an instance. The available layouts relies on knowing which process task the instance is currently in, which makes it depend on having an instance available. When auto-deletion is on, we should assume there is no instance, making the current process state undefined, thereby making it impossible to determine which layouts should be loaded, so none will be available. In essence, my theory here is that the state we need to have available here relies on data we know we won't have - so this code should never even be able to execute.

And if it does work, that probably means that app-frontend is not (correctly) deleting its local state (form data, layouts) in Redux when moving to the next process step (ending up at the receipt). That means this functionality relies on side-effect, so a refactor in something like #345 will probably cause this functionality to break. If we knowingly paint ourselves in a corner like that, we have to introduce complexity in the future to make sure this feature still works.

A simple way to test this is to fill out a form (with auto deletion of instance data), get to the receipt page, make sure the instance data is deleted, and refresh the page. That will re-load the app/instance state from backend, so if that works (and better yet; we have a cypress test to prove it), I'd be very happy greenlighting this functionality.

@bjosttveit bjosttveit assigned standeren and unassigned bjosttveit Jan 13, 2023
@bjosttveit bjosttveit marked this pull request as draft January 20, 2023 14:19
@bjosttveit
Copy link
Member

bjosttveit commented Jan 20, 2023

Gjorde denne om til draft siden det enda er uavklart

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
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants