-
Notifications
You must be signed in to change notification settings - Fork 9
CSL-2041: Popover tours #336
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
Conversation
|
I don't believe any migration is required for PR #328 because the database structure for the What was needed was to add a number of records for the new types. The last priority value before adding the new set was However, when later removing the But that approach is not feasible for Q/A nor Production since there are a lot of Event records there, and I assume we want to keep them, and continue to have them reference the same tip types as they do now. I'll look at the stack overflow article and also search for any documents regarding migration and unique fields. Another possibility is to write a python script that:
That should create a hole at the top that allows |
|
@mbrambilla, I put together a quick and dirty But, I noticed that all of the tip type's primary keys initially matched their priority. After running the increment manage command, they no longer match. I don't know if that's important. Also, I'm almost certain that the primary keys cannot be changed since that is what the database actually uses to associate the tip type with other records like I have to ponder this some more. |
|
@mbrambilla If you want to check out the script, I've created a draft branch and PR based on this branch/PR in PR #337. Use with caution :-) |
|
The priority can certainly be different from the pk - that they matched is just historical accident. Pk's should not be changed to avoid breaking DB connections, but priorities can be changed as needed. As far as I recall, the actual value of priority also doesn't matter - just the ordering. So holes are fine. |
|
Thanks for the clarifications @bgoldowsky ! In that case, is the |
# Conflicts: # src/library/views.py # src/pages/views.py # src/roster/views.py # src/shared/templates/shared/partial/popover_tour.html # src/shared/templates/shared/partial/popover_tour_footer.html
avoids the need for lots of other priority changes.
Logic was not in sync with can_show; use that method so that it is consistent. Make it a class method with standard capitalization convention. Note this changes the order to use priority; should fix that.
This avoids having to depend on ordering in the code.
|
@mbrambilla @klown I made some changes, would love to get your feedback on them. There is one remaining issue; there's at least one case where a tip is legal but just can't attach to anything (when a brand new user doesn't have a react wheel on their dashboard yet because they haven't read a book). This type of case is handled reasonably gracefully for single tips (that's why we added the 'tip viewed' message sent back from the client side), but breaks the tour with a JS error. We either need to (a) put some defensive code in the tour JS that will skip over tips that are not actually anchored to the page, or (b) add more conditions to |
|
Some checking is possible in the The current implementation has the inter-linking of the tour popovers is handled through the template code through the loop iteration (helped by the We might also need to handle the possible case of items being shown/hidden based on the tab interface of some of the panels (I never double-checked). However, if it is this one case, would it might be easier (faster) to remove the missing tour item from the list on the Django side based on a conditional to see if the student has not read any books. |
| "fields": { | ||
| "name": "tour", | ||
| "priority": 1, | ||
| "priority": 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. And, it makes PR #337 to shuffle the priorities around unnecessary*.
<curmudgeon>And here I thought that zero was neither positive nor negative. Django's PositiveSmallIntegerField says otherwise</curmudgeon>
* for now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of those areas where math ≠ computer science, I guess?
|
Why is 'thoughts' classified as student only? Any reason not to include it in the teacher tour of the reading page? |
|
BTW I am working on revising can_show() along the lines of Matt's suggestion. |
|
I'm not for changing Regarding the missing popover "breaks the tour with a JS error": what is the nature of the error? Is it an exception that could be caught and somehow skipped over? Or some generic error? |
|
It's a NPE because it tries to activate a popover in the chain but it's not there. The error could be caught, but would be awkward at best - the number of steps in the tour shown in the footer would be wrong, 'next' or 'prev' buttons would be active when they shouldn't be, etc. I think Matt is right that we need to make the Django side accurate as to what items are going to be available. I think I can make it not too ugly. |
That's a question for Kristin/Kim/Agatha. Kristin listed it as such in CSL-2040, and the content (google doc) also shows it as "student only" under the "Link to video [teacher]" heading: "[student only tip]". |
|
I think that was probably a misunderstanding since there was considerable confusion between 'thoughts' and 'student_reactions'. I can check with Kristin. |
|
More re: "thoughts" and it being student only. I think there's a bug here. The video for student-only "thoughts" is actually for the student_reactions tip on the student dashboard. There was a time when that tip for the student dashboard was called "thoughts" which raised other problems. I switched it to student_reactions for the student dashboard, but I may not have updated |
|
I found it and it is aimed at students. Part of the text for the popover notes that all of your reactions can be found on the student dashboard. The video is somewhat less student-centric, but at one point says, "... your teacher ..." which implies the user is a student, and also points out the reaction wheel on the student dashboard. Still the beginning of the video is fairly generic in describing the dialog for filling in reactions, answering the custom question, and so on. Here's the link: https://docs.google.com/document/d/1SYru98tt_Zmzz2z_7lKDCSiKqsOdDFTTLp0XMvW97h0/edit So, I take back that I think there is bug in |
Clean up a few other small issues in tour.
|
Thanks @klown for the investigation. I acknowledge that Kristin has specified 'thoughts' as student-only. Nevertheless, I am going to go with my gut feeling for now that there is no reason for it to be the single outlier student-only tooltip, until I can actually have a conversation with Kristin about it. |
Re-implementation of PR #333.
As noted previously, there are updates to the
tips_tiptypethat are needed. Please refer to notes from @klown in PR # regarding[tiptypes.json](https://github.com/cast-org/clusive/blob/0e70bc499b1566f8fe00afe77ff1ef2330b4517d/src/tips/fixtures/tiptypes.json)and issues with updating the db.I am are there is a way to get a migration file, as this is also possibly needed for PR #328.
Potential solution: https://stackoverflow.com/questions/4002322/migrating-django-fixturesActually this appears to be more of a create fixture, not a migration.Reference: https://code.djangoproject.com/ticket/24778