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

Feature/doi form #455

Merged
merged 23 commits into from
Nov 5, 2021
Merged

Feature/doi form #455

merged 23 commits into from
Nov 5, 2021

Conversation

hannyle
Copy link
Contributor

@hannyle hannyle commented Sep 20, 2021

Description

  • Added DOI form as optional for user to fill in before publishing folder
  • DOI form comes with main features in creators, contributors and formats fields (Check this comment: Feature/doi form #455 (comment))
  • Fixed bugs and made changes to FormAutocompleteField, FormArray, and FormTextField

Related issues

#407

Type of change

  • Bug fixes (breaking change)
  • New feature (non-breaking change which adds functionality)

Changes Made

  • Optimised the search functionality for FormAutocompleteField
  • Fixed bugs for FormAutocompleteField when user deletes some searching characters or enters some non-word ([, (, )) characters
  • Fixed bugs for FormArray component so when user removes a certain field, data of the rest of the fields render correctly
  • Add DOI form as a dialog at Summary step and it is optional to fill in the form
  • Add some features in DOI form:
    • In Creators > Affliliations: user can search for name of the place of affiliation as an autocomplete field from ROR api.
    • The rest of the fields will be automatically filled with their correct values (in equivalent to the affiliation's name), with changes in FormTextField
    • The same functions go for Contributors > Affiliations
    • In Formats, the field(s) would be pre-filled with fileTypes that are submitted from Run and Analysis objects (if exists)
    • Add "nameType": "Personal" as a hidden static field for creators and contributors (back-end needs it)
  • Data from DOI form is saved to currentFolder before publishing.
  • Add e2e test for DOI form and FormArray
  • Add description for FormArray

Testing

  • Integration Tests

Mentions

  • DOI form will be refactored as the last Wizard step before publishing folder in near future

@hannyle hannyle self-assigned this Sep 20, 2021
@hannyle hannyle added the enhancement New feature or request label Sep 20, 2021
@hannyle hannyle added this to the Open Beta milestone Sep 20, 2021
@hannyle hannyle linked an issue Sep 20, 2021 that may be closed by this pull request
@hannyle hannyle marked this pull request as draft September 20, 2021 13:36
@blankdots
Copy link
Contributor

blankdots commented Sep 30, 2021

Seems something is off with some fields
Peek 2021-09-30 09-41


O another note will try to add a schema so that we can control the fields values and information easier

@hannyle hannyle force-pushed the feature/doi-form branch 2 times, most recently from 334b7b4 to 1ca4123 Compare October 11, 2021 07:30
@blankdots
Copy link
Contributor

For the creators and contributors when filling out affiliations:
image
we should use same solution from: #416 it is used under DAC > Organization


List of formats can also be pre filled based on what users fill in into Run > Files > filetype field and Analysis > Files > filetype
image


For List of geolocations we will restrict the fields a list of countries and other fields will be refined
image

@blankdots
Copy link
Contributor

or for the list of geolocations we can use https://nominatim.org/release-docs/develop/api/Search/ as an autocomplete to fill in the Spatial or named place.

Note: @hannyle if you think we need to split the changes I suggested into multiple issues then let us do that.

@hannyle
Copy link
Contributor Author

hannyle commented Oct 12, 2021

Note: @hannyle if you think we need to split the changes I suggested into multiple issues then let us do that.

I can include the autocomplete fields of affiliations in this PR. For other features: List of formats and List of GeoLocations I think it's better to implement separately in other PRs.

@blankdots
Copy link
Contributor

I can include the autocomplete fields of affiliations in this PR. For other features: List of formats and List of GeoLocations I think it's better to implement separately in other PRs.

Ok I will create issues about those

@saulipurhonen
Copy link
Contributor

There seems to be problem within Affiliations field:
Clearing affiliation name doesn't clear other fields. It also seems that selecting a new place of affiliation doesn't change these fields.

2021-11-03.08-54-49.mp4

There also seems to be inconsistency when rendering ror.org affiliation data. In some cases other affiliation fields do not populate and some times they do.

2021-11-03.08-59-48.mp4

Also, clear button position seems to be a bit off but I think this could be fixed later

image

@hannyle
Copy link
Contributor Author

hannyle commented Nov 3, 2021

There seems to be problem within Affiliations field: Clearing affiliation name doesn't clear other fields. It also seems that selecting a new place of affiliation doesn't change these fields.

2021-11-03.08-54-49.mp4

--> Good catch. I was planning to fix this but totally missed it at the end. I will fix it in this PR.

Copy link
Contributor

@saulipurhonen saulipurhonen left a comment

Choose a reason for hiding this comment

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

Saving of DOI form should be tested.

@hannyle
Copy link
Contributor Author

hannyle commented Nov 3, 2021

  • Data from DOI form is saved to currentFolder before publishing.

Should saving DOI info work? I get 400-error on "Save DOI info" button click.
Details: Request URL: http://localhost:3000/folders/9569d6b2d6084543b312b07fd4a8cca2 Request Method: PATCH Status Code: 400 Bad Request
Request Payload: [{"op":"add","path":"/doiInfo","value":{"creators":[{"givenName":"testName","nameType":{"nameType":"Personal"}}],"subjects":[{"subject":"FOS: Natural sciences"}]}}]

  • Latest version of develop branch in backend
  • Reinstalled NPM packages

I made a request with API client and found out that there seems to be some required field problems:

{ "type": "about:blank", "title": "Bad Request", "detail": "Provided input does not seem correct for field: 'doiInfo'", "instance": "/folders/9569d6b2d6084543b312b07fd4a8cca2" }

Right, it's due to my mistake in refactoring the hidden static field "nameType for DOI form.
Saving form should work now and I will update the test for it.

@hannyle
Copy link
Contributor Author

hannyle commented Nov 4, 2021

There seems to be problem within Affiliations field: Clearing affiliation name doesn't clear other fields. It also seems that selecting a new place of affiliation doesn't change these fields.

2021-11-03.08-54-49.mp4
There also seems to be inconsistency when rendering ror.org affiliation data. In some cases other affiliation fields do not populate and some times they do.

2021-11-03.08-59-48.mp4
Also, clear button position seems to be a bit off but I think this could be fixed later

image

--> These issues should be fixed with the latest commits.

@hannyle
Copy link
Contributor Author

hannyle commented Nov 4, 2021

Saving of DOI form should be tested.

--> Saving DOI form is included in cypress test now.

@hannyle hannyle marked this pull request as ready for review November 4, 2021 07:42
@lilachic
Copy link
Contributor

lilachic commented Nov 4, 2021

When publishing a folder from draft list was there meant to be possibility add DOI information?

@hannyle
Copy link
Contributor Author

hannyle commented Nov 4, 2021

When publishing a folder from draft list was there meant to be possibility add DOI information?

I think in this case, user can click Edit the draft folder and add the DOI Information. We don't have yet the option to add DOI info right from Draft Submission List, but that's a good idea to think about.

@saulipurhonen
Copy link
Contributor

Apart from recent requests I did I'd say this looks great to me!

Copy link
Contributor

@blankdots blankdots left a comment

Choose a reason for hiding this comment

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

tested and looks good.

Also added some missing information: #522

@blankdots
Copy link
Contributor

will merge, as this got big enough. Anything else, to be addressed with follow up PRs

@blankdots blankdots merged commit 522c690 into develop Nov 5, 2021
@blankdots blankdots deleted the feature/doi-form branch November 5, 2021 07:17
@blankdots blankdots mentioned this pull request Apr 7, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collect DOI information for folder
4 participants