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

Switches processingContext for useMutation #3074

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cammiida
Copy link
Contributor

@cammiida cammiida commented Mar 4, 2025

Description

Related Issue(s)

  • closes #{issue number}

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
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • 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

@cammiida cammiida changed the title Removes processingContext for useMutation Switches processingContext for useMutation Mar 4, 2025
@cammiida cammiida added kind/other Pull requests containing chores/repo structure/other changes ignore-for-release Pull requests to be ignored in release notes labels Mar 4, 2025
@cammiida cammiida force-pushed the refactor/processing-context branch from 9e72c16 to 5cc56ba Compare March 4, 2025 14:14
@cammiida cammiida self-assigned this Mar 4, 2025
@cammiida cammiida moved this to 🔎 Review in Team Apps Mar 4, 2025
@bjosttveit
Copy link
Member

/publish

Copy link
Contributor

github-actions bot commented Mar 5, 2025

PR release:

  • <link rel="stylesheet" type="text/css" href="https://altinncdn.no/toolkits/altinn-app-frontend/4.17.2-pr.683.processing-context.5cc56bac/altinn-app-frontend.css">
  • <script src="https://altinncdn.no/toolkits/altinn-app-frontend/4.17.2-pr.683.processing-context.5cc56bac/altinn-app-frontend.js"></script>

⚙️ Building...
✅ Done!

Copy link
Member

@bjosttveit bjosttveit left a comment

Choose a reason for hiding this comment

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

The main reason I ended up using a custom approach for this was that I did not like useMutation's behavior wrt. the pending state. As you can see in the video, everything always blinks into and out of disabled state when navigating, even though there are no async things happening that needs to be waited for. Its subtle, but I found it quite disturbing.

Screen.Recording.2025-03-05.at.09.44.03.mov

@bjosttveit
Copy link
Member

Another thing, since you are using const isAnyProcessing = useIsMutating() > 0; without any filters this will disable stuff when saving also. The original reason for introducing this concept was to avoid having to do this since it is very disturbing.

Screen.Recording.2025-03-05.at.13.48.20.mov

@bjosttveit
Copy link
Member

/publish

Copy link
Contributor

github-actions bot commented Mar 6, 2025

PR release:

  • <link rel="stylesheet" type="text/css" href="https://altinncdn.no/toolkits/altinn-app-frontend/4.17.2-pr.697.processing-context.c3ab7c3b/altinn-app-frontend.css">
  • <script src="https://altinncdn.no/toolkits/altinn-app-frontend/4.17.2-pr.697.processing-context.c3ab7c3b/altinn-app-frontend.js"></script>

⚙️ Building...
✅ Done!

@HanneLauritsen1967 HanneLauritsen1967 moved this from 🔎 Review to 📈 Todo in Team Apps Mar 19, 2025
@RonnyB71 RonnyB71 moved this from 📈 Todo to ⚠️ Blocked in Team Apps Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release Pull requests to be ignored in release notes kind/other Pull requests containing chores/repo structure/other changes
Projects
Status: ⚠️ Blocked
Development

Successfully merging this pull request may close these issues.

2 participants