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

RestActions: Add option to hide row on successful action #10

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions is_core/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,22 @@ def __init__(self, name, verbose_name, class_name=None, target=None, rel=None):

class RestAction(Action):

def __init__(self, name, verbose_name, method, data=None, class_name=None, success_text=None):
def __init__(self, name, verbose_name, method, data=None, class_name=None, success_text=None, hide_row=None):
super().__init__(name, verbose_name, 'rest', class_name)
self.method = method
if data:
self.data = data
if success_text:
self.success_text = success_text
if hide_row:
self.hide_row = hide_row


class ConfirmRestAction(RestAction):

def __init__(self, name, verbose_name, method, data=None, class_name=None, confirm_dialog=None, success_text=None):
super(ConfirmRestAction, self).__init__(name, verbose_name, method, data, class_name, success_text)
def __init__(self, name, verbose_name, method, data=None, class_name=None,
confirm_dialog=None, success_text=None, hide_row=None):
super().__init__(name, verbose_name, method, data, class_name, success_text, hide_row)
self.confirm = confirm_dialog

class ConfirmDialog(JsonObj):
Expand Down
Loading