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

fixes user selection getting lost on closing the sidepanel #12160

Merged

Conversation

AllanOXDi
Copy link
Member

Summary

Fixes user selection getting lost on closing the sidepanel
Closes #12135

References

#12135

Reviewer guidance

  1. Navigate to the select questions
  2. Check the question you want to replace
  3. Click replace icon
  4. Close the side panel


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: very small labels May 11, 2024
Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

LGTM, code change makes sense and I tried some use cases and the bug has been fixed.

But the fact that there was a call to clearSelectedQuestions when closing the side Panel made me question if perhaps the intention was to clear the replacements.

Because these are not cleared anywhere, and if you do multiple replacements in a row, the references from the previous replacements continue. So probably instead of a clearSelectedQuestions there should be a clearReplacements on the beforeRouterLeave @nucleogenesis?

Compartir.pantalla.-.2024-05-12.19_04_51.mp4

Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

The original page's selection is updated but replacements is not being cleared. I think that you could set the value of replacements in handleConfirmClose where we handle when the user says "Continue" to the alert telling them they'll lose their changes.

2024-05-14.14-11-20.mp4

Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

The updates here LGTM after some testing! Thanks Allan

Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

Hi @AllanOXDi The error still happens when we save the questions. Because we are only clearing the replacements when we exit without saving the questions:

Compartir.pantalla.-.2024-05-20.23_51_20.mp4

My suggestion would be to clean the replacements on this line, on router leave. So it would work for both cases.

Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

Thanks @AllanOXDi! LGTM 🎉

@AlexVelezLl AlexVelezLl merged commit 28b1ba3 into learningequality:develop May 21, 2024
31 checks passed
@AllanOXDi AllanOXDi deleted the fix_user_selection_getting_lost branch May 22, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EQM: When closing the "replacements" side panel, the user's selection is being lost
3 participants