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

Add confirm delete progress admin page #42170

Merged
merged 2 commits into from Aug 31, 2021

Conversation

jamescodeorg
Copy link
Contributor

@jamescodeorg jamescodeorg commented Aug 24, 2021

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.

Screen Shot 2021-08-24 at 10 11 29 AM

Screen Shot 2021-08-24 at 10 12 00 AM

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:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@jamescodeorg jamescodeorg force-pushed the jamescodeorg/confirm-delete-progress-form branch from 533be24 to 374a466 Compare August 24, 2021 17:13
@jamescodeorg jamescodeorg requested review from a team and fontie715 August 24, 2021 17:16
@@ -0,0 +1,24 @@
%h1 Delete User Progress

%p You are about to <strong>permanently</strong> delete progress (level status and source code) for:
Copy link
Contributor

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'
Copy link
Contributor

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?

Copy link
Contributor Author

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'
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@maureensturgeon maureensturgeon left a 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

@jamescodeorg
Copy link
Contributor Author

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).

@jamescodeorg jamescodeorg merged commit 9e9db79 into staging Aug 31, 2021
@jamescodeorg jamescodeorg deleted the jamescodeorg/confirm-delete-progress-form branch August 31, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants