Filter people with ended contracts from signature request dialog

Move the paginated people query from PeopleGraph.ts into
SignatureDocumentsDialog.tsx following colocated query conventions
and pass excludeContractEnded: true to hide people whose contract has ended.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-04-15 13:27:49 +02:00
parent 891bc02f3e
commit 524f209df7
2 changed files with 56 additions and 65 deletions

View File

@@ -63,56 +63,3 @@ export function usePeople(
return data.organization?.profiles?.edges.map(edge => edge.node) ?? [];
}, [data]);
}
export const paginatedPeopleQuery = graphql`
query PeopleGraphPaginatedQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
id
... on Organization {
...PeopleGraphPaginatedFragment
}
}
}
`;
export const paginatedPeopleFragment = graphql`
fragment PeopleGraphPaginatedFragment on Organization
@refetchable(queryName: "PeopleListQuery")
@argumentDefinitions(
first: { type: "Int", defaultValue: 50 }
order: {
type: "ProfileOrder"
defaultValue: { direction: ASC, field: FULL_NAME }
}
filter: { type: "ProfileFilter", defaultValue: null }
after: { type: "CursorKey", defaultValue: null }
before: { type: "CursorKey", defaultValue: null }
last: { type: "Int", defaultValue: null }
) {
canCreatePeople: permission(action: "iam:membership-profile:create")
profiles(
first: $first
after: $after
last: $last
before: $before
orderBy: $order
filter: $filter
) @connection(key: "PeopleGraphPaginatedQuery_profiles") {
__id
edges {
node {
id
fullName
emailAddress
kind
position
additionalEmailAddresses
contractStartDate
contractEndDate
canDelete: permission(action: "iam:membership-profile:delete")
canUpdate: permission(action: "iam:membership-profile:update")
}
}
}
}
`;