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 redirect option to delete button script #5723

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

pxpm
Copy link
Contributor

@pxpm pxpm commented Nov 25, 2024

WHY

BEFORE - What was wrong? What was happening before this PR?

When an entry was deleted from show operation, the deleted entry was kept on screen and just an alert was shown.

image

As you can see, that is a deleted entry that still had the actions (delete, edit, etc) available to be clicked, but none of them work since the entry was already deleted.

AFTER - What is happening after this PR?

The delete button can now accept an url to redirect after an entry is deleted.

HOW

How did you achieve that, in technical terms?

Added a deleteButtonRedirect operation setting and setup some sane defaults: - if user has access to ListOperation, redirect to list, else, redirect to previous page.

This can all be configured by developer if the defaults are not enough for them.

ListOperation still ignores this setting since a table is present on the page, and in that case we keep the previous behavior of re-drawing the table, no redirects.

Is it a breaking change?

Is can be seen as one. No app is going to break, but the behavior changed. I wouldn't consider it a breaking change, but @tabacitu thinks it's better to treat it as one, in that case I am marking this for v7

@pxpm pxpm changed the base branch from main to next November 25, 2024 19:49
@pxpm pxpm added the v7 label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants