-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
WIP: fix "destroy" links #1688
WIP: fix "destroy" links #1688
Conversation
Ahh this is an interesting way to approach this problem! Is it just deletions that have this problem? We don't do anything else which was dependent on My initial thought would be that this will make deleting items really slow, and having something else to make mass deletions faster isn't something I think we should worry about right now. |
I agree: the UX of this solution is a step backwards compared to the pre-bug solution. Now, I have these two thoughts:
Having said that, perhaps we should fix the JS issue first, and consider this PR an additional enhancement that should come later. |
Is the best option — in the interest of unblocking the release — to just revert the removal? I'd like to add the Capybara change from this too though. |
Yeah, I think you are right. I'd still like to provide a JS-independent solution, but let's solve the problem at hand first. So here's a PR that includes the breaking test and the commit reversal: #1691 |
Oops, didn't notice you already had created a PR. I closed mine now. |
Sorry! I should've mentioned it! Given other priorities, what do you think of closing this one for now and revising it later on? |
Yes. I'll come back to this in the future, but I'm ok with closing it for now. |
Fixes #1643
When #1618 was merged, some JS broke. One important piece of functionality that stopped working was "destroy" links.
We were using the JS-driven destroy links that are common in Rails. These work on links with the attribute
data-method="delete"
, and show aconfirm()
box with text extracted from the attributedata-confirm
.You might be wondering why the specs didn't break... Well, it turns out that Capybara tries to be clever about these special attributes, even when using Rack::Test. As a result, tests passed even though the JS to drive the functionality wasn't working. To avoid this happening again, I have told Capybara to
respect_data_method: false
.OK, so how can we fix this? We can fix the JS, but there are two problems:
So I'm proposing that we change the way that destroy links work, so that they use a "traditional" approach, driven by the backend:
This is a first draft, which perhaps should be styled a bit. The confirmation page looks like this at the moment:
Pending: