-
Notifications
You must be signed in to change notification settings - Fork 0
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
I251 subject search box #238
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c328ca3
[i212] - connect LOC to remote qa
ShanaLMoore 04be464
[i212] - add subject partial for controlled vocabulary and spec
ShanaLMoore efe37b5
Merge branch 'main' into i212-remote-qa
ShanaLMoore fc0b789
rubocop fix
ShanaLMoore ec77d4e
Merge branch 'main' into i212-remote-qa
ShanaLMoore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%= f.input :subject, | ||
# TODO(shanalmoore) as: :controlled_vocabulary is not working for some reason, | ||
as: :multi_value, | ||
placeholder: 'Search for a subject', | ||
input_html: { | ||
class: 'form-control', | ||
data: { 'autocomplete-url' => "/authorities/search/loc/subjects", | ||
'autocomplete' => key } | ||
}, | ||
### Required for the ControlledVocabulary javascript: | ||
wrapper_html: { data: { 'autocomplete-url' => "/authorities/search/loc/subjects", | ||
'field-name' => key }}, | ||
required: f.object.required?(key) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Qa.config do |config| | ||
# When enabled, CORS headers will be added to the responses for search and show. `OPTIONS` method will also be supported. | ||
# Uncomment one of the lines below to enable or disable CORS headers. This configuration defaults to disabled when not set. | ||
# More information on CORS headers at: https://fetch.spec.whatwg.org/#cors-protocol | ||
# config.enable_cors_headers | ||
# config.disable_cors_headers | ||
|
||
# Provide a token that allows reloading of linked data authorities through the controller | ||
# action '/reload/linked_data/authorities?auth_token=YOUR_AUTH_TOKEN_DEFINED_HERE' without | ||
# requiring a restart of rails. By default, reloading through the browser is not allowed | ||
# when the token is nil or blank. Change to any string to control who has access to reload. | ||
config.authorized_reload_token = 'YOUR_AUTH_TOKEN_DEFINED_HERE' | ||
|
||
# For linked data access, specify default language for sorting and selection. The default is only used if a language is not | ||
# specified in the authority's configuration file and not passed in as a parameter. (e.g. :en, [:en], or [:en, :fr]) | ||
# config.default_language = :en | ||
|
||
# When true, prevents ldpath requests from making additional network calls. All values will come from the context graph | ||
# passed to the ldpath request. | ||
# config.limit_ldpath_to_context = true | ||
|
||
# Define default behavior for property_map.optional? when it is not defined in the configuration for a property. | ||
# When false, properties that do not override default optional behavior will be shown whether or not the property has a value in the graph. | ||
# When true, properties that do not override default optional behavior will not be shown whn the property does not have a value in the graph. | ||
# config.property_map_default_for_optional = false | ||
|
||
# IP data including IP address, city, state, and country will be logged with each request. | ||
# When false, IP data is logged | ||
# When true, IP data will not be logged (default for backward compatibility) | ||
# config.suppress_ip_data_from_log = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
url-pattern: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file was produced by the generator. I am not sure how it gets used yet, but would prefer to keep it around for now to not forget about it later. |
||
prefix-query: http://tspilot.oclc.org/{authority-id}/?query=oclcts.rootHeading+exact+%22{query}*%22&version=1.1&operation=searchRetrieve&recordSchema=http%3A%2F%2Fzthes.z3950.org%2Fxml%2F1.0%2F&maximumRecords=10&startRecord=1&resultSetTTL=300&recordPacking=xml&recordXPath=&sortKeys= | ||
id-lookup: http://tspilot.oclc.org/{authority-id}/?query=dc.identifier+exact+%22{id}%22&version=1.1&operation=searchRetrieve&recordSchema=http%3A%2F%2Fzthes.z3950.org%2Fxml%2F1.0%2F&maximumRecords=10&startRecord=1&resultSetTTL=300&recordPacking=xml&recordXPath=&sortKeys= | ||
authorities: | ||
lcgft: | ||
name: Library of Congress Genre/Form Terms for Library and Archival Materials (LCGFT) | ||
bisacsh: | ||
name: Book Industry Study Group Subject Headings (BISAC®). Used with permission. | ||
fast: | ||
name: Faceted Application of Subject Terminology (FAST subject headings) | ||
gsafd: | ||
name: Form and genre headings for fiction and drama | ||
lcshac: | ||
name: Library of Congress AC Subject Headings | ||
lcsh: | ||
name: Library of Congress Subject Headings | ||
mesh: | ||
name: Medical Subject Headings (MeSH®) | ||
lctgm: | ||
name: "Thesaurus for graphic materials: TGM I, Subject terms" | ||
gmgpc: | ||
name: "Thesaurus for graphic materials: TGM II, Genre terms" | ||
meta: | ||
name: Controlled Vocabulary Metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'records/edit_fields/_subject.html.erb', type: :view do | ||
let(:work) { GenericWork.new } | ||
let(:form) { Hyrax::GenericWorkForm.new(work, nil, controller) } | ||
let(:form_template) do | ||
%( | ||
<%= simple_form_for [main_app, @form] do |f| %> | ||
<%= render "records/edit_fields/subject", f: f, key: 'subject' %> | ||
<% end %> | ||
) | ||
end | ||
|
||
before do | ||
assign(:form, form) | ||
render inline: form_template | ||
end | ||
|
||
it 'has url for autocomplete service' do | ||
expect(rendered).to have_selector( | ||
'input[data-autocomplete-url="/authorities/search/loc/subjects"][data-autocomplete="subject"]' | ||
) | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will eventually need to be dynamic (to work for any flex defined controlled value).