Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

embarnard
Copy link
Contributor

Link to pivotal/JIRA issue

Is PM acceptance required? (delete one)

  • Yes - don't merge until JIRA issue is accepted!

Reminder: merge main into this branch and get green tests before merging to main

What was done?

  • Show organizations that have a parent coalition to organization leads

How to test?

  1. go to heroku hub
  2. login as org lead ([email protected])
  3. go to the /hub/organizations page
  4. See if you can see your org that has a parent coalition

Screenshots (for visual changes)

  • Before
  • After

@embarnard embarnard changed the title Show orgs with parent coalitions on hub/organization page Show orgs with parent coalitions on hub/organization page for org leads Feb 15, 2025
Copy link

Heroku app: https://gyr-review-app-5594-76e05317a479.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5594 (optionally add --tail)

@arinchoi03
Copy link
Contributor

arinchoi03 commented Feb 18, 2025

@embarnard am i supposed to see something different than this (on the deployed env)?

See if you can see your org that has a parent coalition

Screenshot 2025-02-18 at 11 45 37 AM

@embarnard
Copy link
Contributor Author

embarnard commented Feb 18, 2025

@embarnard am i supposed to see something different than this (on the deployed env)?

See if you can see your org that has a parent coalition

Screenshot 2025-02-18 at 11 45 37 AM

Oh shoot I meant to make an org without a parent coalition on heroku, I'll do that now! I think I know what's happening, the coalition doesn't have any state routing which is why it didn't show up. I fixed it for the state partial but not for the coalitions with no state so I should make those changes to that partial as well. If you look now though you should see it under Alabama for skywalker (oregano org)

Copy link
Contributor

@arinchoi03 arinchoi03 left a 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)
Copy link
Contributor

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"%>
Copy link
Contributor

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 }
Copy link
Contributor

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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants