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

Fix: enhance agents errors messages #725

Merged

Conversation

Bilelkihal
Copy link
Collaborator

@Bilelkihal Bilelkihal commented Jul 26, 2024

related issue:
agroportal/project-management#577

related back PR:
ontoportal-lirmm/ontologies_linked_data#152

Changes:

  • Humanization of the agents form errors (errors handled: nil/empty required values errors, unique identifiers errors).

  • Accept all forms of ORCIDs (16 digits, ORCID URL with or without "www." and with or without scheme http/https) then in all cases we pass it in this form to the back: 1234-1234-1234-1234

  • Accept all forms of RORs (9 characters, Full URL with 'https://ror.org/' with or without scheme http/https) then in all cases we pass it in this form to the back: 02mn0vt57

  • If the orcid is not valid, we pass the value invalid_orcid and the back generates an error

  • if the ror is not valid, we pass the value invalid_ror and the back generates an error

Demos:

  • Errors
Enregistrement.de.l.ecran.2024-08-01.a.16.32.16.mov
  • ORCID
Enregistrement.de.l.ecran.2024-08-01.a.16.28.00.mov

@Bilelkihal Bilelkihal self-assigned this Aug 1, 2024
app/controllers/agents_controller.rb Show resolved Hide resolved
app/controllers/agents_controller.rb Show resolved Hide resolved
app/controllers/agents_controller.rb Outdated Show resolved Hide resolved
app/controllers/agents_controller.rb Outdated Show resolved Hide resolved
@jonquet
Copy link

jonquet commented Aug 2, 2024

Attention le comportement osit unifié avec https://github.com/ontoportal-lirmm/bioportal_web_ui/blob/master/app/controllers/users_controller.rb#L261

Philosophie générale: on pre-traite un peu la données a envoyer au back ... mais les vrais validateurs sont dans le back (ou pas dans ce cas la)/.

Copy link
Collaborator Author

@Bilelkihal Bilelkihal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@syphax-bouazzouni ready for your review

@Bilelkihal Bilelkihal force-pushed the feature/enhance-agents-erors-messages branch from 84de17f to 29e12bb Compare August 5, 2024 14:54
@syphax-bouazzouni syphax-bouazzouni merged commit b80f07c into development Aug 6, 2024
4 checks passed
syphax-bouazzouni pushed a commit that referenced this pull request Aug 8, 2024
* accept different orcid forms in agents creation/update form

* humanize empty values errors in creating and updating agents

* accept ror identifier in all forms and handle it in the UI

* humanize identifier already used when updating agent

* put agent form errors in local lang files

* extract generate agents errors function

* remove ror/orcid ui validators

* enhance invalid agents identifiers url error message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants