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

18 new jurisdictions via config #30

Merged
merged 10 commits into from
May 30, 2024
Merged

Conversation

jtmst
Copy link
Contributor

@jtmst jtmst commented May 16, 2024

#18

Adds ability to add jurisdictions by modifying the formsources.config file.

Changes:

  • refactored main page component
  • broke topic cards into their own component
  • set up topic section and data query to fetch data based on jurisdiction
  • set build up for dynamic routes for paths like /ma and /ma/housing
  • add path data to config file
  • Moves fetch functions higher in hierarchy to be at page level
  • adds pathToServer config which allows assignment of servers to a given path
  • Adjusts link tag behavior that that serverUrl is assigned to a given interview

Testing

  • Navigate to homepage and not that the default suffolk data is there
  • Naviagate to localhost:3000/gb and observe that the greater boston data is rendered
  • Click card backgrounds and observer that the correct topic placeholders render
  • Click tags and verify that correct app url is linked to
  • Verify that tests/build work
  • Note that the build output reflects the new pages

Build output log:
image

Greater boston cards at /gb:
image

Placeholder component for topics at new route:
image

Note: Also some changes to images in an effort to get them working on Pages. I dont have a way to test pages deployment locally so there may be some trial and error figuring out what the issue is there

@jtmst jtmst marked this pull request as ready for review May 16, 2024 22:37
Comment on lines 7 to 13
path: 'ma',
},
{
key: 'greaterBostonLegalService',
url: 'https://interviews.gbls.org',
name: 'Greater Boston Legal Services',
path: 'gb',
Copy link
Member

@nonprofittechy nonprofittechy May 17, 2024

Choose a reason for hiding this comment

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

Just wanted to double-check: it's possible for two servers to share the same path, right? Edit: and conversely, for one server to have individual interviews that go to different paths? See note below about the jurisdiction attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you envision determining which servers are associated with a given path, should that be a seperate config where each path has an array of servers they pull from?

Copy link
Member

Choose a reason for hiding this comment

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

It's important now that multiple servers can point to the same path, since we're thinking of the path as relating to the jurisdiction. The two example servers we're pulling from here are both in Massachusetts and would be syndicated to the same path.

In the future, we'd like to consider hosting a small number of forms for outside jurisdictions. For example: if we help Minnesota build 3 forms, it would be nice if those could go to courtformsonline.org/mn even if they're hosted on apps.suffolklitlab.org. That would be something we'd just do for relatively small numbers of forms.

I can also see multiple servers around the country having US-national level forms that should all go to the same path, /us/.

To get that outcome, I trust your judgment on the proper implementation.

Here's one path that might meet all of our needs for flexibility:

  1. Each path is associated with a jurisdiction code or codes, and will show all forms matching that jurisdiction's codes
  2. Each interview can specify the jurisdiction code or codes in its metadata (the JSON endpoint)
  3. Each server has a default jurisdiction code, which will be used if the interview doesn't specify one

If this feature is getting too complex, happy to talk it through more and figure out the right tradeoffs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, thanks for the clarification

src/app/page.tsx Outdated
{filteredTopics.length > 9 && <ShowAllToggle />}
</div>
</section>
<TopicsSection jurisdiction={'ma'} />
Copy link
Member

@nonprofittechy nonprofittechy May 17, 2024

Choose a reason for hiding this comment

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

How does jurisdiction correspond to the jurisdiction in the JSON endpoint, which uses the SALI/LMSS location descriptors? Are we planning to say all interviews from a server go to the same path, or can we categorize based on the jurisdiction in the endpoint, with perhaps a default path for each server since not all interviews will have a jurisdiction in the metadata?

E.g., US states look like:

NAM-US-US+MA

And Berlin looks like:

EUR-DE-DE+BE

(You can browse interactively here: https://webprotege.stanford.edu/#login).

Just want to check for consistency here--if this is jurisdiction, maybe we want to match the two formats, and map the jurisdiction code to a path. if it's just path, using the same variable name perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I may just be using the term jurisdiction wrong. In this case I'm using jurisdiction to denote which path/server we are looking at. Rather than jurisdiction, what term should i use for the path (previously subdomain) ie /ma/ or /pa/. I'm assuming they wont always be by state or I would use that.

I do have this set now so that path to server is 1 to 1, but I see now that we need to allow multiple servers' data within a path. I will adjust and get those changes up

Copy link
Member

Choose a reason for hiding this comment

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

I think "path" is fine. Just think it will be helpful, if the path isn't identical to the jurisdiction code, to not use the word "jurisdiction"

Copy link
Member

@nonprofittechy nonprofittechy left a comment

Choose a reason for hiding this comment

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

I like these changes--looking good! Just two notes: consistency of the meaning of "jurisdiction" and double-checking that we can combine multiple servers into one "path", made inline.

@jtmst jtmst requested a review from nonprofittechy May 20, 2024 19:10
@jtmst
Copy link
Contributor Author

jtmst commented May 20, 2024

I like these changes--looking good! Just two notes: consistency of the meaning of "jurisdiction" and double-checking that we can combine multiple servers into one "path", made inline.

I've modified the config that that we can assign multiple servers to a path. I included /gb/ as a path for demonstration purposes, but i will delete that from the config before we go live. Adding new paths should be as simple as declaring in that config, and assigning it servers as they are added to the sources config.

I've also added in the necessary data to track the source server for an interview so that the link path aligns with its source.

Also changed misusage of 'jurisdiction' to 'path' for clarity

@jtmst jtmst merged commit 20ed9db into main May 30, 2024
2 checks passed
@samglover samglover deleted the 18-new-jurisdictions-via-config branch September 20, 2024 03:19
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