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

Enable user to Join Households #1022

Open
wants to merge 26 commits into
base: deploy/6761-table-actions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
986a820
Take a first stab at household join
martha Jan 13, 2025
1d3bb68
Determine on server side whether there is a conflicting enrollment
martha Jan 15, 2025
5ff4c3f
Move query for conflicting enrollment into join households dialog
martha Jan 15, 2025
cb86d9b
Merge branch 'deploy/6761-table-actions' into martha/5752-join-hh
martha Jan 16, 2025
5233e35
Progress the ux and resolve some todos (still wip)
martha Jan 16, 2025
caff6f9
Resolve some todos (still wip)
martha Jan 17, 2025
39def83
Add client alerts to join workflow
martha Jan 17, 2025
11b23f2
Fix some bugs and todos
martha Jan 17, 2025
d2968b0
Set button to Added
martha Jan 17, 2025
daabab9
Fix some todos, wip
martha Jan 17, 2025
03c17ff
Re-add explanatory text
martha Jan 17, 2025
2feaf4f
Hide workflow if no permission
martha Jan 17, 2025
348531b
Update comment
martha Jan 17, 2025
c9f2503
Revert unused schema updates
martha Jan 17, 2025
e354d9d
Update to match mocks
martha Jan 17, 2025
1d12df3
Add aria labels for a11y and system test
martha Jan 20, 2025
95059cc
Fix aria label location
martha Jan 21, 2025
dfd7469
Make GenericTable more friendly to table inputs
martha Jan 21, 2025
7c8465c
Correct mistake with aria labels
martha Jan 21, 2025
d94bd31
Add household sorting
martha Jan 21, 2025
c2d8bf4
Update to match mocks
martha Jan 22, 2025
138a3e1
Merge branch 'deploy/6761-table-actions' into martha/5752-join-hh
martha Jan 22, 2025
1ba0159
Renames
martha Jan 22, 2025
01dd94c
Fix typescript from merge
martha Jan 22, 2025
0c799c7
Refactor for reusability
martha Jan 27, 2025
9895852
Merge branch 'deploy/6761-table-actions' into martha/5752-join-hh
martha Jan 28, 2025
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