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
Add confirm delete progress admin page #42170
Add confirm delete progress admin page #42170
Conversation
533be24
to
374a466
Compare
@@ -0,0 +1,24 @@ | |||
%h1 Delete User Progress | |||
|
|||
%p You are about to <strong>permanently</strong> delete progress (level status and source code) for: |
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.
Should we also mention other records that will be deleted as side effects like teacher feedback (I forget if there are others)?
=text_area_tag :reason, '', placeholder: 'required' | ||
%br | ||
%br | ||
=submit_tag 'Delete Progress' |
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.
Do we want a cancel button, or do you think it's obvious that you can just hit the browser back button?
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.
I thought about this and it didn't seem like other similar admin pages had a cancel button or link so I left it out?
%br | ||
Reason: | ||
%br | ||
=text_area_tag :reason, '', placeholder: 'required' |
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.
I see that the placeholder says 'required', do we want to disable the submit button if no reason was given? I'm also wondering if it may be useful to record the id of the admin that deleted the progress?
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.
This is a good suggestion but I think I want to keep the haml as simple as possible for now (similar to the other admin pages). I will run through this scenario where the admin does not provide a reason once everything is hooked up end-to-end and make sure that the experience is reasonable for an admin. If it's really bad, I'll add this.
Yes, the id of the admin (the current logged in user) will be recorded in the firehose event.
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.
I'm curious how we expect this page to evolve. Do we expect more granular progress deletion eventually? If we have grand plans for this page it may be useful to convert it to react
It's a good question. I don't think there are currently plans for allowing an admin to delete just the progress for a single level. The next evolution of this feature would probably to make it so that verified teachers could do this on their own, but that would require a completely different UI. I did want to make this page more generally useful for debugging progress-related issues but we don't have anything scheduled. At some point, we should probably discuss as an org what direction we want to move admin pages in. For now though, my preference is to just follow the existing pattern (even though I don't think it's a great pattern and it's difficult to test). |
This change adds a delete link to each row in the script progress table on the user progress admin page. Clicking on that link takes the admin to a page that confirms the user and script that will be affected and captures the reason for deletion (which will eventually be sent to firehose). This completes the UI flow for the reset progress feature but the actual deletion logic has not been implemented yet and will be in a separate PR.
I also removed the detailed list of user_levels from the initial page because it wasn't working for level types with child levels (LP-1967). Fixing this in an efficient way proved to be difficult and this was kind of a bonus feature that I threw in so I decided to just remove the list for now and move on.
Side note: I am really glad that this is no longer the way we usually build UI. This seems so clunky and difficult to test.
Links
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: