Expose bridge sync errors in SCIM API
Add a dedicated SCIMBridge syncError field to the Connect GraphQL API and populate it from the core bridge model. Update the connector cards to read bridge state and syncError directly from the bridge object instead of inferring failures from event history. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
committed by
Bryan Frimin
parent
83ce4286f8
commit
6f4ac54a27
@@ -39,18 +39,11 @@ import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
const googleWorkspaceConnectorFragment = graphql`
|
||||
fragment GoogleWorkspaceConnectorFragment on SCIMConfiguration {
|
||||
id
|
||||
eventsLatest: events(first: 1) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
errorMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
bridge {
|
||||
id
|
||||
type
|
||||
state
|
||||
syncError
|
||||
excludedUserNames
|
||||
connector {
|
||||
id
|
||||
@@ -96,7 +89,7 @@ export function GoogleWorkspaceConnector(props: {
|
||||
const organizationId = useOrganizationId();
|
||||
const { __, dateTimeFormat } = useTranslate();
|
||||
const bridgeState = bridge?.state ?? null;
|
||||
const latestBridgeError = data?.eventsLatest?.edges?.[0]?.node?.errorMessage ?? null;
|
||||
const latestBridgeError = bridge?.syncError ?? null;
|
||||
const isBridgeFailed = bridgeState === "FAILED";
|
||||
const isBridgePending = bridgeState === "PENDING";
|
||||
const bridgeStatusBadgeVariant = isBridgeFailed
|
||||
|
||||
@@ -39,18 +39,11 @@ import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
const microsoft365ConnectorFragment = graphql`
|
||||
fragment Microsoft365ConnectorFragment on SCIMConfiguration {
|
||||
id
|
||||
eventsLatest: events(first: 1) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
errorMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
bridge {
|
||||
id
|
||||
type
|
||||
state
|
||||
syncError
|
||||
excludedUserNames
|
||||
connector {
|
||||
id
|
||||
@@ -96,7 +89,7 @@ export function Microsoft365Connector(props: {
|
||||
const organizationId = useOrganizationId();
|
||||
const { __, dateTimeFormat } = useTranslate();
|
||||
const bridgeState = bridge?.state ?? null;
|
||||
const latestBridgeError = data?.eventsLatest?.edges?.[0]?.node?.errorMessage ?? null;
|
||||
const latestBridgeError = bridge?.syncError ?? null;
|
||||
const isBridgeFailed = bridgeState === "FAILED";
|
||||
const isBridgePending = bridgeState === "PENDING";
|
||||
const bridgeStatusBadgeVariant = isBridgeFailed
|
||||
|
||||
@@ -23,6 +23,7 @@ type SCIMConfiguration implements Node {
|
||||
type SCIMBridge implements Node {
|
||||
id: ID!
|
||||
state: SCIMBridgeState!
|
||||
syncError: String
|
||||
scimConfiguration: SCIMConfiguration @goField(forceResolver: true)
|
||||
connector: Connector @goField(forceResolver: true)
|
||||
type: SCIMBridgeType!
|
||||
|
||||
@@ -25,8 +25,9 @@ func NewSCIMBridge(bridge *coredata.SCIMBridge) *SCIMBridge {
|
||||
}
|
||||
|
||||
return &SCIMBridge{
|
||||
ID: bridge.ID,
|
||||
State: bridge.State,
|
||||
ID: bridge.ID,
|
||||
State: bridge.State,
|
||||
SyncError: bridge.SyncError,
|
||||
ScimConfiguration: &SCIMConfiguration{
|
||||
ID: bridge.ScimConfigurationID,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user