Project

General

Profile

Actions

Bug #7735

closed

Cancel button are validating fields in filters and event classes

Added by Rajmund Hruška 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Category:
Development - GUI
Target version:
Start date:
10/08/2021
Due date:
10/08/2021
% Done:

0%

Estimated time:
To be discussed:
No

Description

See #7519.


Files

clipboard-202406121404-lqedw.png (16.3 KB) clipboard-202406121404-lqedw.png Rajmund Hruška, 06/12/2024 02:04 PM

Related issues

Follows Mentat - Bug #7519: Cancel buttons are validating fieldsClosedJan Mach10/07/2021

Actions
Actions #1

Updated by Rajmund Hruška 2 months ago

  • Due date set to 10/08/2021
  • Start date changed from 05/13/2024 to 10/08/2021
  • Follows Bug #7519: Cancel buttons are validating fields added
Actions #2

Updated by Rajmund Hruška about 1 month ago

  • To be discussed changed from No to Yes

Simple solution would be to just remove the cancel buttons from those forms, similar to how to it was done in 1c53383a. That would fix this issue on frontend.

There is a feature on backend which handles action 'cancel': it flashes a banner saying that the action XXX was canceled.

def check_action_cancel(self, form, **kwargs):
    """ 
    *Hook method*. Check the form for *cancel* button press and cancel the action.
    """ 
    if hasattr(form, hawat.const.FORM_ACTION_CANCEL):
        if getattr(form, hawat.const.FORM_ACTION_CANCEL).data:
            self.flash(
                flask.Markup(self.get_message_cancel(**kwargs)),
                hawat.const.FLASH_INFO
            )
            return self.redirect(
                default_url = self.get_url_next()
            )
    return None

But the question is, do we need this functionality? I think we can remove this.

Actions #3

Updated by Rajmund Hruška about 1 month ago

  • Status changed from New to Feedback
Actions #4

Updated by Pavel Kácha about 1 month ago

Rajmund Hruška wrote in #note-2:

Simple solution would be to just remove the cancel buttons from those forms, similar to how to it was done in 1c53383a. That would fix this issue on frontend.

There is a feature on backend which handles action 'cancel': it flashes a banner saying that the action XXX was canceled.
[...]

But the question is, do we need this functionality? I think we can remove this.

Well, in login forms, it does not make sense (much) to cancel login, as that means you can't get inside the app altogether, and closing the window (tab) is appropriate.

Is it appropriate here? We don't open new windows for specific functions as this, so the user relies on us correctly returning him to previous state, which is not doable without Cancel, I guess?

Actions #5

Updated by Rajmund Hruška about 1 month ago

Pavel Kácha wrote in #note-4:

Rajmund Hruška wrote in #note-2:

Simple solution would be to just remove the cancel buttons from those forms, similar to how to it was done in 1c53383a. That would fix this issue on frontend.

There is a feature on backend which handles action 'cancel': it flashes a banner saying that the action XXX was canceled.
[...]

But the question is, do we need this functionality? I think we can remove this.

Well, in login forms, it does not make sense (much) to cancel login, as that means you can't get inside the app altogether, and closing the window (tab) is appropriate.

Is it appropriate here? We don't open new windows for specific functions as this, so the user relies on us correctly returning him to previous state, which is not doable without Cancel, I guess?

Instead of closing the window, the user could just press 'Back' button in the browser.

Actions #6

Updated by Pavel Kácha about 1 month ago

Couldn't Cancel be just link to previous page then?

Actions #7

Updated by Rajmund Hruška about 1 month ago

Pavel Kácha wrote in #note-6:

Couldn't Cancel be just link to previous page then?

Yes it could, that would be quite simple. We would lose that flash which informs about canceling the action, though. But, in my proposed solution we would lose it anyway

Actions #8

Updated by Pavel Kácha about 1 month ago

Rajmund Hruška wrote in #note-7:

Pavel Kácha wrote in #note-6:

Couldn't Cancel be just link to previous page then?

Yes it could, that would be quite simple. We would lose that flash which informs about canceling the action, though. But, in my proposed solution we would lose it anyway

Sure. That is probably also solvable by adding some "flash=" like argument to returning URL, but I guess the whole Cancel flash bussiness is quite superfluous.

Actions #9

Updated by Rajmund Hruška about 1 month ago

  • Status changed from Feedback to In Progress
  • Assignee set to Rajmund Hruška
  • To be discussed changed from Yes to No
Actions #10

Updated by Rajmund Hruška about 1 month ago

  • Status changed from In Progress to Resolved
Actions #11

Updated by Rajmund Hruška about 1 month ago

  • Status changed from Resolved to In Review
Actions #12

Updated by Rajmund Hruška about 1 month ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF