forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add federation portals status check (#769)
* cache federation status call * update chip helpers to support disabled state * use turbo frame for federation input chips, and use federation portals status to disable non working portals * add skelton loading animation for federation input chips * cache federation input chips separately * use cached federation input chips in browse page * fix browse page federation inputs section title style * initialize federation portals input chips in the home page (asynch in the background) * clean federated search aggregator code * move chip skelton to components helper * internationalize portal is not responding message * clean federation portal status cache method * clean federation stimulus controller code * display federated browse errors as warning instead of danger (orange instead of red) * use federation portal status in home page portals configuration * fix issue in federation portal status method * clean portal_config_tooltip method to make it more readable * consider the portal as down if the api of it is not present in the config file * put federation portal status vue in a helper, and remove the html file of it * internationalize portals status message * extract federation_input_chips to a helper * put init portals status in home page logic in a helper for clarity * change home/federation_portals_status root to status/:portal_name * use dig in federation_portal_status to ensure to not raise an exception * move init portal status helper to federation file and fix class name * move federation helpers from application helper to federation file and fix variables calls * add loading state to the chips component and use it in federation status * rename federation chip component helper name to prevent conflicts --------- Co-authored-by: Syphax bouazzouni <[email protected]>
- Loading branch information
1 parent
ef836ce
commit 7eb8d76
Showing
17 changed files
with
181 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
class ChipsComponent < ViewComponent::Base | ||
|
||
renders_one :count | ||
def initialize(id:nil, name:, label: nil, value: nil, checked: false, tooltip: nil) | ||
def initialize(id:nil, name:, label: nil, value: nil, checked: false, tooltip: nil, disabled: false, loading: false) | ||
@id = id || name | ||
@name = name | ||
@value = value || 'true' | ||
@checked = checked | ||
@label = label || @value | ||
@tooltip = tooltip | ||
@disabled = disabled | ||
@loading = loading | ||
end | ||
|
||
def checked? | ||
@checked | ||
end | ||
|
||
def disabled_class_name | ||
@disabled ? 'disabled' : '' | ||
end | ||
|
||
def loading_class_name | ||
@loading ? 'loading' : '' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
.chips-container{class: @disabled ? 'disabled' : '', 'data-controller': 'tooltip', title: @tooltip} | ||
.chips-container{class: "#{disabled_class_name} #{loading_class_name}", 'data-controller': 'tooltip', title: @tooltip} | ||
%div | ||
%label{:for => "chips-#{@id}-check"} | ||
%input{:id => "chips-#{@id}-check", :name => @name, :type => "checkbox", :value => @value, checked: checked?, disabled: @disabled} | ||
%span | ||
= inline_svg_tag 'check.svg', class: 'chips-check-icon' | ||
%div | ||
= @label | ||
= count | ||
- if @loading | ||
%label | ||
%span.skeleton | ||
- else | ||
%label{:for => "chips-#{@id}-check"} | ||
%input{:id => "chips-#{@id}-check", :name => @name, :type => "checkbox", :value => @value, checked: checked?, disabled: @disabled} | ||
%span | ||
= inline_svg_tag 'check.svg', class: 'chips-check-icon' | ||
%div | ||
= @label | ||
= count |
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
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
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