Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Enable confirm modal for catalog > files listing for bulk delete action #16820
I think it's a pity to limit this modification to bulk delete It's almost exactly the same behaviour as a submit button except the modal is prettier I suggest making a more generic component to manage the modal I'll propose a PR based on your branch this will be easier to explain
I thought about it but I'm not sure making it generic is a good idea.
There is actually already 2 other "confirm before bulk delete" modals that already exist: categories and customers. They have a few more specific logic but they are definitely "confirm before bulk delete" usecase.
When I started this feature I tried to make something generic, so that we would have a single configurable modal that would fit all usecases. I came close to doing it ... but the code was full of
That is why I took the exact reverse path and went for something 100% specific, following KISS principle: keep it simple and stupid.
If you want to make it a configurable modal, you'll probably need to pass, as options:
And if you define all these options from the GridDefinition (because I see no else location), it's one more step towards mixing backend logic and view configuration, violating the MVC principle (we already violate it for several items, but this would be one more)
@matks Mmm, maybe I see it too simple in my mind and don't see the big picture But I thought of something really simple:
The url and action already already managed anyway so nothing to add!
Then it wouldn't be that complicated, better it would make the modification for ALL submit actions at once, the only thing to do would be to add the title in each grid definitions (optional but prettier)
What do you think? As I suggested I can try a proposal on a branch based on your so you can see the difference and if it's too complicated
@marionf I have a question for you, we integrated the possibility to use a modal instead of native
Here is how it looks like for a customized one on delete:
And the default one would like this:
So the question is, do we enable the modal by default on every bulk action? This would enable it on all migrated pages. Or do we keep the native confirm?