nyudlts / ultraviolet

UltraViolet 💜 is NYU Libraries' DLTS deployment of the InvenioRDM framework. All info in the link.
https://nyudlts.github.io/ultraviolet/
5 stars 5 forks source link

Upload Page Template + React: Look ups for dropdowns #62

Open ekate opened 3 years ago

ekate commented 3 years ago

Upload form has drop down menu for several fields "Languages", "Resource types", "Subjects", "Alternate identifier", "Related works". "Languages" and "Subjects" allow user to do the lookup but other require to scroll through the whole list. During UI testing many users asked to add the functionality the "Upload" form has for "Languages" filed to "Resource types", "Alternate Identifiers" and "Related works" Tasks

Sinclert commented 3 years ago

Hi @ekate 👋🏻

Could you provide a bit of context? Please consider I have been thrown into this sprint without much context of previous discussions.

ekate commented 2 years ago

Module which generates the upload form is react-invenio-deposit.

Sinclert commented 2 years ago

It seems that react-invenio-deposit is not the module to modify / extend.

According to the Invenio developers (Discord response reference), we are "on our own", given that the tuning of the Upload form can only be achieved by a combination of:

ekate commented 2 years ago

The task completion is not feasible in the duration of the current Sprint but we will start work on the new ultraviolet-deposit-module

Sinclert commented 2 years ago

As discussed over Slack, i just created a new repository to serve as home for the deposit form customizations named ultraviolet-deposit-module. It contains documentation about how to create / distribute a repository-independent module.

dismorfo commented 2 years ago

I see that the field "Languages" calls the endpoint /api/vocabularies/languages for suggestions.

Can someone share the link to Invenio API documentation? I would like to see if there is an endpoint to query suggestions for "Alternate Identifiers" and "Related works".

By "Resource types", do you mean the field under "Basic information" or the one that is part of "Related works"? The field looks like a dropdown with a already defined set of valid input. Can you tell me more about the behavior you like to have? Make it an auto-complete? We might not need to change JS, we can try to use <datalist>. See: https://www.sitepoint.com/html5-datalist-autocomplete/

I'm talking about /uploads/new; let me know if I'm looking in the wrong place.

Sinclert commented 2 years ago

Hi @dismorfo,

I think this is the module we would need to customize: https://github.com/inveniosoftware/react-invenio-deposit. Sadly, it does not have any public documentation, as it is not thought to be re-used in any other context (that is literally what I was told in their Discord #newcomers-help channel).

Regarding the usage of <datalist>... I am afraid that would not make the trick. We should not depend on a static HTML list of options when rendering the drop-down menu options. The correct way to do it is by relying on the underlying APIs, which access the languages, resource-types... loaded into the DB.

Please, coordinate with @ekate if you want to know more about this. I will not check this issue any longer.

ekate commented 2 years ago

@dismorfo you can list all available endpoint by running pipenv run invenio routes in ultraviolet root directory. Unfortunately there is no route for resource typeand affiliation. We need to add those. I will do that part. Till this is done could you look at this one - https://github.com/nyudlts/ultraviolet/issues/63

dismorfo commented 2 years ago

@ekate Thanks. I tried $ pipenv run invenio routes | grep api and nothing, not even '/api/vocabularies/languages' that I know exist because of the "Languages" field.

dismorfo commented 2 years ago

See:

ekate commented 2 years ago

As I said above unfortunately there is no route for resource type and affiliation. We need to add those. I am looking at that part now. We need to discuss module structure. Do we want to keep python and javascript parts in one repo or separate ? What do you think

dismorfo commented 2 years ago

I have a prototype working for the "Resource types".

We can change the field type to be "RemoteSelectField" and then is a matter of configuring suggestionAPIUrl to use /api/vocabularies/resourcetypes and pass a fn prop serializeSuggestions for the title.