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

Merge to master: Release 2.8.0 - Search everywhere anything, Visualize mappings cloud and OntoPortal URIs #564

Merged
merged 34 commits into from
May 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e9839ed
Fix: Annotator fast context special chars issues & statistics page sy…
Bilelkihal Apr 4, 2024
06a73eb
Feature: Add json button to search page (#562)
Bilelkihal Apr 5, 2024
0e57aaa
Feature: Adding Content Finder Page (#511)
imadbourouche Apr 7, 2024
8d38f6d
Feature: Add ontology concepts exporters to diffrent formats (xml, nt…
imadbourouche Apr 7, 2024
1e5332e
Feature: update admin page UI to use vertical tabs (#566)
syphax-bouazzouni Apr 9, 2024
b18f6a1
Feature: Add indexation admin page (#567)
syphax-bouazzouni Apr 9, 2024
067bb7e
Feature: Update search input in homepage and topnav to use the indexe…
syphax-bouazzouni Apr 10, 2024
11f9fe1
Feature: Improve Browse page performance (#572)
syphax-bouazzouni Apr 10, 2024
4b85d9b
Feature: Add OntoPortal tools age (#559)
syphax-bouazzouni Apr 11, 2024
44bb10b
Feature: Add concepts mappings button in search page results (#569)
Bilelkihal Apr 11, 2024
7dfbefc
Feature: Add search bars for the instances, properties, collections a…
syphax-bouazzouni Apr 11, 2024
2f7f453
Feature: Update concept mappings table style (#574)
Bilelkihal Apr 12, 2024
7f26a68
Fix: submission date and summary not ready (#576)
syphax-bouazzouni Apr 15, 2024
b7837a7
Feature: Improve browse page search ranking and performance (#575)
syphax-bouazzouni Apr 15, 2024
3937498
Feature: Add terms and conditions to signup and footer links (#579)
Bilelkihal Apr 18, 2024
e68ab1c
Fix: new instance search feature to filter strictly only NamedIndivid…
syphax-bouazzouni Apr 19, 2024
cbbbdd5
Feature: Dynamic routes for ontologies content dereferencement (#568)
imadbourouche Apr 21, 2024
6707357
Feature: Update mappings page (#538)
Bilelkihal Apr 22, 2024
d643bba
fix search page results broken links (#583)
Bilelkihal Apr 22, 2024
285b28e
Fix: admin delete submission route (#585)
Bilelkihal Apr 22, 2024
e6e8146
Fix: Restore the new sample text of the annotator and recommender (#593)
Bilelkihal Apr 25, 2024
83da8be
Fix: search results selected language (#595)
Bilelkihal Apr 25, 2024
c3ea67c
Fix: new instance details page, properties selected property display …
syphax-bouazzouni Apr 25, 2024
cc058df
Feature: add a script to import or export CSV of the i18n locals (#597)
syphax-bouazzouni Apr 26, 2024
2360d29
Fix: Remove duplicated ontology scheme rows (#584)
Bilelkihal Apr 26, 2024
b4eb6e0
fix: summary page for ontologies with no submissions
syphax-bouazzouni Apr 26, 2024
08d5b86
Fix: Note thread show action (#606)
syphax-bouazzouni Apr 29, 2024
8f209f9
Fix: user reset password internationalisation issue (#605)
syphax-bouazzouni Apr 29, 2024
5de66c7
fix: trim the copied text in the clipboard stimulus controller (#611)
imadbourouche May 2, 2024
1fdc64f
Feature: Add recommender system tests (#599)
Bilelkihal May 8, 2024
96cb0a0
Feature: add htaccess URIs redirection modal help (#580)
imadbourouche May 13, 2024
c82e4e6
Fix: Release 2.8.0 grouped issues - Summary, Concept, Notes, Mappings…
Bilelkihal May 20, 2024
6d27190
fix data tables warning issue (#624)
Bilelkihal May 21, 2024
d42baf1
Merge branch 'master' into development
syphax-bouazzouni May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feature: Add json button to search page (#562)
* add json button ui to search page

* extract json_link method from annotator controller to application controller

* build the search page json link using json_link method

* move the search json button down besides the advanced options button

* remove this usage of api_params instead of direct params in search controller

---------

Co-authored-by: Syphax Bouazzouni <[email protected]>
  • Loading branch information
Bilelkihal and syphax-bouazzouni committed Apr 5, 2024
commit 06a73ebe12eab63d9089da52866b7be9dfe1a6ce
1 change: 1 addition & 0 deletions app/assets/stylesheets/search.scss
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@
}
.search-page-advanced-button{
display: flex;
align-items: center;
}
.search-page-advanced-button :hover{
cursor: pointer;
8 changes: 0 additions & 8 deletions app/controllers/annotator_controller.rb
Original file line number Diff line number Diff line change
@@ -201,14 +201,6 @@ def empty_advanced_options
params[:fast_context].nil? &&
params[:lemmatize].nil?
end


def json_link(url, optional_params)
base_url = "#{url}?"
filtered_params = optional_params.reject { |_, value| value.nil? }
optional_params_str = filtered_params.map { |param, value| "#{param}=#{value}" }.join("&")
return base_url + optional_params_str + "&apikey=#{$API_KEY}"
end

def remove_special_chars(input)
regex = /^[a-zA-Z0-9\s]*$/
7 changes: 7 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -718,6 +718,13 @@ def request_lang
helpers.request_lang
end

def json_link(url, optional_params)
base_url = "#{url}?"
filtered_params = optional_params.reject { |_, value| value.nil? }
optional_params_str = filtered_params.map { |param, value| "#{param}=#{value}" }.join("&")
return base_url + optional_params_str + "&apikey=#{$API_KEY}"
end

private
def not_found_record(exception)
@error_message = exception.message
2 changes: 2 additions & 0 deletions app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
params[:query] = nil
@advanced_options_open = false
@search_results = []
@json_url = json_link("#{rest_url}/search", {})

return if @search_query.empty?

@@ -19,6 +20,7 @@

@advanced_options_open = !search_params_empty?
@search_results = aggregate_results(@search_query, results)
@json_url = json_link("#{rest_url}/search", params.permit!.to_h)

Check warning

Code scanning / Brakeman

Specify exact keys allowed for mass assignment instead of using permit! which allows any keys. Warning

Specify exact keys allowed for mass assignment instead of using permit! which allows any keys.
end

def json_search
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -28,6 +28,10 @@ def url_to_endpoint(url)
endpoint
end

def search_json_link(link = @json_url, style: '')
custom_style = "font-size: 50px; line-height: 0.5; margin-left: 6px; #{style}".strip
render IconWithTooltipComponent.new(icon: "json.svg",link: link, target: '_blank', title: t('fair_score.go_to_api'), size:'small', style: custom_style)
end

def resolve_namespaces
RESOLVE_NAMESPACE
37 changes: 20 additions & 17 deletions app/views/search/index.html.haml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
= render Buttons::RegularButtonComponent.new(id:'search-page-button', value: "Search", variant: "primary", type: "submit") do |btn|
= btn.icon_right do
= inline_svg_tag "icons/search.svg"


.search-page-advanced{'data-reveal-component-target': 'item', class: "#{@advanced_options_open ? '' : 'd-none'}"}
.left
@@ -17,14 +17,14 @@
= t('search.advanced_options.search_language')
.field
= search_language_selector(name: 'lang', selected: params[:lang])

.filter-container
.title
= t("search.advanced_options.ontologies")
.field
= ontologies_selector(id:'search_page_ontologies' ,name: 'ontologies[]', selected: params[:ontologies]&.split(','))

.right
.right
.filter-container
.title
= t("search.advanced_options.include_in_search_title")
@@ -40,20 +40,23 @@
= render(ChipsComponent.new(name: 'require_exact_match', label: t('search.advanced_options.show_only_values.exact_matches'), checked: params[:require_exact_match]))
= render(ChipsComponent.new(name: 'require_definition', label: t('search.advanced_options.show_only_values.classes_with_definitions'), checked: params[:require_definition]))

.search-page-options
- if @search_results
.search-page-number-of-results
.search-page-options{class: @search_results.empty? ? 'justify-content-end': ''}
- unless @search_results.empty?
.search-page-number-of-results
= "#{t('search.match_in')} #{@search_results.length} #{t('search.ontologies')}"
.search-page-advanced-button.show-options{class: "#{@advanced_options_open ? 'd-none' : ''}",'data': {'action': 'click->reveal-component#show', 'reveal-component-target': 'showButton'}}
.icon
=inline_svg_tag 'icons/settings.svg'
.text
= t('search.show_advanced_options')
.search-page-advanced-button.hide-options{class: "#{@advanced_options_open ? '' : 'd-none'}", 'data': {'action': 'click->reveal-component#hide', 'reveal-component-target': 'hideButton'}}
.icon
=inline_svg_tag 'icons/hide.svg'
.text
= t('search.hide_advanced_options')
%div.d-flex
.search-page-json.mx-4
= search_json_link
.search-page-advanced-button.show-options{class: "#{@advanced_options_open ? 'd-none' : ''}",'data': {'action': 'click->reveal-component#show', 'reveal-component-target': 'showButton'}}
.icon
=inline_svg_tag 'icons/settings.svg'
.text
= t('search.show_advanced_options')
.search-page-advanced-button.hide-options{class: "#{@advanced_options_open ? '' : 'd-none'}", 'data': {'action': 'click->reveal-component#hide', 'reveal-component-target': 'hideButton'}}
.icon
=inline_svg_tag 'icons/hide.svg'
.text
= t('search.hide_advanced_options')
- if @search_results
.search-page-results-container
- number = 0
@@ -69,7 +72,7 @@
- number = number + 1
- c.reuse(r[:root].merge(is_sub_component: true, number: number)) do |b|
- r[:descendants].each { |dd| b.subresult(dd.merge(is_sub_component: true))}

- if @search_results.empty? && !@search_query.empty?
.browse-empty-illustration
%img{:src => "#{asset_path("empty-box.svg")}"}