Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion app/controllers/super_admin/orgs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def org_params
params.require(:org).permit(:name, :abbreviation, :logo, :managed,
:contact_email, :contact_name,
:remove_logo, :feedback_enabled, :feedback_msg,
:org_id, :org_name, :org_crosswalk)
:org_id, :org_name, :org_crosswalk,
:funder, :institution, :organisation)
end

def merge_params
Expand Down
4 changes: 2 additions & 2 deletions app/models/org.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ class Org < ApplicationRecord
validates :name, presence: { message: PRESENCE_MESSAGE },
uniqueness: { message: UNIQUENESS_MESSAGE }

validates :abbreviation, presence: { message: PRESENCE_MESSAGE }

validates :is_other, inclusion: { in: BOOLEAN_VALUES,
message: PRESENCE_MESSAGE }

Expand Down Expand Up @@ -290,10 +288,12 @@ def org_admin_plans

if Rails.configuration.x.plans.org_admins_read_all
Plan.includes(:template, :phases, :roles, :users).where(id: combined_plan_ids)
.where(roles: { active: true })
else
Plan.includes(:template, :phases, :roles, :users).where(id: combined_plan_ids)
.where.not(visibility: Plan.visibilities[:privately_visible])
.where.not(visibility: Plan.visibilities[:is_test])
.where(roles: { active: true })
end
end
# rubocop:enable Metrics/AbcSize
Expand Down
2 changes: 1 addition & 1 deletion app/views/orgs/_profile_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="row">
<div class="form-group col-xs-8">
<%= f.label :abbreviation, _('Organisation abbreviated name'), class: "control-label" %>
<%= f.text_field :abbreviation, id: "org_abbreviation", class: "form-control", "aria-required": true %>
<%= f.text_field :abbreviation, id: "org_abbreviation", class: "form-control" %>
</div>
</div>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/org_selectors/_external_only.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ presenter = OrgSelectionPresenter.new(orgs: [default_org],
placeholder = _("Begin typing to see a list of suggestions.")
%>

<%= form.label :org_name, label %>
<%= form.text_field :org_name, class: "form-control autocomplete",
<%= form.label :name, label %>
<%= form.text_field :name, class: "form-control autocomplete",
placeholder: placeholder,
value: presenter.name,
spellcheck: true,
Expand Down
4 changes: 2 additions & 2 deletions spec/models/org_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
.with_message('must be unique')
}

it { is_expected.to validate_presence_of(:abbreviation) }

it { is_expected.to allow_values(true, false).for(:is_other) }

it { is_expected.not_to allow_value(nil).for(:is_other) }
Expand Down Expand Up @@ -401,6 +399,7 @@
@perm = build(:perm)
@perm.name = 'grant_permissions'
user.perms << @perm
plan.add_user!(user.id, :reviewer)
plan.privately_visible!
end

Expand All @@ -413,6 +412,7 @@
@perm = build(:perm)
@perm.name = 'grant_permissions'
user.perms << @perm
plan.add_user!(user.id, :reviewer)
plan.publicly_visible!
end

Expand Down