Skip to content

fix: pass the jurisdiction id to edit unit form#5555

Merged
ludtkemorgan merged 2 commits into
mainfrom
5554/ami-charts
Nov 10, 2025
Merged

fix: pass the jurisdiction id to edit unit form#5555
ludtkemorgan merged 2 commits into
mainfrom
5554/ami-charts

Conversation

@ludtkemorgan

Copy link
Copy Markdown
Collaborator

This PR addresses #5554

  • Addresses the issue in full
  • Addresses only certain aspects of the issue

Description

With a recent fix for unit management the selected jurisdiction id was not getting picked up when requesting AMI chart data. This means that all jurisdiction AMI charts were being returned even if you have already selected a jurisdiciton for the listing. A small refactor was needed to pass the jurisdiction id to the User and UserGroup forms instead of relying on the useFormContext.

Also, I noticed that "add unit groups" was the default option if any of the jurisdictions have that enabled. This PR changes that functionality to only display unit group form if either all jurisdictions have enableUnitGroups set or the selected jurisdiction does.

Additional tests were added, but since there were no tests for this file I just added one generic test and one for this specific field. All other suggested tests are added as todos. Note these don't test the actually issue that happened because it required the correct jurisdiction id to be passed to the component. That is a larger test that should be added to PaperListingForm/index.test.tsx

How Can This Be Tested/Reviewed?

  1. Login to the partner site
  2. Create a listing and select a jurisdiction that doesn't have enableUnitGroups set
  3. scroll down and click on the "add unit" button.
  4. In the opened drawer select "AMI Chart". You should only see the ami charts for that jurisdiction (on a fresh reseed Bloomington and Lakeview should have 2 charts and all other jurisdictions have none)

The unit group flow:

  1. Login to the partner site
  2. Create a listing and select a jurisdiction that does have enableUnitGroups set
  3. scroll down and click on the "add unit group" button.
  4. In the opened drawer select "AMI Chart". You should only see the ami charts for that jurisdiction (on a fresh reseed Bloomington and Lakeview should have 2 charts and all other jurisdictions have none)

Author Checklist:

  • Added QA notes to the issue with applicable URLs
  • Reviewed in a desktop view
  • Reviewed in a mobile view
  • Reviewed considering accessibility
  • Added tests covering the changes
  • Made corresponding changes to the documentation
  • Ran yarn generate:client and/or created a migration when required

Review Process:

  • Read and understand the issue
  • Ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Pull the changes down locally and test that the acceptance criteria is met
  • Either (1) explicitly ask a clarifying question, (2) request changes, or (3) approve the PR, even if there are very small remaining changes, if you don't need to re-review after the updates

@netlify

netlify Bot commented Nov 6, 2025

Copy link
Copy Markdown

Deploy Preview for partners-bloom-dev ready!

Name Link
🔨 Latest commit 33f62a7
🔍 Latest deploy log https://app.netlify.com/projects/partners-bloom-dev/deploys/69120dc174e66100073934b7
😎 Deploy Preview https://deploy-preview-5555--partners-bloom-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 6, 2025

Copy link
Copy Markdown

Deploy Preview for bloom-lakeview ready!

Name Link
🔨 Latest commit 33f62a7
🔍 Latest deploy log https://app.netlify.com/projects/bloom-lakeview/deploys/69120dc19b57540008308503
😎 Deploy Preview https://deploy-preview-5555--bloom-lakeview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 6, 2025

Copy link
Copy Markdown

Deploy Preview for bloom-flagly ready!

Name Link
🔨 Latest commit 33f62a7
🔍 Latest deploy log https://app.netlify.com/projects/bloom-flagly/deploys/69120dc10181c4000888e295
😎 Deploy Preview https://deploy-preview-5555--bloom-flagly.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 6, 2025

Copy link
Copy Markdown

Deploy Preview for bloom-exygy-dev ready!

Name Link
🔨 Latest commit 33f62a7
🔍 Latest deploy log https://app.netlify.com/projects/bloom-exygy-dev/deploys/69120dc1ec86b2000827e8a3
😎 Deploy Preview https://deploy-preview-5555--bloom-exygy-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 6, 2025

Copy link
Copy Markdown

Deploy Preview for bloom-angelopolis ready!

Name Link
🔨 Latest commit 33f62a7
🔍 Latest deploy log https://app.netlify.com/projects/bloom-angelopolis/deploys/69120dc1e35dfb0008b2e690
😎 Deploy Preview https://deploy-preview-5555--bloom-angelopolis.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ludtkemorgan ludtkemorgan added the 1 review needed Requires 1 more review before ready to merge label Nov 6, 2025
@netlify

netlify Bot commented Nov 6, 2025

Copy link
Copy Markdown

Deploy Preview for bloom-public-seeds ready!

Name Link
🔨 Latest commit 33f62a7
🔍 Latest deploy log https://app.netlify.com/projects/bloom-public-seeds/deploys/69120dc1ceac150008a1b13a
😎 Deploy Preview https://deploy-preview-5555--bloom-public-seeds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mcgarrye mcgarrye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcgarrye mcgarrye added ready to merge Should be applied when a PR has been reviewed and approved and removed 1 review needed Requires 1 more review before ready to merge labels Nov 10, 2025
@ludtkemorgan ludtkemorgan merged commit b761b62 into main Nov 10, 2025
34 checks passed
@ludtkemorgan ludtkemorgan deleted the 5554/ami-charts branch November 10, 2025 16:20
mcgarrye pushed a commit to metrotranscom/doorway that referenced this pull request Nov 10, 2025
* fix: pass the jurisdiction id to edit unit form

* fix: remove unused dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Should be applied when a PR has been reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants