-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show orgs with parent coalitions on hub/organization page for org leads #5594
base: main
Are you sure you want to change the base?
Conversation
Heroku app: https://gyr-review-app-5594-76e05317a479.herokuapp.com/ |
@embarnard am i supposed to see something different than this (on the deployed env)?
![]() |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might just need to talk through some stuff b/c I'm unfamiliar with the model structure -- could tag someone else for review if we need to get this moving more quickly! I emoji-reacted on the first PR but didn't realize I had also signed up for the second lol
@@ -7,19 +7,35 @@ def initialize(current_ability) | |||
accessible_organizations = Organization.accessible_by(current_ability) | |||
@organizations = accessible_organizations.includes(:child_sites).with_computed_client_count.load | |||
@coalitions = Coalition.accessible_by(current_ability) | |||
@state_routing_targets = StateRoutingTarget.where(target: accessible_organizations).or(StateRoutingTarget.where(target: @coalitions)).load.group_by(&:state_abbreviation) | |||
coalition_parents_of_dependent_orgs = accessible_organizations.where.not(coalition_id: nil).reorder(nil).distinct.pluck(:coalition_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to do reorder(nil)
& distinct
needed here?
<% end %> | ||
</div> | ||
<div> | ||
<% if can? :create, Coalition %> | ||
<%= link_to t("hub.organizations.index.add_coalition"), new_hub_coalition_path, class: "button"%> | ||
<%= link_to t("hub.organizations.index.add_coalition"), new_hub_coalition_path, class: "button spacing-below-25"%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] extra space
|
||
context "with organizations that have a parent coalition" do | ||
let(:user) { create :organization_lead_user, organization: org } | ||
let!(:org) { create :organization, coalition: create(:coalition), capacity_limit: 300 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably want to do let!
on the user insetad of the org
since user
will create the org when it invokes the variable?
|
||
capacity = subject.state_capacity("NY") | ||
expect(capacity.current_count).to eq 0 | ||
expect(capacity.total_capacity).to eq 300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does the "capacity" mean in this context? Does it limit a certain organization to a total count of...clients? users?
Link to pivotal/JIRA issue
Is PM acceptance required? (delete one)
Reminder: merge main into this branch and get green tests before merging to main
What was done?
How to test?
[email protected]
)/hub/organizations
pageScreenshots (for visual changes)