-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix item action guide #500
base: develop
Are you sure you want to change the base?
Conversation
@@ -151,6 +153,9 @@ defmodule DemoWeb.ItemAction.SoftDelete do | |||
@impl Backpex.ItemAction | |||
def label(_assigns), do: Backpex.translate("Delete") | |||
|
|||
@impl Backpex.ItemAction | |||
def confirm(_assigns), do: "Why do you want to delete this item?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The confirm function is mandatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could omit the confirm_label
and cancel_label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The confirm/1
function determines whether a confirmation modal is shown to the user. We can decide to add the confirm/1
, confirm_label/1
and cancel_label/1
functions (a modal is shown) or remove them (no modal is shown) 🤔.
If we add the confirm/1
function as suggested, we must also keep confirm_label/1
and cancel_label/1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current example in the documentation makes no sense (confirm_label/1
and cancel_label/1
without modal).
If we add the confirm/1 function as suggested, we must also keep
confirm_label/1
andcancel_label/1
.
Thats not right. When omitted the default values ("Cancel" and "Apply") are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see the default implementation 🙃
Currently, the item action confirmation dialog is enabled when the list of fields is empty or the From our docs:
This doesn't seem right and has to be updated. Moreover, we should update the |
No description provided.