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

Admin: Fix popup for reverse_delete #25

Open
asacristani opened this issue Oct 11, 2023 · 3 comments
Open

Admin: Fix popup for reverse_delete #25

asacristani opened this issue Oct 11, 2023 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@asacristani
Copy link
Owner

Now the message for delete and reverse_delete is the same (delete message).
It could be good to modify for reverse_delete being more accurate.

@asacristani asacristani added bug Something isn't working good first issue Good for newcomers labels Oct 11, 2023
@asacristani asacristani added this to the Admin MVP milestone Oct 11, 2023
@sajankp
Copy link

sajankp commented Oct 16, 2023

I had a look at this issue, the message shown during delete is hardcoded into the javascript code for sqladmin.
Found here at sqladmin/statics/js/main.js.
Will have to look into the feasibility of overriding this js code.

@asacristani
Copy link
Owner Author

@sajankp thanks for having a look mate, feel free to open a PR 🚀

@sajankp
Copy link

sajankp commented Oct 24, 2023

The delete method do not pass information other than the model name, id used specific to the instance being deleted (sql admin implementation). Hence unable to access the "deleted" parameter within the js code.
The other way is to read it from the specific column using JS, but for any model that will not have the column deleted listed in the view will cause this feature to break, and this would be more of a hack than a good fix.

The ideal solution would be to have a separate action https://aminalaee.dev/sqladmin/configurations/#custom-action which does soft delete and have it's own template.

Leaving this message for future reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants