Skip to content

Commit

Permalink
Updated the typeahead controller to remove the user-entered value fro…
Browse files Browse the repository at this point in the history
…m the dropdown. Also, fixed issue with Repository URL field helper text displaying, even when that field is hidden.
  • Loading branch information
jupiter007 committed May 10, 2024
1 parent b01dc3c commit 7f1d8c0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions app/controllers/api/v3/typeaheads_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ def process_results(term:, matches: [])
results = deduplicate(term: term, list: matches)
results.map(&:name).flatten.compact.uniq
out = paginate_response(results: results)

# Add the search term if it was not included in the results already
term_matched = results.select do |it|
it.name&.split(' (')&.first&.downcase&.strip == term.split(' (')&.first&.downcase&.strip
end
out.unshift(Org.new(name: term)) unless term_matched.any?
out
end

# Weighs the result. The greater the weight the closer the match, preferring Orgs already in use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function ResearchOutputs() {
disabled={dataObj.repository.isLocked}
hidden={dataObj.repository.isLocked}
/>
<p class="dmpui-field-help">(e.g., "https://dataverse.org/")</p>
<p class="dmpui-field-help" hidden={dataObj.repository.isLocked}>(e.g., "https://dataverse.org/")</p>
</div>
</div>

Expand Down

0 comments on commit 7f1d8c0

Please sign in to comment.