From f8ee9d4d4038d44d576ef46f351de038f4c9df3d Mon Sep 17 00:00:00 2001 From: Peter Kubov Date: Sun, 28 Apr 2024 12:56:11 +0200 Subject: [PATCH] RestActions: Add option to hide row on successful action --- is_core/actions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/is_core/actions.py b/is_core/actions.py index 298b679c..1fc6b940 100644 --- a/is_core/actions.py +++ b/is_core/actions.py @@ -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):