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

Undo Recent Pop Feature #172

Open
smikell opened this issue Aug 9, 2020 · 1 comment
Open

Undo Recent Pop Feature #172

smikell opened this issue Aug 9, 2020 · 1 comment

Comments

@smikell
Copy link

smikell commented Aug 9, 2020

There have been a couple of occasions where I accidentally pop/resolve a student when I mean to pin them. As such a quick, undo recent pop button would be a nice addition. Clicking the button would take the most recent student popped and place them back in the queue at their relative position (time elapsed since request). I'd love to contribute myself, but this is my first time seeing the codebase, so any tips on where to start?

@mterwill
Copy link
Owner

👋 hey @smikell! I like this idea. Instead of adding a new button, I'm curious how it would feel if the 'Pop' button briefly changed to 'Undo' after you clicked it. That button is rendered here:

<Action data={this.getQueuePopButtonData()} />

Which calls this method on the backend:

def queue_pop(data)
authorize :instructor_only
request = @course_queue.pop!(current_user)
broadcast_request_change('resolve_request', request)
end

Undoing a pop would be as simple as looking up the request and setting resolved_at and resolver back to null.

Perhaps we should update queue_pop to take in a request_id, so that the frontend only 'pops' the request it intended. You should then be able to store the 'last popped' request ID in component state for the instructor panel and pass it to a new method on the backend if Undo is clicked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants