Skip to content

Commit

Permalink
fix some ligth code bugs after merging with AgroPortal 2.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed May 29, 2024
1 parent 5eb2f39 commit 051e97a
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 25 deletions.
45 changes: 42 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git
revision: f91c32d532e6109b7eaccd5fd2ef51fef2192d71
branch: development
remote: https://github.com/lifewatch-eric/ontologies_api_ruby_client.git
revision: 3f2495783b880dbd277964aa945c197fdd7cd2df
branch: master
specs:
ontologies_api_client (2.2.0)
activesupport
Expand Down Expand Up @@ -88,10 +88,12 @@ GEM
airbrussh (1.5.2)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
attr_required (1.0.2)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
base64 (0.2.0)
bcrypt_pbkdf (1.1.1)
bcrypt_pbkdf (1.1.1-x86_64-darwin)
bigdecimal (3.1.8)
bindata (2.5.0)
bindex (0.8.1)
Expand Down Expand Up @@ -318,6 +320,8 @@ GEM
netrc (0.11.0)
newrelic_rpm (9.9.0)
nio4r (2.7.3)
nokogiri (1.15.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.6-x86_64-linux)
racc (~> 1.4)
oauth2 (2.0.9)
Expand Down Expand Up @@ -356,6 +360,18 @@ GEM
actionpack (>= 4.2)
omniauth (~> 2.0)
open_uri_redirections (0.2.1)
openid_connect (2.2.1)
activemodel
attr_required (>= 1.0.0)
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.16)
rack-oauth2 (~> 2.2)
swd (~> 2.0)
tzinfo
validate_email
validate_url
webfinger (~> 2.0)
parallel (1.24.0)
parser (3.3.1.0)
ast (~> 2.4.1)
Expand All @@ -374,6 +390,13 @@ GEM
rack (>= 0.4)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-oauth2 (2.2.1)
activesupport
attr_required
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
Expand Down Expand Up @@ -516,6 +539,11 @@ GEM
stimulus-rails (1.3.3)
railties (>= 6.0.0)
strscan (3.1.0)
swd (2.0.3)
activesupport (>= 3)
attr_required (>= 0.0.5)
faraday (~> 2.0)
faraday-follow_redirects
temple (0.10.3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand Down Expand Up @@ -543,6 +571,12 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
uri (0.13.0)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
version_gem (1.1.4)
view_component (2.83.0)
activesupport (>= 5.2.0, < 8.0)
Expand All @@ -553,6 +587,10 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webfinger (2.1.3)
activesupport
faraday (~> 2.0)
faraday-follow_redirects
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand All @@ -569,6 +607,7 @@ GEM

PLATFORMS
x86_64-darwin-21
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down
11 changes: 6 additions & 5 deletions app/assets/stylesheets/theme-variables.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
--light-color: #F1F6FA;
}
<% when "ecoportal" %>
:root{
--primary-color: #0f4e8a;
--hover-color: #0f4e8a;
--secondary-color: #ffc107;
}
:root{
--primary-color: #0f4e8a;
--hover-color: #0f4e8a;
--secondary-color: #ffc107;
--light-color: #F1F6FA;
}
<%# Here to add a new theme ... %>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/submission_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def submission_params(params)
{ contact: %i[name email] },
:homepage,
:documentation,
{copyrightHolder: {}} # TODO add automatically no list Agents
{copyrightHolder: {}}, # TODO add automatically no list Agents
:identifier,
:is_doi_requested,
]
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/admin/licenses_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module Admin::LicensesHelper
def license_notification(license)
days = license.days_remaining
if (days == 0)
msg = (t("admin.licenses.license_notification.license_expired") << " " << t("admin.licenses.license_notification.license_contact")).html_safe
msg = "#{t("admin.licenses.license_notification.license_expired")} #{t("admin.licenses.license_notification.license_contact")}".html_safe
notification = tag.div msg, class: "alert alert-danger mt-3", role: "alert"
elsif license.is_trial?
msg = (t("admin.licenses.license_notification.license_trial", count: days) << " " << t("admin.licenses.license_notification.license_obtain") << " " << t("admin.licenses.license_notification.license_contact")).html_safe
msg = "#{t("admin.licenses.license_notification.license_trial", count: days)} #{t("admin.licenses.license_notification.license_obtain")} #{t("admin.licenses.license_notification.license_contact")}".html_safe
notification = tag.div msg, class: "alert alert-info mt-3", role: "alert"
end

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/agent_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def agent_tooltip(agent)
if agent.affiliations && agent.affiliations != []
affiliations = ""
agent.affiliations.each do |affiliation|
affiliations = affiliations + affiliation.acronym + " "
affiliations = "#{affiliations} #{affiliation.acronym} "
end
end
person_icon = inline_svg_tag 'icons/person.svg' , class: 'agent-type-icon'
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def extract_hostname(url)
end

def omniauth_providers_info
$OMNIAUTH_PROVIDERS
$OMNIAUTH_PROVIDERS || []
end

def omniauth_provider_info(strategy)
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
%h4= t('home.twitter_news')
%hr.home-section-line
.home-card.home-twitter-news
%a.twitter-timeline{"data-height" => "360", :href => "https://twitter.com/lagroportal?ref_src=twsrc%5Etfw"}
%a.twitter-timeline{"data-height" => "360", :href => "https://twitter.com/LifeWatchERIC"}
.home-twitter-loader
= render LoaderComponent.new(type: 'pulsing')
%script{:async => "", :charset => "utf-8", :src => "https://platform.twitter.com/widgets.js"}
Expand Down
21 changes: 10 additions & 11 deletions config/initializers/oauth2.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
if $SSO_ENABLED
Oauth2Controller.config do |config|

idpMetadataJSON = JSON.parse(IO.read(Rails.root.join("config/oauth2/idp-configuration.json")), {symbolize_names: true})

config.client_id = Rails.application.credentials.oauth2[:client_id]
config.client_secret = Rails.application.credentials.oauth2[:client_secret]
config.authorization_endpoint = idpMetadataJSON[:authorization_endpoint]
config.token_endpoint = idpMetadataJSON[:token_endpoint]
config.userinfo_endpoint = idpMetadataJSON[:userinfo_endpoint]
config.end_session_endpoint = idpMetadataJSON[:end_session_endpoint]
end
# Oauth2Controller.config do |config|
# idpMetadataJSON = JSON.parse(IO.read(Rails.root.join("config/oauth2/idp-configuration.json")), {symbolize_names: true})
#
# config.client_id = Rails.application.credentials.oauth2[:client_id]
# config.client_secret = Rails.application.credentials.oauth2[:client_secret]
# config.authorization_endpoint = idpMetadataJSON[:authorization_endpoint]
# config.token_endpoint = idpMetadataJSON[:token_endpoint]
# config.userinfo_endpoint = idpMetadataJSON[:userinfo_endpoint]
# config.end_session_endpoint = idpMetadataJSON[:end_session_endpoint]
# end
end

0 comments on commit 051e97a

Please sign in to comment.