Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamelers committed Jan 7, 2025
1 parent 50dfa99 commit 4abf09d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/stash_datacite/resources_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def review
@resource.reload
if @resource.identifier.payment_type.blank? || @resource.identifier.payment_type == 'unknown'
@target_page = stash_url_helpers.review_resource_path(@resource.id)
@aff_tenant = StashEngine::Tenant.find_by_ror_id(@resource.identifier&.submitter_affiliation&.ror_id).partner_list.first
@aff_tenant = StashEngine::Tenant.find_by_ror_id(@resource.identifier&.submitter_affiliation&.ror_id).connect_list.first
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/stash_engine/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_login

def choose_sso
set_default_tenant
tenants = StashEngine::Tenant.partner_list.map { |t| { id: t.id, name: t.short_name } }
tenants = StashEngine::Tenant.connect_list.map { |t| { id: t.id, name: t.short_name } }
# If no tenants are defined redirect to the no_parter path
if tenants.empty?
redirect_to :no_partner, method: :post
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/stash_engine/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def institution_select
end

def tenant_select
StashEngine::Tenant.partner_list.map { |t| { id: t.id, name: t.short_name } }
StashEngine::Tenant.connect_list.map { |t| { id: t.id, name: t.short_name } }
end

# no decimal removes the after decimal bits
Expand Down
1 change: 1 addition & 0 deletions app/models/stash_engine/tenant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Tenant < ApplicationRecord
# return all enabled tenants sorted by name
scope :enabled, -> { where(enabled: true).order(:short_name) }
scope :partner_list, -> { enabled.where(partner_display: true) }
scope :connect_list, -> { partner_list.where(choose_sso: true) }
scope :tiered, -> { enabled.where(payment_plan: :tiered) }
scope :sponsored, -> { enabled.distinct.joins(:sponsored) }

Expand Down
2 changes: 1 addition & 1 deletion app/views/stash_engine/tenant_admin/_covers_dpc.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<p>This setting controls whether <%= @tenant.short_name.presence || 'the member'%> covers the cost of Dryad for its users.</p>
<p>This setting controls whether <%= @tenant.short_name.presence || 'the member'%> covers the cost of Dryad for its users. Members must be <b>enabled</b>, <b>shown</b>, and <b>cover the DPC</b> for users to be invited to connect to them.</p>
<p><%= form.check_box :covers_dpc, {checked: @tenant.covers_dpc}, 1, 0 %> <%= form.label :covers_dpc, "Member covers the DPC", class: 'c-input__label' %></p>
2 changes: 1 addition & 1 deletion app/views/stash_engine/tenant_admin/_enabled.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<p>This setting controls whether <%= @tenant.short_name.presence || 'the member'%> is active, and viewable from the admin dashboard. Active members can also be set to display on the member list and for selection by users (with 'Display').</p>
<p>This setting controls whether <%= @tenant.short_name.presence || 'the member'%> is active, and selectable from the admin dashboard. Active members can also be set to display on the member list and for selection by users (with 'Display' and 'Pays DPC').</p>
<p><%= form.check_box :enabled, {checked: @tenant.enabled}, 1, 0 %> <%= form.label :enabled, "Member is active", class: 'c-input__label' %></p>
5 changes: 2 additions & 3 deletions app/views/stash_engine/tenant_admin/_partner_display.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<p>This setting controls whether <%= @tenant.short_name.presence || 'the member'%>, if active, is displayed on the member list and selectable by users looking to connect.</p>
<p><%= form.check_box :partner_display, {checked: @tenant.partner_display}, 1, 0 %> <%= form.label :partner_display, "Member is displayed", class: 'c-input__label' %></p>
<%unless @tenant.enabled %><p><em>Member is inactive, and will not be displayed regardless of this setting</em></p><%end%>
<p>This setting controls whether <%= @tenant.short_name.presence || 'the member'%>, if active, is displayed on the member list.</p>
<p><%= form.check_box :partner_display, {checked: @tenant.partner_display}, 1, 0 %> <%= form.label :partner_display, "Member is displayed", class: 'c-input__label' %></p>

0 comments on commit 4abf09d

Please sign in to comment.