-
Notifications
You must be signed in to change notification settings - Fork 25
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
Adds Jurisdiction to listings, users, translations (replaces countyCode) #1776
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ff0c71b
force quit redis connection on app close
seanmalbert 72e1fc4
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert 9fbdfb6
updates for redis config
seanmalbert 7536522
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert 7007eb3
adds enableShutdownHooks to main app
seanmalbert 729f024
merge upstream
seanmalbert 092ffd1
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert d831039
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert f133c3e
Update archer-listing.ts
seanmalbert e1cd154
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert 7d756d7
Updates cache clear to use cacheManager reset, so we don't have to ma…
seanmalbert 348ef97
Update units-transformations.ts
seanmalbert 2fc468a
Update CHANGELOG.md
seanmalbert 5b49201
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert 09ad286
allows for not needing google api keys
seanmalbert 173e05c
Update listings.controller.ts
seanmalbert af6db79
Update listings.e2e-spec.ts
seanmalbert 5f3d9b7
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert a20d273
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert 8cb1e60
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert b5dfa0b
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert 4ace68e
Merge remote-tracking branch 'remotes/upstream/dev' into origin/dev
seanmalbert 2aef896
adds jurisdiction relations
seanmalbert d15aabc
cleanup after testing
seanmalbert 92d1978
adds jurisdiction selection to listings form
seanmalbert 39b9a61
updates backend tests
seanmalbert 21a6373
updates to ui-components
seanmalbert 96f32ab
testing cypress tests
seanmalbert 66349f2
renamed JuriWrap to JurisdictionWrapper
seanmalbert b2a680c
addresses feedback from review
seanmalbert 44cee18
Adds changelog entry
seanmalbert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { Module } from "@nestjs/common" | ||
import { forwardRef, Module } from "@nestjs/common" | ||
import { TypeOrmModule } from "@nestjs/typeorm" | ||
import { AuthModule } from "../auth/auth.module" | ||
import { Jurisdiction } from "./entities/jurisdiction.entity" | ||
import { JurisdictionsController } from "./jurisdictions.controller" | ||
import { JurisdictionsService } from "./jurisdictions.service" | ||
import { JurisdictionsService } from "./services/jurisdictions.service" | ||
import { JurisdictionResolverService } from "./services/jurisdiction-resolver.service" | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([Jurisdiction]), AuthModule], | ||
imports: [TypeOrmModule.forFeature([Jurisdiction]), forwardRef(() => AuthModule)], | ||
controllers: [JurisdictionsController], | ||
providers: [JurisdictionsService], | ||
providers: [JurisdictionsService, JurisdictionResolverService], | ||
exports: [JurisdictionResolverService], | ||
}) | ||
export class JurisdictionsModule {} |
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
backend/core/src/jurisdictions/services/jurisdiction-resolver.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Inject, Injectable, NotFoundException, Scope } from "@nestjs/common" | ||
import { REQUEST } from "@nestjs/core" | ||
import { InjectRepository } from "@nestjs/typeorm" | ||
import { Request as ExpressRequest } from "express" | ||
import { Repository } from "typeorm" | ||
import { Jurisdiction } from "../entities/jurisdiction.entity" | ||
|
||
@Injectable({ scope: Scope.REQUEST }) | ||
export class JurisdictionResolverService { | ||
constructor( | ||
@Inject(REQUEST) private req: ExpressRequest, | ||
@InjectRepository(Jurisdiction) | ||
private readonly jurisdictionRepository: Repository<Jurisdiction> | ||
) {} | ||
|
||
async getJurisdiction(): Promise<Jurisdiction> { | ||
const jurisdictionName = this.req.get("jurisdictionName") | ||
const jurisdiction = await this.jurisdictionRepository.findOne({ | ||
where: { name: jurisdictionName }, | ||
}) | ||
|
||
if (jurisdiction === undefined) { | ||
throw new NotFoundException("The jurisdiction is not configured.") | ||
} | ||
|
||
return jurisdiction | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
backend/core/src/jurisdictions/services/jurisdictions.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { AbstractServiceFactory } from "../../shared/services/abstract-service" | ||
import { Jurisdiction } from "../entities/jurisdiction.entity" | ||
import { JurisdictionCreateDto, JurisdictionUpdateDto } from "../dto/jurisdiction.dto" | ||
|
||
export class JurisdictionsService extends AbstractServiceFactory< | ||
Jurisdiction, | ||
JurisdictionCreateDto, | ||
JurisdictionUpdateDto | ||
>(Jurisdiction) {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@seanmalbert Could you explain a bit more the reasoning behind this?
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.
@pbn4 , As part of the user management flow, a user can belong to more than one jurisdiction and, given they have permissions, when they create a user they will have to select which jurisdiction they belong to. Therefore it would be set on the incoming dto, not from the request header (which partner's doesn't currently use).