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

Return API error message in UI #9

Closed
tloubrieu-jpl opened this issue Dec 3, 2020 · 4 comments · Fixed by #12 or #21
Closed

Return API error message in UI #9

tloubrieu-jpl opened this issue Dec 3, 2020 · 4 comments · Fixed by #12 or #21
Assignees
Labels
B12.0 enhancement New feature or request

Comments

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Dec 3, 2020

How to create a test case: send multiple time the same reserve request.

In curl:

curl --location --request POST 'http://localhost:8080/PDS_APIs/pds_doi_api/0.1/dois?action=reserve&submitter=loubrieu@jpl.nasa.gov&node=eng'
--header 'Content-Type: application/json'
--data-raw '{"labels":[{"status":"Reserved","title":"Laboratory Shocked Feldspars Bundle","publication_date":"2020-03-11","product_type_specific":"PDS4 Collection","author_last_name":"Johnson","author_first_name":"J. R.","related_resource":"urn:nasa:pds:lab_shocked_feldspars"}]}

The second time an error 400 is sent back with message:
{
"errors": [
{
"message": "The title: 'Laboratory Shocked Feldspars Bundle' has already been used for a DOI by lidvid(s):urn:nasa:pds:lab_shocked_feldspars::None, status: reserved_not_submitted, doi: ,None . You must use a different title.",
"name": "WarningDOIException"
}
]
}

The errors need to be shown in the UI.

Acceptance criteria:
When an invalidate file is submitted for reservation
Then: the error message is displayed in the UI and helps the user to correct the error

When an invalid PDS4 label is used for draft
Then the error message is displayed in the UI and helps the user to correct the error.

When an invalid OSTI record is submitted for review (ie released to Engineering Node)
Then the error message is displayed in the UI and helps the user to correct the error.

@tloubrieu-jpl tloubrieu-jpl added the enhancement New feature or request label Dec 3, 2020
@tloubrieu-jpl tloubrieu-jpl added this to the PDS.06 (ends 2020-12-17) milestone Dec 3, 2020
eddiesarevalo added a commit that referenced this issue Dec 8, 2020
-Error messages for uploading a reserve request now show when an error is returned form the API.
-If an error is returned a button that allows a retry will reset the reserve form.
-Added content type json to post request.
@tloubrieu-jpl
Copy link
Member Author

Thanks @eddiesarevalo . Can you do something more readable by parsing the json and presenting the error type and text on one line ?

image

tloubrieu-jpl pushed a commit that referenced this issue Dec 10, 2020
* Provide A Way To Move Between Release And Reserve #10

-Added an app bar with buttons for the DOI UI to switch between the release and the reserve button.
-Updated a small space to the top of the release and reserve pages.
-Changed the name of the select component to app body.

* Show API Error Message For Reserve In UI #9

-Error messages for uploading a reserve request now show when an error is returned form the API.
-If an error is returned a button that allows a retry will reset the reserve form.
-Added content type json to post request.
@tloubrieu-jpl tloubrieu-jpl reopened this Dec 10, 2020
tloubrieu-jpl pushed a commit that referenced this issue Jan 28, 2021
* Provide A Way To Move Between Release And Reserve #10

-Added an app bar with buttons for the DOI UI to switch between the release and the reserve button.
-Updated a small space to the top of the release and reserve pages.
-Changed the name of the select component to app body.

* Show API Error Message For Reserve In UI #9

-Error messages for uploading a reserve request now show when an error is returned form the API.
-If an error is returned a button that allows a retry will reset the reserve form.
-Added content type json to post request.

* Add Release Forms And Astronomy Thesaurus #2 #4 #11

-Added search for lidvid in release.
-Added text field to update metadata.
-Added astronomy thesaurus for metadata keywords using material ui autocomplete.
-Added error message for release.
-Installed material ui lab.
-Added release alert to confirm or cancel release.
-Added xml util for processing xml content.

* Add Release Forms And Astronomy Thesaurus #2 #4 #11

-Added search for lidvid in release.
-Added text field to update metadata.
-Added astronomy thesaurus for metadata keywords using material ui autocomplete.
-Added error message for release.
-Installed material ui lab.
-Added release alert to confirm or cancel release.
-Added xml util for processing xml content.
eddiesarevalo added a commit that referenced this issue Feb 1, 2021
-When an error is encountered on submission the form values are not deleted so that the form can be easily submitted again.
-When there is an error on the upload the error message is shown in a readable format. The format is title followed by description.
tloubrieu-jpl pushed a commit that referenced this issue Feb 9, 2021
* Keep Values And Show Message On Error #9 #13

-When an error is encountered on submission the form values are not deleted so that the form can be easily submitted again.
-When there is an error on the upload the error message is shown in a readable format. The format is title followed by description.

* Add Submitter And Node To Release #19

-Submitter and node can now be changed in release. The default value is what is returned in the doi search.
@gxtchen
Copy link

gxtchen commented May 23, 2021

@tloubrieu-jpl Hi Thomas, how do I start the doi-service on localhost:8080? Can you point me to the instructions on doi_ui and doi_api. I tried runing npm install after cloning doi-ui but I don't have the npm package and system wouldn't let me install it either.

Thanks
Gary

@jordanpadams
Copy link
Member

@gxtchen hey Gary, from https://nasa-pds.github.io/releases/11.1/index.html, it's the pds-doi-service here: https://nasa-pds.github.io/pds-doi-service/

@tloubrieu-jpl
Copy link
Member Author

@gxtchen I also added the instructions on the pds-doi-ui README, as a prerequisite https://github.com/NASA-PDS/pds-doi-ui

@jordanpadams jordanpadams added B12.0 and removed B11.1 labels Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B12.0 enhancement New feature or request
Projects
None yet
4 participants