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

Take a first stab at household join #1022

Draft
wants to merge 4 commits into
base: deploy/6761-table-actions
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 237 additions & 0 deletions graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18273,6 +18273,26 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "project",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "projectType",
"description": null,
Expand Down Expand Up @@ -28017,6 +28037,178 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "JoinHouseholdsInput",
"description": "Autogenerated input type of JoinHouseholds",
"isOneOf": false,
"fields": null,
"inputFields": [
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "joiningEnrollmentInputs",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "JoiningEnrollmentInput",
"ofType": null
}
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "receivingHouseholdId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "JoinHouseholdsPayload",
"description": "Autogenerated return type of JoinHouseholds.",
"isOneOf": null,
"fields": [
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "errors",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "ValidationError",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "household",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Household",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "JoiningEnrollmentInput",
"description": null,
"isOneOf": false,
"fields": null,
"inputFields": [
{
"name": "enrollmentId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "relationshipToHoh",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "RelationshipToHoH",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "SCALAR",
"name": "JsonObject",
Expand Down Expand Up @@ -30465,6 +30657,35 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "joinHouseholds",
"description": null,
"args": [
{
"name": "input",
"description": "Parameters for JoinHouseholds",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "JoinHouseholdsInput",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
"kind": "OBJECT",
"name": "JoinHouseholdsPayload",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "mergeClients",
"description": null,
Expand Down Expand Up @@ -36095,6 +36316,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canSplitHouseholds",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "canViewDob",
"description": null,
Expand Down
1 change: 1 addition & 0 deletions src/api/operations/access.fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fragment ProjectAccessFields on ProjectAccess {
canManageIncomingReferrals
canManageOutgoingReferrals
canManageExternalFormSubmissions
canSplitHouseholds
}

fragment OrganizationAccessFields on OrganizationAccess {
Expand Down
25 changes: 25 additions & 0 deletions src/api/operations/client.queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,31 @@ query GetClientEnrollments(
}
}

query GetClientEnrollmentWithHousehold(
$id: ID!
$limit: Int = 1
$offset: Int = 0
$filters: EnrollmentsForClientFilterOptions
martha marked this conversation as resolved.
Show resolved Hide resolved
) {
client(id: $id) {
id
enrollments(
limit: $limit
offset: $offset
sortOrder: MOST_RECENT
filters: $filters
includeEnrollmentsWithLimitedAccess: true
) {
offset
limit
nodesCount
nodes {
...EnrollmentWithHouseholdFields
}
}
}
}

query GetClientServices(
$id: ID!
$limit: Int = 10
Expand Down
7 changes: 7 additions & 0 deletions src/api/operations/enrollment.fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,10 @@ fragment EnrollmentRangeFields on Enrollment {
exitDate
inProgress
}

fragment EnrollmentWithHouseholdFields on Enrollment {
...EnrollmentFields
household {
...HouseholdFields
}
}
9 changes: 1 addition & 8 deletions src/api/operations/enrollment.queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ query GetEnrollmentDetails($id: ID!) {

query GetEnrollmentWithHousehold($id: ID!) {
enrollment(id: $id) {
...EnrollmentFields
household {
id
shortId
householdClients {
...HouseholdClientFields
}
}
...EnrollmentWithHouseholdFields
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/api/operations/household.operations.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mutation JoinHouseholds($input: JoinHouseholdsInput!) {
joinHouseholds(input: $input) {
household {
...HouseholdFields
}
}
}
4 changes: 2 additions & 2 deletions src/components/elements/CommonDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { useCallback } from 'react';

import SentryErrorBoundary from '@/modules/errors/components/SentryErrorBoundary';

interface Props extends DialogProps {
export interface CommonDialogProps extends DialogProps {
enableBackdropClick?: boolean;
}

const CommonDialog: React.FC<Props> = ({
const CommonDialog: React.FC<CommonDialogProps> = ({
children,
onClose,
enableBackdropClick = false,
Expand Down
25 changes: 25 additions & 0 deletions src/components/elements/StepDialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Meta, StoryObj } from '@storybook/react';
import StepDialog from './StepDialog';

export default {
component: StepDialog,
} as Meta<typeof StepDialog>;

type Story = StoryObj<typeof StepDialog>;

export const Default: Story = {
args: {
open: true,
title: 'Stepper Dialog Demo',
tabDefinitions: [
{
title: 'One',
content: 'hello first tab',
},
{
title: 'Two',
content: 'this is the second tab',
},
],
},
};
Loading