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

Integrate shopping cart into lesson resource selection side panel #12996

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

AlexVelezLl
Copy link
Member

@AlexVelezLl AlexVelezLl commented Jan 13, 2025

Summary

  • Integrates shopping cart into lesson resource selection side panel.
  • Implemts functionality to add selected resources to lesson.
  • Adds a guard to show a closing confirmation modal when closing the modal with modified changes.
Compartir.pantalla.-.2025-01-13.16_12_02.mp4

References

Closes #12990.

Reviewer guidance

  • Create or edit a lesson
  • Change browser route path from "/lesson" to "lessontemp".
  • Select/deselect resources to add to the lesson.
  • Check the shopping cart, its reactiveness, buttons, etc.
  • Check that save button works in different scenarios.

Implementation notes

As we shouldnt have repeated resources in a lesson, I have make sure to save unique resoures in the list. This implies that if a user is selecting a resource that is already in the lesson, it will just "ignore" it (because of the unification process). So it wont take it into account to make the save request, neither to show the close confirmation message if no new resources are being added. Does this makes sense?

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Jan 13, 2025
@@ -0,0 +1,263 @@
<template>
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

A few notes from an initial read through - I'll do a second review tomorrow. I also haven't run this locally yet or tried it out.

@pcenov I'll add you here for manual QA - please let me or Alex know if you have any questions about how to test these changes. Thank you!

@marcellamaki marcellamaki requested a review from pcenov January 15, 2025 22:03
@pcenov
Copy link
Member

pcenov commented Jan 16, 2025

Hi @AlexVelezLl and @marcellamaki, I confirm that this is implemented as specified above. Noticed the following potential issues:

  1. As noted by Alex in the description of the PR the resources which have already been added to the lesson are not marked as selected when one reopens the modal. This wasn't the case in the previous version where all added resources are marked as selected. So that question is - can we have the same implementation here, so that a coach will have a clear indication which resources are already added?

Current implementation:

selection.mp4

Previous:

previous.mp4
  1. It's not possible to preview a resource both by clicking on a card or on the link (perhaps not in scope for this PR?):
cannot.preview.a.resource.mp4
  1. Clicking the back arrow always brings me to the "Manage lesson resources" page while when I am navigating within folders I was expecting to be able to go back to the previous folder:
the.back.arrow.mp4

@rtibbles
Copy link
Member

As noted by Alex in the description of the PR the resources which have already been added to the lesson are not marked as selected when one reopens the modal. This wasn't the case in the previous version where all added resources are marked as selected. So that question is - can we have the same implementation here, so that a coach will have a clear indication which resources are already added?

I think this is desirable - with one change from the previous behaviour - the checkboxes should be marked as selected, but disabled. This is an intentional change we introduced in the quiz workflow, so that resource selection was a 'shopping cart' experience - going to find new resources to include - not a selection and deselection experience. Removing resources is done from the lesson itself, not the resource selection flow.

@rtibbles
Copy link
Member

For 2 - we have two follow up issues for the preview behaviours, so yes, I think out of scope for this PR! #12988 and #12989

For 3 - my understanding is that this is currently intended behaviour. I think we shouldn't block the PR for this, and I know there are other back arrow confusions in resource selection in quiz too, so we should keep a close eye on people's reactions to this as we do broader internal testing.

@AlexVelezLl
Copy link
Member Author

Thank @rtibbles! I have pushed the changes to have these checkboxes selected but disabled :)

Compartir.pantalla.-.2025-01-24.09_04_54.mp4

Copy link
Member

@pcenov pcenov left a comment

Choose a reason for hiding this comment

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

Thanks @AlexVelezLl - I confirm that the checkboxes of the already added resources are disabled now.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Follow up: update shopping cart to consume the "current working state" rather than the saved lesson state
4 participants