Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Address editor silently ignores changes if the mandatory fields are not filled #619

Closed
teosarca opened this issue Apr 8, 2017 · 7 comments

Comments

@teosarca
Copy link
Member

teosarca commented Apr 8, 2017

Type of issue

Bug

Current behavior

NOTE: in address editor, the country field is mandatory

When editing a new address, if you fill the other fields (e.g. address1) but not the country and then you click away, the frontend is silently ignoring the changes (i.e. does not call the /complete endpoint)

NOTE:

  • backend informed that country is mandatory
  • backend filled correctly the saveStatus/validStatus

NOTE2: please also check/fix this issue on Product Attributes editor.

Expected behavior

IMHO, in this case, the frontend shall ask user if he/she really wants to cancel editing in this case.

Steps to reproduce

  • pick a BPartner, e.g. https://w101.metasfresh.com:8443/window/123/2156482
  • try to add a new BP location
  • click on location editor
  • fill the Address1 field, but DO NOT fill the Country field
  • click away
    => frontend is silently ignoring the changes, without any question => NOK
@teosarca teosarca added this to the 2017-15 milestone Apr 8, 2017
@damianprzygodzki damianprzygodzki self-assigned this Apr 10, 2017
@damianprzygodzki
Copy link
Contributor

I can't understand that. The mandatory property was introduced to avoid saving entity without filled value. It is not "silently" ignored, but vividly parsed:

//there are required values that are not set. just close
        if (mandatory.length && !valid){
            return this.handleToggle(false);
        }

It was introduced by the issue #294 when leaving attributes widget was returning error, due to not filling mandatory fields.

The patch for other fields in attributes are not canceled by mandatory field, is regularly patched.

If You want to remove that validation, so what is reason of mandatory field there? Only visual? And it will be properly parsed by API? So should we keep that consistancy everywhere? And remove mandatory validation for every widget?

@cadavre
Copy link
Contributor

cadavre commented Apr 10, 2017

It's another case of "we started editing and didn't finished with all required fields". Due to recent changes of adding "Do you want to leave?" we should add something similar to this also for attributes widget.

@damianprzygodzki
Copy link
Contributor

damianprzygodzki commented Apr 10, 2017

Yes, no problem - but, i think that we still should not call complete. If so, we should remove mandatory property there.

damianprzygodzki added a commit that referenced this issue Apr 10, 2017
#619 Window confirmation for all of attribute widgets
metas-ts added a commit to metasfresh/metasfresh that referenced this issue Apr 13, 2017
[#631](metasfresh/metasfresh-webui-frontend-legacy#631) Minor grid view layout tweaks
[#628](https://github.com/metasfresh/metasfresh-webui-frontr /process/start response
[#294](metasfresh/metasfresh-webui-api-legacy#294) Refactor /process/start response
[#1291](#1291) Manufacturing Order Window adjustments
[#620](metasfresh/metasfresh-webui-frontend-legacy#620) When deleting a newly created document, frontend shall not ask the user if he/she wants to leave the page
[#619](metasfresh/metasfresh-webui-frontend-legacy#619) Address editor silently ignores changes if the mandatory fields are not filled
[#1057](#1057) Role window WebUI
[#267](metasfresh/metasfresh-webui-frontend-legacy#267) Sidelist refactor
[#886](#886) GrandTotal missing in GridView of Purchase Order
[#695](#695) swingUI: provide lib-dirs to access user jars and dlls at runtime
[#110](metasfresh/metasfresh-webui-frontend-legacy#110) Don't fetch the side list when it's not needed
[#88](metasfresh/metasfresh-webui-frontend-legacy#88) Special Place for Record dependent content
[#636](metasfresh/metasfresh-webui-frontend-legacy#636) Sidelist Fontsize too small

me-45
@metas-dh
Copy link
Member

Results of IT1
tested on w101

  • "Do you want to leave?" when leaving the address edit after setting PLZ, but without setting country: OK

@teosarca: i did not get any question when leaving the product attributes editor, e.g. in orderline, is that OK? afiar there are no mandatory fields anymore in product attributes editor?

@teosarca
Copy link
Member Author

@metas-dh no, it's not

@damianprzygodzki Damian, can u pls check for ASI editor too?

@damianprzygodzki
Copy link
Contributor

damianprzygodzki commented Apr 14, 2017

@teosarca It is the same widget, so there is no difference. Could you locate ASI with mandatory field?

...didn't finished with all required fields

Please remember that question is appearing only when there are not filled mandatory field.

@metas-dh
Copy link
Member

Results of IT2
tested on w101

  • set one tye of ASI as mandatory for testing purposes
  • "Do you want to leave?" when leaving the attribute editor after setting attributes, but without setting the mandatory one: OK

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants