forked from ontoportal-lirmm/bioportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Federate browse page (ontoportal-lirmm#621)
* simplify the header component to use content instead of a new section * update dropdown component to a custom title section instead of text * update browse page to use Dropdown component not bootsrap one * add color option to square badge component * add text and bg colors options to ontology browse card component * add federation helper code and config sample * add portals filters in the browse page * use federation helpers to get federation ontologies information * remove the filter using index code from submission filter as no used * refactor the filter_using_data function to be faster by using an hash * update the browse analytics cache to change depending on portals * add categories and groups ids on hover to know its origin when federated * use the last part of ids for browse counts independently of its origin * remove binding.pry from final federation code * add an error message if one of the external portal is down * remove $FEDERATED_PORTALS and use existent $PORTALS_INSTANCES variable * handle the merging of the same ontology from different portals * fix groups and categories selection at browse page init
- Loading branch information
1 parent
4a802ff
commit 02025d1
Showing
23 changed files
with
324 additions
and
122 deletions.
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
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
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
5 changes: 4 additions & 1 deletion
5
app/components/dropdown_container_component/dropdown_container_component.html.haml
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 |
---|---|---|
@@ -1,14 +1,40 @@ | ||
# frozen_string_literal: true | ||
|
||
class OntologyBrowseCardComponent < ViewComponent::Base | ||
include OntologiesHelper | ||
include ApplicationHelper, OntologiesHelper, FederationHelper | ||
|
||
def initialize(ontology: nil) | ||
def initialize(ontology: nil, onto_link: nil, text_color: nil, bg_light_color: nil, portal_name: nil) | ||
super | ||
@ontology = ontology | ||
@text_color = text_color | ||
@bg_light_color = bg_light_color | ||
@onto_link = onto_link || "/ontologies/#{@ontology[:acronym]}" if @ontology | ||
@portal_name = portal_name | ||
end | ||
|
||
def ontology | ||
@ontology | ||
end | ||
|
||
def external_ontology? | ||
!internal_ontology?(@ontology[:id]) || (Array(@ontology[:sources]).size > 1) | ||
end | ||
|
||
def onto_link | ||
@onto_link | ||
end | ||
|
||
def style_text | ||
external_ontology? ? "color: #{@text_color} !important" : '' | ||
end | ||
|
||
def portal_color | ||
@text_color | ||
end | ||
alias :color :portal_color | ||
|
||
def style_bg | ||
external_ontology? ? "#{style_text} ; background-color: #{@bg_light_color}" : '' | ||
end | ||
|
||
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
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
Oops, something went wrong.