Keeping the given content and the selected action in AskActionMessage function #1017
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was developing a kind of admin manager view for a user with admin role and this admin can upload more data and delete data from the database and I was using the
AskActionMessage
function and I found that is a bit confusing only show the default message:**Selected:** {res["label"]
when we are asking more than 1 action to the user.This is why I created this pr to solve this issue.
This is an example:
If you see the 2 first answers, you don't know the context, but in the third one you can see the question and the action selected.
I just added an optional parameter
keep_content
that is a boolean and isFalse
by default.Of course this is useful only if we are going to ask more than 1 action. Like I said when I was developing this type of view, like an admin panel, I have to use at least 6
AskActionMessage
.I know that we have
@cl.action_callback("action_button")
, but is not the same, because theinput query
is not disabled and is not that clear how we can delete all other action buttons if we have more than 1 action.