samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
184 stars 124 forks source link

Extend Autocomplete.es6 to generate more LinkedData objects instead of just for based_near #3510

Open straleyb opened 5 years ago

straleyb commented 5 years ago

Descriptive summary

This ticket describes the need to be able to generate Linked Data fields on the form using the LinkedData object found here: https://github.com/samvera/hyrax/blob/master/app/assets/javascripts/hyrax/autocomplete/linked_data.es6

Currently, the only field capable of generating a LinkedData object, which in turn, generates the Select2 html and corresponding javascript to help support linked data, is based_near. This is because it is hardcoded in this file. https://github.com/samvera/hyrax/blob/master/app/assets/javascripts/hyrax/autocomplete.es6#L26

We would like to generate more fields as linked data fields, which support autocomplete from endpoints, which in turn, inject data into the hidden id field in the html and deep index through the deep_indexing_service.

Rationale

Being able to generate more fields as a linked data field, would raise the power of linked data in the system and improve overall metadata of the system by exposing more fields to things like alternative labels, broader or narrower terms, and other pieces of useful data.

Expected behavior

When a field is expressed as a linked data field, it renders the select2 input on the edit/new page of a work.

Actual behavior

The only field that renders a linked data field is based_near

straleyb commented 5 years ago

@samvera/hyrax-repo-managers