Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata UI freezes on empty mandatory fields #7034

Closed
etj opened this issue Mar 8, 2021 · 4 comments
Closed

Metadata UI freezes on empty mandatory fields #7034

etj opened this issue Mar 8, 2021 · 4 comments
Assignees
Labels
frontend Issues regarding Frontend and styling javascript Pull requests that update Javascript code major A high priority issue which might affect a lot of people or large parts of the codebase
Milestone

Comments

@etj
Copy link
Contributor

etj commented Mar 8, 2021

Expected vs actual Behavior

If a mandatory field is set as empty, and the "update" button is pressed, the UI freezes:
image

Pls note that mandatory fields on UI are usually pre-filled, so this misbehaviour is normally triggered only if a user edit a mandatory field and empties it.

Steps to Reproduce the Problem

  1. edit a layer/map/document
  2. empty a mandatory field (e.g. date)
  3. press the update button

Specifications

  • GeoNode version: All
@mattiagiupponi mattiagiupponi self-assigned this Mar 8, 2021
@afabiani afabiani added frontend Issues regarding Frontend and styling javascript Pull requests that update Javascript code major A high priority issue which might affect a lot of people or large parts of the codebase labels Mar 9, 2021
@afabiani afabiani added this to the 3.2 milestone Mar 9, 2021
@etj
Copy link
Contributor Author

etj commented Mar 11, 2021

Error still there:

  1. edit a layer
  2. in the first tab empty the date field
  3. change tab
  4. press the update button
  5. --> freeze with the same dialog as before

@etj etj reopened this Mar 11, 2021
@mattiagiupponi
Copy link
Contributor

Looks like that if you are not in the first tab some errors occur.
Chrome for example drop this error:
An invalid form control with name='resource-date' is not focusable
I'm going to investigate a little more

@mattiagiupponi
Copy link
Contributor

This comment answer a bit to the problem https://stackoverflow.com/questions/7168645/invalid-form-control-only-in-google-chrome/7264966#7264966

So it looks like that if you change the tab with a 'required field', Django tries to show the classic popup "this field is required" but if fails because is not visible on the page

@mattiagiupponi
Copy link
Contributor

Error still there:

  1. edit a layer
  2. in the first tab empty the date field
  3. change tab
  4. press the update button
  5. --> freeze with the same dialog as before

@etj the fix is ready and available here #7071. In few words instead of the search only for visible required fields, now the JS will search for all fields required and this prevents the submission without filling required fields from the others tab.
The error on the console An invalid form control with name='resource-date' is not focusable is still present because Django still try to show the popup `This field is required even if the user is on another tab, but at least now the form will not freezing anymore

afabiani pushed a commit that referenced this issue Mar 12, 2021
…fields (#7072)

* [Fixes: #7034] Metadata UI freezes on empty mandatory fields

* [Fixes #7034] Metadata UI freezes on empty mandatory fields

* [Fixes #7034] Metadata UI freezes on empty mandatory fields
afabiani pushed a commit that referenced this issue Mar 16, 2021
* [Fixes: #7034] Metadata UI freezes on empty mandatory fields

* [Fixes: #7034] italian translations added

* [Fixes: #7034] Metadata UI freezes on empty mandatory fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Issues regarding Frontend and styling javascript Pull requests that update Javascript code major A high priority issue which might affect a lot of people or large parts of the codebase
Projects
None yet
Development

No branches or pull requests

3 participants