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

string fields are not marked as mandatory when empty #548

Closed
metas-lc opened this issue Mar 17, 2017 · 5 comments
Closed

string fields are not marked as mandatory when empty #548

metas-lc opened this issue Mar 17, 2017 · 5 comments

Comments

@metas-lc
Copy link

Type of issue

Bug

Current behavior

string fields (e.g. Name) are not marked as mandatory when you remove them

Expected behavior

field should get red and marked as mandatory

Steps to reproduce

  1. go to Product window
  2. take an already existing product and remove the name
    => product is saved, even if the name is mandatory.
    => no red mark to see that the name is not set
    => name is empty not null, probably that's why

Window: 140

Entity: e.g. 1000001

productname1

productname2

@teosarca
Copy link
Member

hmmm, i think this one can and shall be completely solved on backend: metasfresh/metasfresh#1173

@teosarca
Copy link
Member

update: we workaround this issue on backend side,
but i think that we shall also implement this logic on frontend.

i.e. for text fields, null and empty shall be considered as "field is not field"... so in case it's mandatory, it will be painted accordingly.
@damianprzygodzki can we implement this easily on frontend, without turning the world upside down and without workarounds ?

@damianprzygodzki
Copy link
Contributor

damianprzygodzki commented Mar 20, 2017

We are marking mandatory field in that way (and it is okay, because it relays fully on frontend) but in my opinion we should do not force input-error state on frontend site. I can copy the same condition that is triggering input-mandatory state, but i fear that forcing something on frontend, that relays on API in future can corrupt API state. I.e. if you set on API that the input is valid (just because) and some condition will be blocking API state - and without going into code, you cant check why.

@cadavre
Copy link
Contributor

cadavre commented Mar 20, 2017

True validation shall be made on backend because it's the place to save correct data. Front-end is responsible for displaying validation results, not validation itself. We should stick to one place with validation and not spread it because it will end up not being debuggable.

@teosarca
Copy link
Member

Thanks guys for checking it.
Seems ok now so i am closing this issue.

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

4 participants