Skip to content

Commit

Permalink
RestActions: Add option to hide row on successful action
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kubov committed Apr 30, 2024
1 parent b4e936e commit f8ee9d4
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit f8ee9d4

Please sign in to comment.