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

Return to resource list after adding/removing an item from a lesson/quiz #7213

Conversation

MisRob
Copy link
Member

@MisRob MisRob commented Jun 29, 2020

Summary

Redirect coaches to a list after adding or removing an item from a lesson/quiz when planning a class. Display snackbar on a list page.

Lesson Quiz
lesson-resource-added quiz-resource-added
lesson-resource-removed quiz-resource-removed

Reviewer guidance

Lesson

  • Coach -> Plan -> Lessons -> select a lesson/create a new lesson -> MANAGE RESOURCES -> open a resource preview
  • Click ADD/REMOVE

Quiz

  • Coach -> Plan -> Quizzes -> create a new quiz -> open a resource preview
  • Click ADD/REMOVE

References

Closes #6819
Opened #7212


Contributor Checklist

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

Testing:

  • 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

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

@MisRob MisRob added the TODO: needs review Waiting for review label Jun 29, 2020
@MisRob MisRob added this to the 0.14.0 milestone Jun 29, 2020
@codecov
Copy link

codecov bot commented Jun 29, 2020

Codecov Report

Merging #7213 into release-v0.14.x will increase coverage by 0.06%.
The diff coverage is 0.00%.

Impacted Files Coverage Δ
.../src/views/plan/LessonContentPreviewPage/index.vue 0.00% <0.00%> (ø)
...c/views/plan/LessonResourceSelectionPage/index.vue 0.00% <0.00%> (ø)
...c/views/plan/PlanLessonSelectionContentPreview.vue 0.00% <0.00%> (ø)
...oach/assets/src/views/plan/PlanQuizPreviewPage.vue 0.00% <0.00%> (ø)
kolibri/core/query.py 69.09% <0.00%> (-8.47%) ⬇️
kolibri/plugins/default_theme/kolibri_plugin.py 92.30% <0.00%> (-7.70%) ⬇️
kolibri/core/theme_hook.py 48.30% <0.00%> (-1.70%) ⬇️
...ugins/device/assets/src/modules/wizard/handlers.js 8.73% <0.00%> (-0.15%) ⬇️
.../core/deviceadmin/management/commands/dbrestore.py 76.56% <0.00%> (ø)
...plugins/facility/assets/src/views/UserEditPage.vue 0.00% <0.00%> (ø)
... and 8 more

@jonboiser jonboiser self-assigned this Jun 29, 2020
@jonboiser
Copy link
Contributor

jonboiser commented Jun 29, 2020

We should prevent the Preview pages changing in appearance before navigating back to the resource-list page (see GIF).

Could you

  1. Remove the "Added" indicator from appearing
  2. Prevent the button label from switching from "Add" <-> "Remove" before redirect happens
  3. (Optionally) disable the button to discourage double-clicking the button (even though double-clicking does not appear to cause problems)

CleanShot 2020-06-29 at 11 11 33

@jonboiser
Copy link
Contributor

I also added some suggestions for fixing #7212 inside some comments

Michaela Robosova added 2 commits June 30, 2020 13:29
- do not switch between added/removed states before redirect
- disable add/remove button after click
@MisRob
Copy link
Member Author

MisRob commented Jun 30, 2020

Hi JB, thank you. I've just pushed all updates.

Regarding "Added" indicator, although it's not rendered after "Add" button click anymore, it's still displayed on the preview page load - is it fine or do you want to remove it completely? I've tried both options and it seems that keeping indicator for this situation makes visually clear if it's added or not at first glance when compared to displaying "Remove" button only.

@MisRob
Copy link
Member Author

MisRob commented Jun 30, 2020

Also added a commit to unify snackbar messages that closes #7212.

@MisRob MisRob requested a review from jonboiser June 30, 2020 12:42
@@ -173,6 +190,11 @@
);
},
},
watch: {
isSelected() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This watcher is not currently used though I added it because I would expect that disableSelectButton will be appropriately reset on selection state change.

Copy link
Contributor

@jonboiser jonboiser left a comment

Choose a reason for hiding this comment

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

The changes look great, thanks!

@jonboiser
Copy link
Contributor

@MisRob I found a bug where if you removed the only resource in a lesson from the preview page, it would be automatically re-added when navigating back to the resource list (due to the complicated autosaving logic we use). I added one more commit as a hack to fix this by committing the resource removal before the navigation, but keeping the Preview page buttons and indicators saying "added" until the navigation occurs.

@jonboiser jonboiser merged commit a16d93f into learningequality:release-v0.14.x Jun 30, 2020
@MisRob MisRob deleted the redirect-to-list-after-adding-removing-item branch June 12, 2021 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Important user-facing changes
Projects
None yet
2 participants