Rename signature filter state field to profileState
The DocumentVersionSignatureFilter exposed a field named `state` that actually filters on the signatory's profile state, which was ambiguous next to the signature `states` field. Rename it to `profileState` (GraphQL) / `profile_state` (MCP) across the schema, spec, resolvers, console app, and n8n node for clarity. Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
@@ -40,10 +40,10 @@ export const documentLayoutQuery = graphql`
|
|||||||
...DocumentTitleFormFragment
|
...DocumentTitleFormFragment
|
||||||
...DocumentActionsDropdown_versionFragment
|
...DocumentActionsDropdown_versionFragment
|
||||||
...DocumentDetailsCard_versionFragment
|
...DocumentDetailsCard_versionFragment
|
||||||
signatures(first: 0 filter: { activeContract: true, state: ACTIVE }) {
|
signatures(first: 0 filter: { activeContract: true, profileState: ACTIVE }) {
|
||||||
totalCount
|
totalCount
|
||||||
}
|
}
|
||||||
signedSignatures: signatures(first: 0 filter: { states: [SIGNED], activeContract: true, state: ACTIVE }) {
|
signedSignatures: signatures(first: 0 filter: { states: [SIGNED], activeContract: true, profileState: ACTIVE }) {
|
||||||
totalCount
|
totalCount
|
||||||
}
|
}
|
||||||
approvalQuorums(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) {
|
approvalQuorums(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) {
|
||||||
@@ -85,10 +85,10 @@ export const documentLayoutQuery = graphql`
|
|||||||
...DocumentTitleFormFragment
|
...DocumentTitleFormFragment
|
||||||
...DocumentActionsDropdown_versionFragment
|
...DocumentActionsDropdown_versionFragment
|
||||||
...DocumentDetailsCard_versionFragment
|
...DocumentDetailsCard_versionFragment
|
||||||
signatures(first: 0 filter: { activeContract: true, state: ACTIVE }) {
|
signatures(first: 0 filter: { activeContract: true, profileState: ACTIVE }) {
|
||||||
totalCount
|
totalCount
|
||||||
}
|
}
|
||||||
signedSignatures: signatures(first: 0 filter: { states: [SIGNED], activeContract: true, state: ACTIVE }) {
|
signedSignatures: signatures(first: 0 filter: { states: [SIGNED], activeContract: true, profileState: ACTIVE }) {
|
||||||
totalCount
|
totalCount
|
||||||
}
|
}
|
||||||
approvalQuorums(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) {
|
approvalQuorums(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) {
|
||||||
|
|||||||
@@ -78,10 +78,10 @@ const fragment = graphql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
signatures(first: 0 filter: { activeContract: true, state: ACTIVE }) {
|
signatures(first: 0 filter: { activeContract: true, profileState: ACTIVE }) {
|
||||||
totalCount
|
totalCount
|
||||||
}
|
}
|
||||||
signedSignatures: signatures(first: 0 filter: { states: [SIGNED], activeContract: true, state: ACTIVE }) {
|
signedSignatures: signatures(first: 0 filter: { states: [SIGNED], activeContract: true, profileState: ACTIVE }) {
|
||||||
totalCount
|
totalCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const versionFragment = graphql`
|
|||||||
@argumentDefinitions(
|
@argumentDefinitions(
|
||||||
count: { type: "Int", defaultValue: 1000 }
|
count: { type: "Int", defaultValue: 1000 }
|
||||||
cursor: { type: "CursorKey" }
|
cursor: { type: "CursorKey" }
|
||||||
signatureFilter: { type: "DocumentVersionSignatureFilter", defaultValue: { activeContract: true, state: ACTIVE } }
|
signatureFilter: { type: "DocumentVersionSignatureFilter", defaultValue: { activeContract: true, profileState: ACTIVE } }
|
||||||
) {
|
) {
|
||||||
...DocumentSignaturePlaceholder_versionFragment
|
...DocumentSignaturePlaceholder_versionFragment
|
||||||
signatures(first: $count, after: $cursor, filter: $signatureFilter)
|
signatures(first: $count, after: $cursor, filter: $signatureFilter)
|
||||||
@@ -104,7 +104,7 @@ export function DocumentSignatureList(props: {
|
|||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
activeContract: true,
|
activeContract: true,
|
||||||
state: "ACTIVE" as const,
|
profileState: "ACTIVE" as const,
|
||||||
...(selectedStates.length > 0 ? { states: selectedStates } : {}),
|
...(selectedStates.length > 0 ? { states: selectedStates } : {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export async function execute(
|
|||||||
const filter: IDataObject = {};
|
const filter: IDataObject = {};
|
||||||
if ((filters.states as string[])?.length) filter.states = filters.states;
|
if ((filters.states as string[])?.length) filter.states = filters.states;
|
||||||
if (filters.activeContract !== undefined) filter.activeContract = filters.activeContract;
|
if (filters.activeContract !== undefined) filter.activeContract = filters.activeContract;
|
||||||
if (filters.state) filter.state = filters.state;
|
if (filters.state) filter.profileState = filters.state;
|
||||||
|
|
||||||
const hasFilter = Object.keys(filter).length > 0;
|
const hasFilter = Object.keys(filter).length > 0;
|
||||||
|
|
||||||
|
|||||||
@@ -22,15 +22,15 @@ type (
|
|||||||
DocumentVersionSignatureFilter struct {
|
DocumentVersionSignatureFilter struct {
|
||||||
states DocumentVersionSignatureStates
|
states DocumentVersionSignatureStates
|
||||||
activeContract *bool
|
activeContract *bool
|
||||||
state *ProfileState
|
profileState *ProfileState
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewDocumentVersionSignatureFilter(states []DocumentVersionSignatureState, activeContract *bool, state *ProfileState) *DocumentVersionSignatureFilter {
|
func NewDocumentVersionSignatureFilter(states []DocumentVersionSignatureState, activeContract *bool, profileState *ProfileState) *DocumentVersionSignatureFilter {
|
||||||
return &DocumentVersionSignatureFilter{
|
return &DocumentVersionSignatureFilter{
|
||||||
states: DocumentVersionSignatureStates(states),
|
states: DocumentVersionSignatureStates(states),
|
||||||
activeContract: activeContract,
|
activeContract: activeContract,
|
||||||
state: state,
|
profileState: profileState,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ func (f *DocumentVersionSignatureFilter) SQLArguments() pgx.StrictNamedArgs {
|
|||||||
return pgx.StrictNamedArgs{
|
return pgx.StrictNamedArgs{
|
||||||
"states": f.states,
|
"states": f.states,
|
||||||
"active_contract": f.activeContract,
|
"active_contract": f.activeContract,
|
||||||
"profile_state": f.state,
|
"profile_state": f.profileState,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -294,8 +294,8 @@ func (r *documentVersionResolver) Signatures(ctx context.Context, obj *types.Doc
|
|||||||
activeContract = filter.ActiveContract
|
activeContract = filter.ActiveContract
|
||||||
}
|
}
|
||||||
|
|
||||||
if filter.State != nil {
|
if filter.ProfileState != nil {
|
||||||
profileState = filter.State
|
profileState = filter.ProfileState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ input DocumentVersionSignatureOrder {
|
|||||||
input DocumentVersionSignatureFilter {
|
input DocumentVersionSignatureFilter {
|
||||||
states: [DocumentVersionSignatureState!]
|
states: [DocumentVersionSignatureState!]
|
||||||
activeContract: Boolean
|
activeContract: Boolean
|
||||||
state: ProfileState
|
profileState: ProfileState
|
||||||
}
|
}
|
||||||
|
|
||||||
input DocumentVersionApprovalQuorumOrder {
|
input DocumentVersionApprovalQuorumOrder {
|
||||||
|
|||||||
@@ -2407,8 +2407,8 @@ func (r *Resolver) ListDocumentVersionSignaturesTool(ctx context.Context, req *m
|
|||||||
activeContract = input.Filter.ActiveContract
|
activeContract = input.Filter.ActiveContract
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.Filter.State != nil {
|
if input.Filter.ProfileState != nil {
|
||||||
profileState = input.Filter.State
|
profileState = input.Filter.ProfileState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6376,7 +6376,7 @@ components:
|
|||||||
active_contract:
|
active_contract:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Signatory contract status
|
description: Signatory contract status
|
||||||
state:
|
profile_state:
|
||||||
$ref: "#/components/schemas/ProfileState"
|
$ref: "#/components/schemas/ProfileState"
|
||||||
description: Signatory profile state
|
description: Signatory profile state
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user