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 12 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
@pxpm pxpm force-pushed the next branch 2 times, most recently from 0cffae1 to 8ece6d2 Compare December 3, 2024 10:19
@pxpm pxpm force-pushed the next branch 2 times, most recently from 1253d3b to 7019815 Compare January 23, 2025 10:31
pxpm and others added 9 commits February 19, 2025 14:31
* add method to get ajax uploaders

* Apply fixes from StyleCI

[ci skip] [skip ci]

* use an abstract class

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* refactor uploaders

* Apply fixes from StyleCI

[ci skip] [skip ci]

* refactor rules

* Apply fixes from StyleCI

[ci skip] [skip ci]

* move ajax to PRO, cleanup

* Apply fixes from StyleCI

[ci skip] [skip ci]

* make attributes available for all subfields

* fix tests

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* upload multiple and upload properly working 🙏

* fixes

* Apply fixes from StyleCI

[ci skip] [skip ci]

* allow the configuration of valueWithoutPath call.

* fix valid upload inside repeatables

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix condition

* cleanup

* fix

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix use case for enabling validation after entry is created

* Apply fixes from StyleCI

[ci skip] [skip ci]

* dont save array keys

* fix ajax validation

* fix validation messages

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fixes ValidUpload

* Apply fixes from StyleCI

[ci skip] [skip ci]

* dont json encode if casted in the model

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix previous file identification in repeatable

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix getting values

* Apply fixes from StyleCI

[ci skip] [skip ci]

* add fake fields support

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip add uploaders tests

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* add pro columns

* fix test suite

* fix tests

* ffix tests

* remove unused test views

* add uploaders to test coverage

* Apply fixes from StyleCI

[ci skip] [skip ci]

* add coverage folder to gitignore

* make tests run faster by not reloading db when not necessary

* add coverage to validation tests

* add fake tests to uploaders

* Apply fixes from StyleCI

[ci skip] [skip ci]

* add more tests

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* add more upload assets

* fixes

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix single file

* Apply fixes from StyleCI

[ci skip] [skip ci]

* add image column

* fix tests

* Apply fixes from StyleCI

[ci skip] [skip ci]

* remove hardcoded macro names

* Apply fixes from StyleCI

[ci skip] [skip ci]

* remove double loop, fix single file uploader

* Apply fixes from StyleCI

[ci skip] [skip ci]

* use a big increments and unsigned for primary key

* handle pivot file deletion

* Apply fixes from StyleCI

[ci skip] [skip ci]

* register events for relation models

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix typo

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix relationship uploaders

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* update temporary time key

* save objects in the macro

---------

Co-authored-by: StyleCI Bot <[email protected]>
* wip

* clean up

* add get uploadedFilesFromRequest to clean up uploaders

* Apply fixes from StyleCI

[ci skip] [skip ci]

* fix type cast

* add summernote uploader

* update summernote

* add summernote

* add more test assets

---------

Co-authored-by: StyleCI Bot <[email protected]>
* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* tidy up

* Apply fixes from StyleCI

[ci skip] [skip ci]

* panel hooks

* Apply fixes from StyleCI

[ci skip] [skip ci]

* refactoring :broom

* finish implementing hooks

* Apply fixes from StyleCI

[ci skip] [skip ci]

* refactoring hooks

* Apply fixes from StyleCI

[ci skip] [skip ci]

* add hook to delete

* allow empty parameters

* wip

---------

Co-authored-by: StyleCI Bot <[email protected]>
* wip

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* wip

* Apply fixes from StyleCI

[ci skip] [skip ci]

* remove filters navbar component

---------

Co-authored-by: StyleCI Bot <[email protected]>
@pxpm pxpm force-pushed the fix-delete-button-script branch from af7b926 to 8745346 Compare February 19, 2025 14:37
[ci skip] [skip ci]
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