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

Reserve DOI UI forms #1

Closed
tloubrieu-jpl opened this issue Oct 22, 2020 · 7 comments · Fixed by #6
Closed

Reserve DOI UI forms #1

tloubrieu-jpl opened this issue Oct 22, 2020 · 7 comments · Fixed by #6
Assignees
Labels
B12.0 enhancement New feature or request

Comments

@tloubrieu-jpl
Copy link
Member

tloubrieu-jpl commented Oct 22, 2020

Acceptance criteria:
Given a xls spreadsheet of DOIs to be reserved (see format https://pds-engineering.jpl.nasa.gov/sites/default/files/DOI_reserve_template.xlsx)
When I reserve using the 'reserve' form
Then: the DOIs are provided with a reserved status
And: I can re-use the DOI metadata to draft the DOI before publishing it (release).

@tloubrieu-jpl tloubrieu-jpl changed the title Reserve DOI UI screen Reserve DOI UI forms Oct 22, 2020
@tloubrieu-jpl
Copy link
Member Author

@eddiesarevalo validated that a xsl spreadsheet can be uploaded and parsed in the UI.

@eddiesarevalo will add in the ticket an example of the json created in the UI from the xslx document.

@eddiesarevalo
Copy link
Member

@tloubrieu-jpl @collinss-jpl
Given this example excel sheet that has 2 sheets and 2 rows each: https://app.zenhub.com/files/236099103/fa871565-a5f3-40aa-92eb-8e0e01f8974e/download
The UI parses out the contents to keep this JSON in memory. The keys can be changed to whatever the server is expecting. Also this is just an example. I don't know if people will submit multiple sheets but it is supported.
The keys correspond to the title values in the excel sheet.

[{
	"status": "Reserved",
	"title": "Laboratory Shocked Feldspars Bundle",
	"publication_date": 43901,
	"product_type_specific": "PDS4 Collection",
	"author_last_name": "Johnson",
	"author_first_name": "J. R.",
	"related_resource": "urn:nasa:pds:lab_shocked_feldspars"
}, {
	"status": "Reserved",
	"title": "Laboratory Shocked Feldspars Bundle2",
	"publication_date": 43901,
	"product_type_specific": "PDS4 Collection",
	"author_last_name": "Johnson",
	"author_first_name": "J. R.",
	"related_resource": "urn:nasa:pds:lab_shocked_feldspars"
}, {
	"status": "Reserved",
	"title": "Laboratory Shocked Feldspars Bundle",
	"publication_date": 43901,
	"product_type_specific": "PDS4 Collection",
	"author_last_name": "Johnson",
	"author_first_name": "J. R.",
	"related_resource": "urn:nasa:pds:lab_shocked_feldspars"
}, {
	"status": "Reserved",
	"title": "Laboratory Shocked Feldspars Bundle2",
	"publication_date": 43901,
	"product_type_specific": "PDS4 Collection",
	"author_last_name": "Johnson",
	"author_first_name": "J. R.",
	"related_resource": "urn:nasa:pds:lab_shocked_feldspars"
}]

@collinss-jpl
Copy link

@eddiesarevalo This looks great, thanks for posting it. Had one small observation though, looks like publication_date is getting parsed in a strange way? Not sure how 43901 maps to the "2020-03-11" or "3/11/2020" values from excel sheet you linked. Is there a decoding step that the API would need to perform to get the date back?

@eddiesarevalo
Copy link
Member

@collinss-jpl It might be converting it to hours since 1970. I wasn't sure what format you are expecting so I just left it alone but I can convert that number to any date string you think is good.

@tloubrieu-jpl
Copy link
Member Author

Ah yes @eddiesarevalo @collinss-jpl for pubication date we had this issue with the command line implementation, sometimes the xls spreadsheet use a specific type for date time and then it converts it to something, but sometimes, the column is just a string.
The easiest way would be to ignore the xls typing and force to always send a string from the UI. The string is in format 'YYYY-MM-DD' which is the date part of the ISO8601 format.

@collinss-jpl
Copy link

@eddiesarevalo Just a heads up, I've started writing the schema for this JSON format into the openapi spec and in order to support multiple labels I needed to include a top-level "labels" key assigned to the list of dictionaries like so:

{
  "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"
    },
    ...
  ]
}

@tloubrieu-jpl tloubrieu-jpl transferred this issue from NASA-PDS/doi-service Nov 5, 2020
@tloubrieu-jpl
Copy link
Member Author

Does not include the API connection

@tloubrieu-jpl tloubrieu-jpl added the enhancement New feature or request label Nov 9, 2020
eddiesarevalo added a commit that referenced this issue Nov 9, 2020
-Added the ability to upload and parse an excel sheet.
-Added xlsx.
-Parsed content is displayed on the reserve page.
eddiesarevalo added a commit that referenced this issue Nov 9, 2020
-After an XLS file is uploaded and parsed the values are now shown in a table.
-Date values are now kept as a string.
tloubrieu-jpl pushed a commit that referenced this issue Dec 3, 2020
* Initialize project using Create React App

* Initial Commit

-Created App Component.
-Created Reserve Component.
-Created Release Component.
-Added Material UI.
-Added Redux.
-Added Roboto font.
-Created store.
-Created actions.
-Created reducer.
-Added PDS app bar.

* Allow Parsing Of Excel Sheets #1

-Added the ability to upload and parse an excel sheet.
-Added xlsx.
-Parsed content is displayed on the reserve page.

* Show Parsed XLS Values #1

-After an XLS file is uploaded and parsed the values are now shown in a table.
-Date values are now kept as a string.

* Add Saga #5

-Added Saga to support http requests.

* Connect To Reserve API #5

-Added form fields to enter reserve API parameters.
-Used Saga to connect to reserve API.

* Add Pull Request Changes #6

-Removed action/draft drop down. This should always be set to draft.
-Removed URL field.
-Changed package name.
-Moved out endpoint to a config.

* Update README.md #6

-Updated the readme file with more details and build instructions.

* Change Draft To Reserve #6

-Fixed a typo in the last commit. The action should be reserve not draft.
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
Development

Successfully merging a pull request may close this issue.

4 participants