Skip to content

Commit

Permalink
MCR-4477: States can navigate to rate Q&A via sidebar (#2841)
Browse files Browse the repository at this point in the history
* Move graphql fragments into fragments directory and only define them once.

* Setup routes for rate Q&A page

* typo

* Clean up

* Move helpers to common directory.

* Add dynamic rate Q&A links

* State Q&A by rate page

* Fix import

* Use Division from gqlClient

* Keep sidenav width static.

* Add fragments directory to readme

* Rename Q&A link to Contract questions
  • Loading branch information
JasonLin0991 authored Oct 17, 2024
1 parent ff4b090 commit 0cb8a35
Show file tree
Hide file tree
Showing 55 changed files with 815 additions and 871 deletions.
1 change: 1 addition & 0 deletions services/app-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Generates typescript types from the GraphQL schema and queries. These types are

- `codegen.yml` configures code generation into a `gen/package` that is gitignored. _No files in this folder should be edited._
- `src/queries` and `src/mutations` contain files in the [GraphQL query language](https://graphql.org/learn/queries/).
- `src/fragments` directory contains common block of fields as [fragments](https://graphql.org/learn/queries/#fragments). They can be reused in `queries` and `mutations`.
- The repo root level [`./dev`](../../dev) script has calls to `gqlgen` in both app-api and app-web.
2 changes: 2 additions & 0 deletions services/app-graphql/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ generates:
RatePackageSubmission: ../domain-models#RatePackageSubmissionWithCauseType
../app-web/src/gen/gqlClient.tsx:
documents:
- src/fragments/*.graphql
- src/queries/*.graphql
- src/mutations/*.graphql
plugins:
Expand All @@ -41,6 +42,7 @@ generates:
enumsAsTypes: true
../cypress/gen/gqlClient.ts:
documents:
- src/fragments/*.graphql
- src/queries/*.graphql
- src/mutations/*.graphql
plugins:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
fragment questionResponseFragment on QuestionResponse {
id
questionID
createdAt
addedBy {
... on StateUser {
...stateUserFragment
}
}
documents {
name
s3URL
downloadURL
}
}
49 changes: 49 additions & 0 deletions services/app-graphql/src/fragments/questionsEdgeFragment.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
fragment questionEdgeFragment on ContractQuestionEdge {
node {
id
contractID
createdAt
addedBy {
... on CMSUser {
...cmsUserFragment
}
... on CMSApproverUser {
...cmsApproverUserFragment
}
}
division
documents {
s3URL
name
downloadURL
}
responses {
...questionResponseFragment
}
}
}

fragment rateQuestionEdgeFragment on RateQuestionEdge {
node {
id
rateID
createdAt
addedBy {
... on CMSUser {
...cmsUserFragment
}
... on CMSApproverUser {
...cmsApproverUserFragment
}
}
division
documents {
s3URL
name
downloadURL
}
responses {
...questionResponseFragment
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
79 changes: 79 additions & 0 deletions services/app-graphql/src/fragments/userFragments.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
fragment cmsUserFragment on CMSUser {
id
email
role
familyName
givenName
stateAssignments {
code
name
programs {
id
name
fullName
isRateProgram
}
}
divisionAssignment
}

fragment cmsApproverUserFragment on CMSApproverUser {
id
email
role
familyName
givenName
stateAssignments {
code
name
programs {
id
name
fullName
isRateProgram
}
}
divisionAssignment
}

fragment stateUserFragment on StateUser {
id
email
role
familyName
givenName
state {
code
name
programs {
id
name
fullName
isRateProgram
}
}
}

fragment adminUserFragment on AdminUser {
id
email
role
familyName
givenName
}

fragment helpdeskUserFragment on HelpdeskUser {
id
email
role
familyName
givenName
}

fragment businessUserFragment on BusinessOwnerUser {
id
email
role
familyName
givenName
}
10 changes: 0 additions & 10 deletions services/app-graphql/src/mutations/createContract.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,3 @@ fragment submittableRevisionsFieldsForCreate on SubmittableRevision {
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
11 changes: 0 additions & 11 deletions services/app-graphql/src/mutations/createHealthPlanPackage.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,3 @@ mutation createHealthPlanPackage($input: CreateHealthPlanPackageInput!) {
}
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
22 changes: 2 additions & 20 deletions services/app-graphql/src/mutations/createRateQuestion.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,10 @@ mutation createRateQuestion($input: CreateRateQuestionInput!) {
rateID
addedBy {
... on CMSUser {
id
role
email
givenName
familyName
divisionAssignment
stateAssignments {
code
name
}
...cmsUserFragment
}
... on CMSApproverUser {
id
role
email
givenName
familyName
divisionAssignment
stateAssignments {
code
name
}
...cmsApproverUserFragment
}
}
division
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,10 @@ mutation createRateQuestionResponse($input: CreateQuestionResponseInput!) {
createdAt
addedBy {
... on CMSUser {
id
role
email
givenName
familyName
divisionAssignment
stateAssignments {
code
name
}
...cmsUserFragment
}
... on CMSApproverUser {
id
role
email
givenName
familyName
divisionAssignment
stateAssignments {
code
name
}
...cmsApproverUserFragment
}
}
division
Expand All @@ -36,29 +18,8 @@ mutation createRateQuestionResponse($input: CreateQuestionResponseInput!) {
s3URL
}
responses {
id
questionID
createdAt
addedBy {
id
role
email
givenName
familyName
state {
code
name
programs {
id
name
fullName
isRateProgram
}
}
}
documents {
name
s3URL
... on QuestionResponse {
...questionResponseFragment
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions services/app-graphql/src/mutations/submitContract.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,3 @@ fragment submittableRevisionsFieldsForSubmit on SubmittableRevision {
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
11 changes: 0 additions & 11 deletions services/app-graphql/src/mutations/submitHealthPlanPackage.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,3 @@ mutation submitHealthPlanPackage($input: SubmitHealthPlanPackageInput!) {
}
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
11 changes: 0 additions & 11 deletions services/app-graphql/src/mutations/submitRate.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,3 @@ mutation submitRate($input: SubmitRateInput!) {
}
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
11 changes: 0 additions & 11 deletions services/app-graphql/src/mutations/unlockContract.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,3 @@ fragment submittableRevisionsFieldsForUnlock on SubmittableRevision {
...rateRevisionFragmentForUnlockContract
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
11 changes: 0 additions & 11 deletions services/app-graphql/src/mutations/unlockHealthPlanPackage.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,3 @@ mutation unlockHealthPlanPackage($input: UnlockHealthPlanPackageInput!) {
}
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
11 changes: 0 additions & 11 deletions services/app-graphql/src/mutations/unlockRate.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,3 @@ mutation unlockRate($input: UnlockRateInput!) {
}
}
}

fragment updateInformationFields on UpdateInformation {
updatedAt
updatedBy {
email
role
familyName
givenName
}
updatedReason
}
Loading

0 comments on commit 0cb8a35

Please sign in to comment.