@burdenoff/microfe-integrations 2026.830.4 → 2026.913.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations/hooks/useConnections.d.ts +26 -0
- package/dist/integrations/hooks/useConnections.d.ts.map +1 -1
- package/dist/integrations/hooks/useConnections.js +4 -2
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +136 -136
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { IntegrationConnection, ConnectionStatus, OAuthInitiationResult, ConnectionTestResult } from '../types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A query we never asked is NOT an empty result.
|
|
5
|
+
*
|
|
6
|
+
* ★★ THE BUG THIS EXISTS TO PREVENT. Apollo returns `loading: false`,
|
|
7
|
+
* `error: undefined`, `data: undefined` for a SKIPPED query — identical, from a
|
|
8
|
+
* caller's point of view, to a query that ran and found nothing. Pages then
|
|
9
|
+
* render their empty state and tell the user, definitively, that they have no
|
|
10
|
+
* connections.
|
|
11
|
+
*
|
|
12
|
+
* Measured in production 2026-09-13: `/integrations/connections` showed
|
|
13
|
+
* "No connections yet" while the workspace held **46** connections — 8 ACTIVE
|
|
14
|
+
* (Gmail, GitHub, Google Sheets, Linear, Anthropic), 1 EXPIRED, 37 PENDING_AUTH.
|
|
15
|
+
* The assistant, asked the same question through the API, listed all 46. No
|
|
16
|
+
* request left the browser and no error appeared anywhere.
|
|
17
|
+
*
|
|
18
|
+
* `workspaceId` is falsy whenever the active context has not resolved — and the
|
|
19
|
+
* shell passes `activeContext.workspaceId ?? ""`, so "not yet known" arrives as
|
|
20
|
+
* an empty string, which is falsy. Any render in that window produces a
|
|
21
|
+
* confident, wrong answer.
|
|
22
|
+
*
|
|
23
|
+
* So `notReady` is returned separately and callers MUST NOT treat it as empty.
|
|
24
|
+
* It is deliberately not folded into `loading`: a caller that shows a spinner is
|
|
25
|
+
* right, and a caller that ignores it still cannot mistake it for "none".
|
|
26
|
+
*/
|
|
3
27
|
interface ConnectionFilterOptions {
|
|
4
28
|
status?: ConnectionStatus;
|
|
5
29
|
providerId?: string;
|
|
@@ -9,6 +33,7 @@ export declare function useConnections(filter?: ConnectionFilterOptions): {
|
|
|
9
33
|
connections: IntegrationConnection[];
|
|
10
34
|
total: any;
|
|
11
35
|
loading: boolean;
|
|
36
|
+
answered: boolean;
|
|
12
37
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
13
38
|
refetch: (variables?: any) => Promise<{
|
|
14
39
|
data: any;
|
|
@@ -18,6 +43,7 @@ export declare function useConnections(filter?: ConnectionFilterOptions): {
|
|
|
18
43
|
export declare function useConnection(id: string): {
|
|
19
44
|
connection: IntegrationConnection | null;
|
|
20
45
|
loading: boolean;
|
|
46
|
+
answered: boolean;
|
|
21
47
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
22
48
|
refetch: (variables?: any) => Promise<{
|
|
23
49
|
data: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnections.d.ts","sourceRoot":"","sources":["../../../src/integrations/hooks/useConnections.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useConnections.d.ts","sourceRoot":"","sources":["../../../src/integrations/hooks/useConnections.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,UAAU,uBAAuB;IAC/B,MAAM,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gBAAgB;;;EAe3E;AAmBD;;;;GAIG;AACH,wBAAgB,+BAA+B;iDAStB,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;YAPtB,MAAM;gBAAU,gBAAgB;;;EAezE;AAED,wBAAgB,eAAe;iCAON,MAAM;;EAW9B;AAED,wBAAgB,mBAAmB;qCAOV,MAAM;;EAW9B;AAED,wBAAgB,iBAAiB;mCAIR,MAAM,KAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;;EAQrE"}
|
|
@@ -14,11 +14,12 @@ function y(t) {
|
|
|
14
14
|
},
|
|
15
15
|
skip: !n,
|
|
16
16
|
errorPolicy: "all"
|
|
17
|
-
});
|
|
17
|
+
}), s = r?.getConnections !== void 0;
|
|
18
18
|
return {
|
|
19
19
|
connections: (r?.getConnections?.items ?? []).map((e) => m(e)),
|
|
20
20
|
total: r?.getConnections?.total ?? 0,
|
|
21
21
|
loading: i,
|
|
22
|
+
answered: s,
|
|
22
23
|
error: a,
|
|
23
24
|
refetch: o
|
|
24
25
|
};
|
|
@@ -28,10 +29,11 @@ function b(t) {
|
|
|
28
29
|
variables: { id: t },
|
|
29
30
|
skip: !n || !t,
|
|
30
31
|
errorPolicy: "all"
|
|
31
|
-
});
|
|
32
|
+
}), c = r?.getConnection !== void 0;
|
|
32
33
|
return {
|
|
33
34
|
connection: r?.getConnection ? m(r.getConnection) : null,
|
|
34
35
|
loading: i,
|
|
36
|
+
answered: c,
|
|
35
37
|
error: a,
|
|
36
38
|
refetch: o
|
|
37
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnections.js","names":[],"sources":["../../../src/integrations/hooks/useConnections.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for connections.\n */\n\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n useGetConnectionsQuery,\n useGetConnectionQuery,\n useGetConnectionsByProviderQuery,\n useCreateConnectionMutation,\n useInitiateOAuthMutation,\n useAuthenticateConnectionMutation,\n useAuthenticateWithApiKeyMutation,\n useAuthenticateWithBasicAuthMutation,\n useAuthenticateWithBearerTokenMutation,\n useRefreshConnectionTokenMutation,\n useRevokeConnectionMutation,\n useTestConnectionMutation,\n useDeleteConnectionMutation,\n} from '../../generated/wspace-operations';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { mapConnection } from '../utils/mappers';\nimport type {\n IntegrationConnection,\n ConnectionStatus,\n OAuthInitiationResult,\n ConnectionTestResult,\n} from '../types';\n\n// ─── Query Hooks ────────────────────────────────────────────────────────────\n\ninterface ConnectionFilterOptions {\n status?: ConnectionStatus;\n providerId?: string;\n search?: string;\n}\n\nexport function useConnections(filter?: ConnectionFilterOptions) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsQuery({\n variables: { filter, pagination: { limit: 100 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnections?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return { connections, total: data?.getConnections?.total ?? 0, loading, error, refetch };\n}\n\nexport function useConnection(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n const connection: IntegrationConnection | null = data?.getConnection\n ? mapConnection(data.getConnection as Record<string, unknown>)\n : null;\n\n return { connection, loading, error, refetch };\n}\n\nexport function useConnectionsByProvider(providerId: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsByProviderQuery({\n variables: { providerId, pagination: { limit: 100 } },\n skip: !workspaceId || !providerId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnectionsByProvider?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnectionsByProvider?.total ?? 0,\n loading,\n error,\n refetch,\n };\n}\n\n// ─── Mutation Hooks ─────────────────────────────────────────────────────────\n\nexport function useCreateConnection() {\n const [mutate, { loading }] = useCreateConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const createConnection = useCallback(\n async (input: {\n name: string;\n description?: string;\n providerId: string;\n authMethodKey?: string;\n vaultId?: string;\n credentialSecretId?: string;\n managedSecretName?: string;\n config?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n const id = result.data?.createConnection?.id as string | undefined;\n if (id) {\n eventBus.emit('integrations:connection-created', {\n connectionId: id,\n providerKey: input.providerId,\n });\n }\n return id;\n },\n [mutate, eventBus]\n );\n\n return { createConnection, loading };\n}\n\nexport function useDeleteConnection() {\n const [mutate, { loading }] = useDeleteConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const deleteConnection = useCallback(\n async (id: string, deleteVaultSecret = false) => {\n await mutate({ variables: { id, deleteVaultSecret } });\n eventBus.emit('integrations:connection-deleted', { connectionId: id });\n },\n [mutate, eventBus]\n );\n\n return { deleteConnection, loading };\n}\n\nexport function useInitiateOAuth() {\n const [mutate, { loading }] = useInitiateOAuthMutation();\n const eventBus = useIntegrationsEventBus();\n\n const initiateOAuth = useCallback(\n async (\n connectionId: string,\n redirectUri: string,\n providerKey: string,\n scopes?: string[]\n ): Promise<OAuthInitiationResult | null> => {\n eventBus.emit('integrations:oauth-started', { connectionId, providerKey });\n const result = await mutate({ variables: { input: { connectionId, redirectUri, scopes } } });\n if (result.error) {\n eventBus.emit('integrations:oauth-failed', {\n connectionId,\n providerKey,\n error: result.error.message,\n });\n }\n return result.data?.initiateOAuth ?? null;\n },\n [mutate, eventBus]\n );\n\n return { initiateOAuth, loading };\n}\n\n/**\n * Authenticate a connection with values shaped by its auth method's schema.\n *\n * Generic replacement for the per-auth-type hooks below: the caller passes\n * whatever the rendered form collected, so a new auth type needs no new hook,\n * no new mutation document and no new branch at the call site.\n */\nexport function useAuthenticateConnection() {\n const [mutate, { loading }] = useAuthenticateConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateConnection = useCallback(\n async (\n connectionId: string,\n authMethodKey: string | undefined,\n values: Record<string, unknown>\n ) => {\n const result = await mutate({\n variables: { input: { connectionId, authMethodKey, values } },\n });\n return result.data?.authenticateConnection;\n },\n [mutate]\n );\n\n return { authenticateConnection, loading };\n}\n\nexport function useAuthenticateWithApiKey() {\n const [mutate, { loading }] = useAuthenticateWithApiKeyMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithApiKey = useCallback(\n async (connectionId: string, apiKey: string) => {\n const result = await mutate({ variables: { input: { connectionId, apiKey } } });\n return result.data?.authenticateWithApiKey;\n },\n [mutate]\n );\n\n return { authenticateWithApiKey, loading };\n}\n\nexport function useAuthenticateWithBasicAuth() {\n const [mutate, { loading }] = useAuthenticateWithBasicAuthMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBasicAuth = useCallback(\n async (connectionId: string, username: string, password: string) => {\n const result = await mutate({ variables: { input: { connectionId, username, password } } });\n return result.data?.authenticateWithBasicAuth;\n },\n [mutate]\n );\n\n return { authenticateWithBasicAuth, loading };\n}\n\nexport function useAuthenticateWithBearerToken() {\n const [mutate, { loading }] = useAuthenticateWithBearerTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBearerToken = useCallback(\n async (connectionId: string, token: string) => {\n const result = await mutate({ variables: { input: { connectionId, token } } });\n return result.data?.authenticateWithBearerToken;\n },\n [mutate]\n );\n\n return { authenticateWithBearerToken, loading };\n}\n\n/**\n * GraphQL document for the first-party SERVICE_ACCOUNT auth flow. Defined inline\n * (rather than via codegen) so it does not depend on a fresh `schema:pull` from\n * a gateway that already exposes the new `authenticateWithServiceAccount`\n * mutation. Once the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_SERVICE_ACCOUNT = gql`\n mutation AuthenticateWithServiceAccount($input: ServiceAccountAuthInput!) {\n authenticateWithServiceAccount(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a first-party SERVICE_ACCOUNT provider (e.g. Burdenoff). No user\n * credentials are collected — the platform mints an app-as-user token per\n * execution. Calling this records the user's consent (delegation) for the\n * reserved app and activates the connection.\n */\nexport function useAuthenticateWithServiceAccount() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithServiceAccount: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; scopes?: string[] } }\n >(AUTHENTICATE_WITH_SERVICE_ACCOUNT, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithServiceAccount = useCallback(\n async (connectionId: string, scopes?: string[]) => {\n const result = await mutate({ variables: { input: { connectionId, scopes } } });\n return result.data?.authenticateWithServiceAccount;\n },\n [mutate]\n );\n\n return { authenticateWithServiceAccount, loading };\n}\n\n/**\n * GraphQL document for CUSTOM provider auth (configSchema-driven config, e.g.\n * Google Workspace Admin domain-wide delegation). Defined inline (rather than\n * via codegen) so it does not depend on a fresh `schema:pull` from a gateway\n * that already exposes the new `authenticateWithCustomConfig` mutation. Once\n * the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_CUSTOM_CONFIG = gql`\n mutation AuthenticateWithCustomConfig($input: CustomConfigAuthInput!) {\n authenticateWithCustomConfig(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a CUSTOM provider with a configSchema-shaped config object. The full\n * config is stored inside the encrypted credential payload (secrets never hit\n * plain columns); the connection becomes ACTIVE immediately.\n */\nexport function useAuthenticateWithCustomConfig() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithCustomConfig: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; config: Record<string, unknown> } }\n >(AUTHENTICATE_WITH_CUSTOM_CONFIG, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithCustomConfig = useCallback(\n async (connectionId: string, config: Record<string, unknown>) => {\n const result = await mutate({ variables: { input: { connectionId, config } } });\n return result.data?.authenticateWithCustomConfig;\n },\n [mutate]\n );\n\n return { authenticateWithCustomConfig, loading };\n}\n\nexport function useRefreshToken() {\n const [mutate, { loading }] = useRefreshConnectionTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const refreshToken = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.refreshConnectionToken) {\n eventBus.emit('integrations:token-refreshed', { connectionId });\n }\n return result.data?.refreshConnectionToken;\n },\n [mutate, eventBus]\n );\n\n return { refreshToken, loading };\n}\n\nexport function useRevokeConnection() {\n const [mutate, { loading }] = useRevokeConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const revokeConnection = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.revokeConnection) {\n eventBus.emit('integrations:token-revoked', { connectionId });\n }\n return result.data?.revokeConnection;\n },\n [mutate, eventBus]\n );\n\n return { revokeConnection, loading };\n}\n\nexport function useTestConnection() {\n const [mutate, { loading }] = useTestConnectionMutation();\n\n const testConnection = useCallback(\n async (connectionId: string): Promise<ConnectionTestResult | null> => {\n const result = await mutate({ variables: { connectionId } });\n return result.data?.testConnection ?? null;\n },\n [mutate]\n );\n\n return { testConnection, loading };\n}\n"],"mappings":";;;;;;;;AAwCA,SAAgB,EAAe,GAAkC;CAC/D,IAAM,EAAE,mBAAgB,GAAiB,EACnC,EAAE,SAAM,YAAS,UAAO,eAAY,EAAuB;EAC/D,WAAW;GAAE;GAAQ,YAAY,EAAE,OAAO,KAAK;GAAE;EACjD,MAAM,CAAC;EACP,aAAa;EACd,CAAC;AAMF,QAAO;EAAE,cAJqC,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAC9E,MAAkC,EAAc,EAAK,CAC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ACT;EAEsC;EAAS;;AAGlD,SAAgB,IAAkB;CAChC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAAkC,EAC9D,gBAAgB,CAAC,gBAAgB,EAClC,CAAC,EACI,IAAW,GAAyB;AAa1C,QAAO;EAAE,cAXY,EACnB,OAAO,MAAyB;GAC9B,IAAM,IAAS,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC;AAI5D,UAHI,EAAO,MAAM,0BACf,EAAS,KAAK,gCAAgC,EAAE,iBAAc,CAAC,EAE1D,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAEsB;EAAS;;AAGlC,SAAgB,IAAsB;CACpC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAA4B,EACxD,gBAAgB,CAAC,gBAAgB,EAClC,CAAC,EACI,IAAW,GAAyB;AAa1C,QAAO;EAAE,kBAXgB,EACvB,OAAO,MAAyB;GAC9B,IAAM,IAAS,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC;AAI5D,UAHI,EAAO,MAAM,oBACf,EAAS,KAAK,8BAA8B,EAAE,iBAAc,CAAC,EAExD,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAE0B;EAAS;;AAGtC,SAAgB,IAAoB;CAClC,IAAM,CAAC,GAAQ,EAAE,gBAAa,GAA2B;AAUzD,QAAO;EAAE,gBARc,EACrB,OAAO,OACU,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC,EAC9C,MAAM,kBAAkB,MAExC,CAAC,EAAO,CACT;EAEwB;EAAS"}
|
|
1
|
+
{"version":3,"file":"useConnections.js","names":[],"sources":["../../../src/integrations/hooks/useConnections.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for connections.\n */\n\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n useGetConnectionsQuery,\n useGetConnectionQuery,\n useGetConnectionsByProviderQuery,\n useCreateConnectionMutation,\n useInitiateOAuthMutation,\n useAuthenticateConnectionMutation,\n useAuthenticateWithApiKeyMutation,\n useAuthenticateWithBasicAuthMutation,\n useAuthenticateWithBearerTokenMutation,\n useRefreshConnectionTokenMutation,\n useRevokeConnectionMutation,\n useTestConnectionMutation,\n useDeleteConnectionMutation,\n} from '../../generated/wspace-operations';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { mapConnection } from '../utils/mappers';\nimport type {\n IntegrationConnection,\n ConnectionStatus,\n OAuthInitiationResult,\n ConnectionTestResult,\n} from '../types';\n\n/**\n * A query we never asked is NOT an empty result.\n *\n * ★★ THE BUG THIS EXISTS TO PREVENT. Apollo returns `loading: false`,\n * `error: undefined`, `data: undefined` for a SKIPPED query — identical, from a\n * caller's point of view, to a query that ran and found nothing. Pages then\n * render their empty state and tell the user, definitively, that they have no\n * connections.\n *\n * Measured in production 2026-09-13: `/integrations/connections` showed\n * \"No connections yet\" while the workspace held **46** connections — 8 ACTIVE\n * (Gmail, GitHub, Google Sheets, Linear, Anthropic), 1 EXPIRED, 37 PENDING_AUTH.\n * The assistant, asked the same question through the API, listed all 46. No\n * request left the browser and no error appeared anywhere.\n *\n * `workspaceId` is falsy whenever the active context has not resolved — and the\n * shell passes `activeContext.workspaceId ?? \"\"`, so \"not yet known\" arrives as\n * an empty string, which is falsy. Any render in that window produces a\n * confident, wrong answer.\n *\n * So `notReady` is returned separately and callers MUST NOT treat it as empty.\n * It is deliberately not folded into `loading`: a caller that shows a spinner is\n * right, and a caller that ignores it still cannot mistake it for \"none\".\n */\n\n// ─── Query Hooks ────────────────────────────────────────────────────────────\n\ninterface ConnectionFilterOptions {\n status?: ConnectionStatus;\n providerId?: string;\n search?: string;\n}\n\nexport function useConnections(filter?: ConnectionFilterOptions) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsQuery({\n variables: { filter, pagination: { limit: 100 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n\n // ★ Keyed on the ABSENCE OF DATA, not on why it is absent. A skipped query, a\n // query still in flight and a query that resolved from an empty cache entry all\n // land here, and none of them is evidence that the workspace has no connections.\n const answered = data?.getConnections !== undefined;\n\n const connections: IntegrationConnection[] = (data?.getConnections?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnections?.total ?? 0,\n loading,\n // ★ False until the server has actually told us. Callers MUST gate their\n // empty state on this — see the note above.\n answered,\n error,\n refetch,\n };\n}\n\nexport function useConnection(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n const answered = data?.getConnection !== undefined;\n\n const connection: IntegrationConnection | null = data?.getConnection\n ? mapConnection(data.getConnection as Record<string, unknown>)\n : null;\n\n return { connection, loading, answered, error, refetch };\n}\n\nexport function useConnectionsByProvider(providerId: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsByProviderQuery({\n variables: { providerId, pagination: { limit: 100 } },\n skip: !workspaceId || !providerId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnectionsByProvider?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnectionsByProvider?.total ?? 0,\n loading,\n error,\n refetch,\n };\n}\n\n// ─── Mutation Hooks ─────────────────────────────────────────────────────────\n\nexport function useCreateConnection() {\n const [mutate, { loading }] = useCreateConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const createConnection = useCallback(\n async (input: {\n name: string;\n description?: string;\n providerId: string;\n authMethodKey?: string;\n vaultId?: string;\n credentialSecretId?: string;\n managedSecretName?: string;\n config?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n const id = result.data?.createConnection?.id as string | undefined;\n if (id) {\n eventBus.emit('integrations:connection-created', {\n connectionId: id,\n providerKey: input.providerId,\n });\n }\n return id;\n },\n [mutate, eventBus]\n );\n\n return { createConnection, loading };\n}\n\nexport function useDeleteConnection() {\n const [mutate, { loading }] = useDeleteConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const deleteConnection = useCallback(\n async (id: string, deleteVaultSecret = false) => {\n await mutate({ variables: { id, deleteVaultSecret } });\n eventBus.emit('integrations:connection-deleted', { connectionId: id });\n },\n [mutate, eventBus]\n );\n\n return { deleteConnection, loading };\n}\n\nexport function useInitiateOAuth() {\n const [mutate, { loading }] = useInitiateOAuthMutation();\n const eventBus = useIntegrationsEventBus();\n\n const initiateOAuth = useCallback(\n async (\n connectionId: string,\n redirectUri: string,\n providerKey: string,\n scopes?: string[]\n ): Promise<OAuthInitiationResult | null> => {\n eventBus.emit('integrations:oauth-started', { connectionId, providerKey });\n const result = await mutate({ variables: { input: { connectionId, redirectUri, scopes } } });\n if (result.error) {\n eventBus.emit('integrations:oauth-failed', {\n connectionId,\n providerKey,\n error: result.error.message,\n });\n }\n return result.data?.initiateOAuth ?? null;\n },\n [mutate, eventBus]\n );\n\n return { initiateOAuth, loading };\n}\n\n/**\n * Authenticate a connection with values shaped by its auth method's schema.\n *\n * Generic replacement for the per-auth-type hooks below: the caller passes\n * whatever the rendered form collected, so a new auth type needs no new hook,\n * no new mutation document and no new branch at the call site.\n */\nexport function useAuthenticateConnection() {\n const [mutate, { loading }] = useAuthenticateConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateConnection = useCallback(\n async (\n connectionId: string,\n authMethodKey: string | undefined,\n values: Record<string, unknown>\n ) => {\n const result = await mutate({\n variables: { input: { connectionId, authMethodKey, values } },\n });\n return result.data?.authenticateConnection;\n },\n [mutate]\n );\n\n return { authenticateConnection, loading };\n}\n\nexport function useAuthenticateWithApiKey() {\n const [mutate, { loading }] = useAuthenticateWithApiKeyMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithApiKey = useCallback(\n async (connectionId: string, apiKey: string) => {\n const result = await mutate({ variables: { input: { connectionId, apiKey } } });\n return result.data?.authenticateWithApiKey;\n },\n [mutate]\n );\n\n return { authenticateWithApiKey, loading };\n}\n\nexport function useAuthenticateWithBasicAuth() {\n const [mutate, { loading }] = useAuthenticateWithBasicAuthMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBasicAuth = useCallback(\n async (connectionId: string, username: string, password: string) => {\n const result = await mutate({ variables: { input: { connectionId, username, password } } });\n return result.data?.authenticateWithBasicAuth;\n },\n [mutate]\n );\n\n return { authenticateWithBasicAuth, loading };\n}\n\nexport function useAuthenticateWithBearerToken() {\n const [mutate, { loading }] = useAuthenticateWithBearerTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBearerToken = useCallback(\n async (connectionId: string, token: string) => {\n const result = await mutate({ variables: { input: { connectionId, token } } });\n return result.data?.authenticateWithBearerToken;\n },\n [mutate]\n );\n\n return { authenticateWithBearerToken, loading };\n}\n\n/**\n * GraphQL document for the first-party SERVICE_ACCOUNT auth flow. Defined inline\n * (rather than via codegen) so it does not depend on a fresh `schema:pull` from\n * a gateway that already exposes the new `authenticateWithServiceAccount`\n * mutation. Once the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_SERVICE_ACCOUNT = gql`\n mutation AuthenticateWithServiceAccount($input: ServiceAccountAuthInput!) {\n authenticateWithServiceAccount(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a first-party SERVICE_ACCOUNT provider (e.g. Burdenoff). No user\n * credentials are collected — the platform mints an app-as-user token per\n * execution. Calling this records the user's consent (delegation) for the\n * reserved app and activates the connection.\n */\nexport function useAuthenticateWithServiceAccount() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithServiceAccount: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; scopes?: string[] } }\n >(AUTHENTICATE_WITH_SERVICE_ACCOUNT, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithServiceAccount = useCallback(\n async (connectionId: string, scopes?: string[]) => {\n const result = await mutate({ variables: { input: { connectionId, scopes } } });\n return result.data?.authenticateWithServiceAccount;\n },\n [mutate]\n );\n\n return { authenticateWithServiceAccount, loading };\n}\n\n/**\n * GraphQL document for CUSTOM provider auth (configSchema-driven config, e.g.\n * Google Workspace Admin domain-wide delegation). Defined inline (rather than\n * via codegen) so it does not depend on a fresh `schema:pull` from a gateway\n * that already exposes the new `authenticateWithCustomConfig` mutation. Once\n * the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_CUSTOM_CONFIG = gql`\n mutation AuthenticateWithCustomConfig($input: CustomConfigAuthInput!) {\n authenticateWithCustomConfig(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a CUSTOM provider with a configSchema-shaped config object. The full\n * config is stored inside the encrypted credential payload (secrets never hit\n * plain columns); the connection becomes ACTIVE immediately.\n */\nexport function useAuthenticateWithCustomConfig() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithCustomConfig: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; config: Record<string, unknown> } }\n >(AUTHENTICATE_WITH_CUSTOM_CONFIG, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithCustomConfig = useCallback(\n async (connectionId: string, config: Record<string, unknown>) => {\n const result = await mutate({ variables: { input: { connectionId, config } } });\n return result.data?.authenticateWithCustomConfig;\n },\n [mutate]\n );\n\n return { authenticateWithCustomConfig, loading };\n}\n\nexport function useRefreshToken() {\n const [mutate, { loading }] = useRefreshConnectionTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const refreshToken = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.refreshConnectionToken) {\n eventBus.emit('integrations:token-refreshed', { connectionId });\n }\n return result.data?.refreshConnectionToken;\n },\n [mutate, eventBus]\n );\n\n return { refreshToken, loading };\n}\n\nexport function useRevokeConnection() {\n const [mutate, { loading }] = useRevokeConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const revokeConnection = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.revokeConnection) {\n eventBus.emit('integrations:token-revoked', { connectionId });\n }\n return result.data?.revokeConnection;\n },\n [mutate, eventBus]\n );\n\n return { revokeConnection, loading };\n}\n\nexport function useTestConnection() {\n const [mutate, { loading }] = useTestConnectionMutation();\n\n const testConnection = useCallback(\n async (connectionId: string): Promise<ConnectionTestResult | null> => {\n const result = await mutate({ variables: { connectionId } });\n return result.data?.testConnection ?? null;\n },\n [mutate]\n );\n\n return { testConnection, loading };\n}\n"],"mappings":";;;;;;;;AAiEA,SAAgB,EAAe,GAAkC;CAC/D,IAAM,EAAE,mBAAgB,GAAiB,EACnC,EAAE,SAAM,YAAS,UAAO,eAAY,EAAuB;EAC/D,WAAW;GAAE;GAAQ,YAAY,EAAE,OAAO,KAAK;GAAE;EACjD,MAAM,CAAC;EACP,aAAa;EACd,CAAC,EAKI,IAAW,GAAM,mBAAmB,KAAA;AAM1C,QAAO;EACL,cAL4C,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAC9E,MAAkC,EAAc,EAAK,CACvD;EAIC,OAAO,GAAM,gBAAgB,SAAS;EACtC;EAGA;EACA;EACA;EACD;;AAGH,SAAgB,EAAc,GAAY;CACxC,IAAM,EAAE,mBAAgB,GAAiB,EACnC,EAAE,SAAM,YAAS,UAAO,eAAY,EAAsB;EAC9D,WAAW,EAAE,OAAI;EACjB,MAAM,CAAC,KAAe,CAAC;EACvB,aAAa;EACd,CAAC,EAEI,IAAW,GAAM,kBAAkB,KAAA;AAMzC,QAAO;EAAE,YAJwC,GAAM,gBACnD,EAAc,EAAK,cAAyC,GAC5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,gCAAgC,EAAE,iBAAc,CAAC,EAE1D,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAEsB;EAAS;;AAGlC,SAAgB,IAAsB;CACpC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAA4B,EACxD,gBAAgB,CAAC,gBAAgB,EAClC,CAAC,EACI,IAAW,GAAyB;AAa1C,QAAO;EAAE,kBAXgB,EACvB,OAAO,MAAyB;GAC9B,IAAM,IAAS,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC;AAI5D,UAHI,EAAO,MAAM,oBACf,EAAS,KAAK,8BAA8B,EAAE,iBAAc,CAAC,EAExD,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAE0B;EAAS;;AAGtC,SAAgB,IAAoB;CAClC,IAAM,CAAC,GAAQ,EAAE,gBAAa,GAA2B;AAUzD,QAAO;EAAE,gBARc,EACrB,OAAO,OACU,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC,EAC9C,MAAM,kBAAkB,MAExC,CAAC,EAAO,CACT;EAEwB;EAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionsList.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"names":[],"mappings":"AA2BA;;GAEG;AACH,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"ConnectionsList.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"names":[],"mappings":"AA2BA;;GAEG;AACH,wBAAgB,eAAe,gCAga9B"}
|
|
@@ -6,219 +6,219 @@ import { useIntegrationsStore as i } from "../store/integrationsStore.js";
|
|
|
6
6
|
import { joinPath as a } from "../utils/navigation.js";
|
|
7
7
|
import { useConnections as o } from "../hooks/useConnections.js";
|
|
8
8
|
import { AddConnectionDialog as s } from "../components/AddConnectionDialog.js";
|
|
9
|
-
import { CONNECTION_STATUS_OPTIONS as c, PROVIDER_CATEGORIES as
|
|
10
|
-
import { ConnectionCard as
|
|
11
|
-
import { useId as
|
|
12
|
-
import { AlertCircle as f, ArrowLeft as
|
|
13
|
-
import { usePermissions as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { Button as
|
|
9
|
+
import { CONNECTION_STATUS_OPTIONS as c, PROVIDER_CATEGORIES as ee } from "../utils/constants.js";
|
|
10
|
+
import { ConnectionCard as te } from "../components/ConnectionCard.js";
|
|
11
|
+
import { useId as l, useMemo as u, useState as d } from "react";
|
|
12
|
+
import { AlertCircle as f, ArrowLeft as p, Filter as m, Grid3x3 as h, Link2 as g, List as _, Plus as v, RefreshCw as y, Search as b, X as x } from "lucide-react";
|
|
13
|
+
import { usePermissions as S } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
14
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
15
|
+
import { Button as T, EmphasisPanel as ne, IllustratedEmptyState as re, PagePurpose as ie } from "@burdenoff/fe-libs/ui";
|
|
16
16
|
//#region src/integrations/pages/ConnectionsList.tsx
|
|
17
|
-
function
|
|
18
|
-
let { basePath:
|
|
19
|
-
let e =
|
|
20
|
-
if (
|
|
21
|
-
let t =
|
|
17
|
+
function E() {
|
|
18
|
+
let { basePath: E = "/", navigate: D, onConnectionSelect: O } = e(), k = t(), { viewMode: A, setViewMode: j, connectionFilter: M, updateConnectionFilter: N, addConnectionDialogOpen: P, openAddConnectionDialog: F, closeAddConnectionDialog: I } = i(), { connections: L, loading: R, answered: z, error: B, refetch: V } = o(), H = !R && !B && !z, { hasPermission: U, isLoading: W } = S(), G = !W && U(r.CONNECTION_CREATE), [K, q] = d(!1), J = l(), Y = `${J}-status`, X = `${J}-category`, Z = u(() => {
|
|
19
|
+
let e = L ?? [];
|
|
20
|
+
if (M.search) {
|
|
21
|
+
let t = M.search.toLowerCase();
|
|
22
22
|
e = e.filter((e) => e.name.toLowerCase().includes(t) || e.provider.name.toLowerCase().includes(t) || (e.externalAccountEmail?.toLowerCase().includes(t) ?? !1));
|
|
23
23
|
}
|
|
24
|
-
return
|
|
25
|
-
}, [
|
|
26
|
-
|
|
24
|
+
return M.status !== "all" && (e = e.filter((e) => e.status === M.status)), M.providerId && (e = e.filter((e) => e.provider.id === M.providerId)), M.category !== "all" && (e = e.filter((e) => e.provider.category === M.category)), e.sort((e, t) => new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime());
|
|
25
|
+
}, [L, M]), Q = M.search || M.status !== "all" || M.providerId || M.category !== "all", $ = () => {
|
|
26
|
+
N({
|
|
27
27
|
search: "",
|
|
28
28
|
status: "all",
|
|
29
29
|
providerId: null,
|
|
30
30
|
category: "all"
|
|
31
31
|
});
|
|
32
|
-
},
|
|
33
|
-
|
|
32
|
+
}, ae = (e) => {
|
|
33
|
+
O?.(e), D?.(a(E, `connections/${e.id}`));
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ w("div", {
|
|
36
36
|
className: "space-y-6 p-6 max-w-7xl mx-auto",
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ C("div", {
|
|
39
39
|
className: "rounded-xl border border-border-seam bg-accent-wash p-6",
|
|
40
40
|
"data-tour": "integrations-connections-header",
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ w("div", {
|
|
42
42
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ w("div", {
|
|
44
44
|
className: "flex min-w-0 items-center gap-4",
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ C(T, {
|
|
47
47
|
variant: "ghost",
|
|
48
48
|
size: "icon",
|
|
49
49
|
className: "shrink-0",
|
|
50
|
-
onClick: () =>
|
|
51
|
-
"aria-label":
|
|
52
|
-
children: /* @__PURE__ */
|
|
50
|
+
onClick: () => D?.(E),
|
|
51
|
+
"aria-label": k("integrations.connections.actions.backAriaLabel", "Back to overview"),
|
|
52
|
+
children: /* @__PURE__ */ C(p, { size: 20 })
|
|
53
53
|
}),
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ C("div", {
|
|
55
55
|
className: "shrink-0 p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
56
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ C(g, {
|
|
57
57
|
size: 24,
|
|
58
58
|
className: "text-primary"
|
|
59
59
|
})
|
|
60
60
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ w("div", {
|
|
62
62
|
className: "min-w-0",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ C("h1", {
|
|
64
64
|
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
65
|
-
children:
|
|
66
|
-
}), /* @__PURE__ */
|
|
65
|
+
children: k("integrations.connections.title", "Connections")
|
|
66
|
+
}), /* @__PURE__ */ C("p", {
|
|
67
67
|
className: "text-sm text-text-secondary mt-0.5",
|
|
68
|
-
children:
|
|
68
|
+
children: k("integrations.connections.subtitle", "Manage your integration connections")
|
|
69
69
|
})]
|
|
70
70
|
})
|
|
71
71
|
]
|
|
72
|
-
}), G && /* @__PURE__ */
|
|
72
|
+
}), G && /* @__PURE__ */ w(T, {
|
|
73
73
|
className: "shrink-0",
|
|
74
|
-
onClick: () =>
|
|
75
|
-
children: [/* @__PURE__ */
|
|
74
|
+
onClick: () => F(),
|
|
75
|
+
children: [/* @__PURE__ */ C(v, { size: 16 }), k("integrations.connections.actions.addConnection", "Add Connection")]
|
|
76
76
|
})]
|
|
77
77
|
})
|
|
78
78
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
icon: /* @__PURE__ */
|
|
81
|
-
children:
|
|
79
|
+
/* @__PURE__ */ C(ie, {
|
|
80
|
+
icon: /* @__PURE__ */ C(g, { size: 16 }),
|
|
81
|
+
children: k("integrations.connections.purpose", "A connection is one authenticated link between your workspace and an external service (for example, \"Marketing Slack\" or \"Finance Google Drive\"). Use this page to see every connection at a glance, check its health, search by provider or account, and open one to test, refresh, or revoke its access.")
|
|
82
82
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ w("div", {
|
|
84
84
|
className: "space-y-4",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ w("div", {
|
|
86
86
|
className: "flex flex-col sm:flex-row gap-3",
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ w("div", {
|
|
89
89
|
className: "flex-1 relative group",
|
|
90
90
|
"data-tour": "integrations-connections-search",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ C(b, {
|
|
92
92
|
size: 18,
|
|
93
93
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors"
|
|
94
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ C("input", {
|
|
95
95
|
type: "text",
|
|
96
|
-
placeholder:
|
|
97
|
-
value:
|
|
98
|
-
onChange: (e) =>
|
|
96
|
+
placeholder: k("integrations.connections.search.placeholder", "Search connections..."),
|
|
97
|
+
value: M.search,
|
|
98
|
+
onChange: (e) => N({ search: e.target.value }),
|
|
99
99
|
className: "w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
|
|
100
|
-
"aria-label":
|
|
100
|
+
"aria-label": k("integrations.connections.search.ariaLabel", "Search connections")
|
|
101
101
|
})]
|
|
102
102
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ w("button", {
|
|
104
104
|
type: "button",
|
|
105
105
|
onClick: () => q(!K),
|
|
106
106
|
className: n("inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all", K || Q ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface text-text-primary border-border-subtle hover:bg-accent"),
|
|
107
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ C(m, { size: 16 }), K ? k("integrations.connections.filters.hide", "Hide") : k("integrations.connections.filters.show", "Filter")]
|
|
108
108
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ w("div", {
|
|
110
110
|
className: "flex items-center border border-border-subtle rounded-lg overflow-hidden",
|
|
111
111
|
"data-tour": "integrations-connections-view-toggle",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ C("button", {
|
|
113
113
|
type: "button",
|
|
114
|
-
onClick: () =>
|
|
115
|
-
className: n("p-2.5 transition-colors",
|
|
116
|
-
"aria-label":
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
-
}), /* @__PURE__ */
|
|
114
|
+
onClick: () => j("grid"),
|
|
115
|
+
className: n("p-2.5 transition-colors", A === "grid" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
116
|
+
"aria-label": k("integrations.connections.view.gridAriaLabel", "Grid view"),
|
|
117
|
+
children: /* @__PURE__ */ C(h, { size: 16 })
|
|
118
|
+
}), /* @__PURE__ */ C("button", {
|
|
119
119
|
type: "button",
|
|
120
|
-
onClick: () =>
|
|
121
|
-
className: n("p-2.5 transition-colors",
|
|
122
|
-
"aria-label":
|
|
123
|
-
children: /* @__PURE__ */
|
|
120
|
+
onClick: () => j("list"),
|
|
121
|
+
className: n("p-2.5 transition-colors", A === "list" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
122
|
+
"aria-label": k("integrations.connections.view.listAriaLabel", "List view"),
|
|
123
|
+
children: /* @__PURE__ */ C(_, { size: 16 })
|
|
124
124
|
})]
|
|
125
125
|
})
|
|
126
126
|
]
|
|
127
|
-
}), K && /* @__PURE__ */
|
|
127
|
+
}), K && /* @__PURE__ */ w("div", {
|
|
128
128
|
className: "rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ w("div", {
|
|
130
130
|
className: "flex items-center justify-between mb-4",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
131
|
+
children: [/* @__PURE__ */ w("h3", {
|
|
132
132
|
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
133
|
-
children: [/* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ C(m, {
|
|
134
134
|
size: 16,
|
|
135
135
|
className: "text-primary"
|
|
136
|
-
}),
|
|
137
|
-
}), Q && /* @__PURE__ */
|
|
136
|
+
}), k("integrations.connections.filters.panelTitle", "Filters")]
|
|
137
|
+
}), Q && /* @__PURE__ */ w("button", {
|
|
138
138
|
type: "button",
|
|
139
139
|
onClick: $,
|
|
140
140
|
className: "text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1",
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ C(x, { size: 14 }),
|
|
143
143
|
" ",
|
|
144
|
-
|
|
144
|
+
k("integrations.connections.filters.clearAll", "Clear All")
|
|
145
145
|
]
|
|
146
146
|
})]
|
|
147
|
-
}), /* @__PURE__ */
|
|
147
|
+
}), /* @__PURE__ */ w("div", {
|
|
148
148
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ w("div", {
|
|
150
150
|
className: "space-y-2",
|
|
151
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ C("label", {
|
|
152
152
|
htmlFor: Y,
|
|
153
153
|
className: "block text-sm font-medium text-text-primary",
|
|
154
|
-
children:
|
|
155
|
-
}), /* @__PURE__ */
|
|
154
|
+
children: k("integrations.connections.filters.statusLabel", "Status")
|
|
155
|
+
}), /* @__PURE__ */ w("select", {
|
|
156
156
|
id: Y,
|
|
157
|
-
value:
|
|
158
|
-
onChange: (e) =>
|
|
157
|
+
value: M.status,
|
|
158
|
+
onChange: (e) => N({ status: e.target.value }),
|
|
159
159
|
className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ C("option", {
|
|
161
161
|
value: "all",
|
|
162
|
-
children:
|
|
163
|
-
}), c.map((e) => /* @__PURE__ */
|
|
162
|
+
children: k("integrations.connections.filters.statusAll", "All Statuses")
|
|
163
|
+
}), c.map((e) => /* @__PURE__ */ C("option", {
|
|
164
164
|
value: e.value,
|
|
165
|
-
children:
|
|
165
|
+
children: k(`integrations.status.${e.value}`, e.label)
|
|
166
166
|
}, e.value))]
|
|
167
167
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ w("div", {
|
|
169
169
|
className: "space-y-2",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ C("label", {
|
|
171
171
|
htmlFor: X,
|
|
172
172
|
className: "block text-sm font-medium text-text-primary",
|
|
173
|
-
children:
|
|
174
|
-
}), /* @__PURE__ */
|
|
173
|
+
children: k("integrations.connections.filters.categoryLabel", "Category")
|
|
174
|
+
}), /* @__PURE__ */ w("select", {
|
|
175
175
|
id: X,
|
|
176
|
-
value:
|
|
177
|
-
onChange: (e) =>
|
|
176
|
+
value: M.category,
|
|
177
|
+
onChange: (e) => N({ category: e.target.value }),
|
|
178
178
|
className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ C("option", {
|
|
180
180
|
value: "all",
|
|
181
|
-
children:
|
|
182
|
-
}),
|
|
181
|
+
children: k("integrations.connections.filters.categoryAll", "All Categories")
|
|
182
|
+
}), ee.map((e) => /* @__PURE__ */ C("option", {
|
|
183
183
|
value: e.value,
|
|
184
|
-
children:
|
|
184
|
+
children: k(`integrations.category.${e.value}`, e.label)
|
|
185
185
|
}, e.value))]
|
|
186
186
|
})]
|
|
187
187
|
})]
|
|
188
188
|
})]
|
|
189
189
|
})]
|
|
190
190
|
}),
|
|
191
|
-
|
|
191
|
+
B && /* @__PURE__ */ w("div", {
|
|
192
192
|
className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ C(f, {
|
|
194
194
|
size: 24,
|
|
195
195
|
className: "text-status-error-text flex-shrink-0"
|
|
196
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ w("div", {
|
|
197
197
|
className: "flex-1",
|
|
198
198
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ C("h3", {
|
|
200
200
|
className: "font-semibold text-status-error-text mb-1",
|
|
201
|
-
children:
|
|
201
|
+
children: k("integrations.connections.error.title", "Error loading connections")
|
|
202
202
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ C("p", {
|
|
204
204
|
className: "text-sm text-status-error-text mb-3",
|
|
205
|
-
children:
|
|
205
|
+
children: B.message
|
|
206
206
|
}),
|
|
207
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ w("button", {
|
|
208
208
|
type: "button",
|
|
209
|
-
onClick: () =>
|
|
209
|
+
onClick: () => V(),
|
|
210
210
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors",
|
|
211
211
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ C(y, { size: 14 }),
|
|
213
213
|
" ",
|
|
214
|
-
|
|
214
|
+
k("integrations.common.retry", "Try Again")
|
|
215
215
|
]
|
|
216
216
|
})
|
|
217
217
|
]
|
|
218
218
|
})]
|
|
219
219
|
}),
|
|
220
|
-
|
|
221
|
-
className: n(
|
|
220
|
+
(R || H) && /* @__PURE__ */ C("div", {
|
|
221
|
+
className: n(A === "grid" ? "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4" : "space-y-3"),
|
|
222
222
|
children: [...[
|
|
223
223
|
,
|
|
224
224
|
,
|
|
@@ -226,29 +226,29 @@ function O() {
|
|
|
226
226
|
,
|
|
227
227
|
,
|
|
228
228
|
,
|
|
229
|
-
]].map((e, t) => /* @__PURE__ */
|
|
229
|
+
]].map((e, t) => /* @__PURE__ */ C("div", {
|
|
230
230
|
className: "rounded-xl border border-border-seam bg-bg-surface p-5",
|
|
231
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ w("div", {
|
|
232
232
|
className: "flex items-start gap-3",
|
|
233
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ C("div", { className: "size-11 bg-bg-sunken rounded-xl animate-vc-shimmer" }), /* @__PURE__ */ w("div", {
|
|
234
234
|
className: "flex-1 space-y-2",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ C("div", { className: "h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer" }), /* @__PURE__ */ C("div", { className: "h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer" })]
|
|
236
236
|
})]
|
|
237
237
|
})
|
|
238
238
|
}, t))
|
|
239
239
|
}),
|
|
240
|
-
!B && !
|
|
240
|
+
!R && !B && !H && /* @__PURE__ */ w(ne, {
|
|
241
241
|
className: "overflow-hidden p-0",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ w("div", {
|
|
243
243
|
className: "flex items-center justify-between gap-2 p-5 border-b border-border-seam",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ w("div", {
|
|
245
245
|
className: "flex items-center gap-2",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ C(g, {
|
|
247
247
|
size: 18,
|
|
248
248
|
className: "text-primary"
|
|
249
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ w("h2", {
|
|
250
250
|
className: "font-semibold text-text-primary",
|
|
251
|
-
children: [
|
|
251
|
+
children: [k("integrations.connections.results.title", "Your Connections"), Z.length > 0 && /* @__PURE__ */ w("span", {
|
|
252
252
|
className: "ml-2 text-sm font-normal text-text-secondary tabular-nums",
|
|
253
253
|
children: [
|
|
254
254
|
"(",
|
|
@@ -257,56 +257,56 @@ function O() {
|
|
|
257
257
|
]
|
|
258
258
|
})]
|
|
259
259
|
})]
|
|
260
|
-
}), G && Z.length > 0 && /* @__PURE__ */
|
|
260
|
+
}), G && Z.length > 0 && /* @__PURE__ */ w(T, {
|
|
261
261
|
size: "sm",
|
|
262
262
|
variant: "outline",
|
|
263
|
-
onClick: () =>
|
|
263
|
+
onClick: () => F(),
|
|
264
264
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ C(v, { size: 14 }),
|
|
266
266
|
" ",
|
|
267
|
-
|
|
267
|
+
k("integrations.connections.actions.add", "Add")
|
|
268
268
|
]
|
|
269
269
|
})]
|
|
270
|
-
}), Z.length > 0 ? /* @__PURE__ */
|
|
271
|
-
className: n("p-5",
|
|
272
|
-
children: Z.map((e) => /* @__PURE__ */
|
|
270
|
+
}), Z.length > 0 ? /* @__PURE__ */ C("div", {
|
|
271
|
+
className: n("p-5", A === "grid" ? "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4" : "space-y-3"),
|
|
272
|
+
children: Z.map((e) => /* @__PURE__ */ C(te, {
|
|
273
273
|
connection: e,
|
|
274
|
-
displayMode:
|
|
275
|
-
onClick:
|
|
274
|
+
displayMode: A,
|
|
275
|
+
onClick: ae
|
|
276
276
|
}, e.id))
|
|
277
|
-
}) : /* @__PURE__ */
|
|
277
|
+
}) : /* @__PURE__ */ C(re, {
|
|
278
278
|
illustration: Q ? "empty-search" : "empty-data",
|
|
279
|
-
title: Q ?
|
|
280
|
-
description: Q ?
|
|
281
|
-
action: Q ? /* @__PURE__ */
|
|
279
|
+
title: Q ? k("integrations.connections.empty.filteredTitle", "No matching connections") : k("integrations.connections.empty.title", "No connections yet"),
|
|
280
|
+
description: Q ? k("integrations.connections.empty.filteredDescription", "Try adjusting your search or filters.") : G ? k("integrations.connections.empty.description", "Add a connection to start integrating with external services.") : k("integrations.connections.empty.readOnlyDescription", "No connections are configured yet. Contact your workspace admin to add one."),
|
|
281
|
+
action: Q ? /* @__PURE__ */ w(T, {
|
|
282
282
|
variant: "outline",
|
|
283
283
|
onClick: $,
|
|
284
284
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ C(x, { size: 14 }),
|
|
286
286
|
" ",
|
|
287
|
-
|
|
287
|
+
k("integrations.connections.empty.clearFilters", "Clear Filters")
|
|
288
288
|
]
|
|
289
|
-
}) : G ? /* @__PURE__ */
|
|
290
|
-
onClick: () =>
|
|
289
|
+
}) : G ? /* @__PURE__ */ w(T, {
|
|
290
|
+
onClick: () => F(),
|
|
291
291
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ C(v, { size: 14 }),
|
|
293
293
|
" ",
|
|
294
|
-
|
|
294
|
+
k("integrations.connections.actions.addConnection", "Add Connection")
|
|
295
295
|
]
|
|
296
296
|
}) : void 0
|
|
297
297
|
})]
|
|
298
298
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
open:
|
|
301
|
-
onClose:
|
|
299
|
+
/* @__PURE__ */ C(s, {
|
|
300
|
+
open: P,
|
|
301
|
+
onClose: I,
|
|
302
302
|
onConnectionCreated: () => {
|
|
303
|
-
|
|
303
|
+
V();
|
|
304
304
|
}
|
|
305
305
|
})
|
|
306
306
|
]
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
309
|
//#endregion
|
|
310
|
-
export {
|
|
310
|
+
export { E as ConnectionsList };
|
|
311
311
|
|
|
312
312
|
//# sourceMappingURL=ConnectionsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionsList.js","names":[],"sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n Search,\n Filter,\n X,\n Grid3x3,\n List,\n Plus,\n Link2,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { useConnections } from '../hooks/useConnections';\nimport { joinPath } from '../utils/navigation';\nimport { ConnectionCard } from '../components/ConnectionCard';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { CONNECTION_STATUS_OPTIONS, PROVIDER_CATEGORIES } from '../utils/constants';\nimport type { IntegrationConnection, ConnectionStatus, ProviderCategory } from '../types';\nimport { Button, EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\n/**\n * Connections List — list of all connections with search and status filter.\n */\nexport function ConnectionsList() {\n const { basePath = '/', navigate, onConnectionSelect } = useIntegrations();\n const tr = useTr();\n const {\n viewMode,\n setViewMode,\n connectionFilter,\n updateConnectionFilter,\n addConnectionDialogOpen,\n openAddConnectionDialog,\n closeAddConnectionDialog,\n } = useIntegrationsStore();\n\n const { connections, loading, error, refetch } = useConnections();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [showFilters, setShowFilters] = useState(false);\n const idPrefix = useId();\n const statusFilterId = `${idPrefix}-status`;\n const categoryFilterId = `${idPrefix}-category`;\n\n const filteredConnections = useMemo(() => {\n let result = connections ?? [];\n\n if (connectionFilter.search) {\n const q = connectionFilter.search.toLowerCase();\n result = result.filter(\n (c: IntegrationConnection) =>\n c.name.toLowerCase().includes(q) ||\n c.provider.name.toLowerCase().includes(q) ||\n (c.externalAccountEmail?.toLowerCase().includes(q) ?? false)\n );\n }\n\n if (connectionFilter.status !== 'all') {\n result = result.filter((c: IntegrationConnection) => c.status === connectionFilter.status);\n }\n\n if (connectionFilter.providerId) {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.id === connectionFilter.providerId\n );\n }\n\n if (connectionFilter.category !== 'all') {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.category === connectionFilter.category\n );\n }\n\n return result.sort(\n (a: IntegrationConnection, b: IntegrationConnection) =>\n new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()\n );\n }, [connections, connectionFilter]);\n\n const hasActiveFilters =\n connectionFilter.search ||\n connectionFilter.status !== 'all' ||\n connectionFilter.providerId ||\n connectionFilter.category !== 'all';\n\n const handleClearFilters = () => {\n updateConnectionFilter({ search: '', status: 'all', providerId: null, category: 'all' });\n };\n\n const handleConnectionClick = (connection: IntegrationConnection) => {\n onConnectionSelect?.(connection);\n navigate?.(joinPath(basePath, `connections/${connection.id}`));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-connections-header\"\n >\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex min-w-0 items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"shrink-0\"\n onClick={() => navigate?.(basePath)}\n aria-label={tr('integrations.connections.actions.backAriaLabel', 'Back to overview')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"shrink-0 p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Link2 size={24} className=\"text-primary\" />\n </div>\n <div className=\"min-w-0\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tr('integrations.connections.title', 'Connections')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr('integrations.connections.subtitle', 'Manage your integration connections')}\n </p>\n </div>\n </div>\n {canCreate && (\n <Button className=\"shrink-0\" onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n )}\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Link2 size={16} />}>\n {tr(\n 'integrations.connections.purpose',\n 'A connection is one authenticated link between your workspace and an external service (for example, \"Marketing Slack\" or \"Finance Google Drive\"). Use this page to see every connection at a glance, check its health, search by provider or account, and open one to test, refresh, or revoke its access.'\n )}\n </PagePurpose>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\" data-tour=\"integrations-connections-search\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder={tr(\n 'integrations.connections.search.placeholder',\n 'Search connections...'\n )}\n value={connectionFilter.search}\n onChange={(e) => updateConnectionFilter({ search: e.target.value })}\n className=\"w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n aria-label={tr('integrations.connections.search.ariaLabel', 'Search connections')}\n />\n </div>\n\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} />\n {showFilters\n ? tr('integrations.connections.filters.hide', 'Hide')\n : tr('integrations.connections.filters.show', 'Filter')}\n </button>\n\n <div\n className=\"flex items-center border border-border-subtle rounded-lg overflow-hidden\"\n data-tour=\"integrations-connections-view-toggle\"\n >\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'grid'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.gridAriaLabel', 'Grid view')}\n >\n <Grid3x3 size={16} />\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'list'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.listAriaLabel', 'List view')}\n >\n <List size={16} />\n </button>\n </div>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />\n {tr('integrations.connections.filters.panelTitle', 'Filters')}\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1\"\n >\n <X size={14} /> {tr('integrations.connections.filters.clearAll', 'Clear All')}\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={statusFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.statusLabel', 'Status')}\n </label>\n <select\n id={statusFilterId}\n value={connectionFilter.status}\n onChange={(e) =>\n updateConnectionFilter({ status: e.target.value as ConnectionStatus | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.statusAll', 'All Statuses')}\n </option>\n {CONNECTION_STATUS_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.status.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={categoryFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.categoryLabel', 'Category')}\n </label>\n <select\n id={categoryFilterId}\n value={connectionFilter.category}\n onChange={(e) =>\n updateConnectionFilter({ category: e.target.value as ProviderCategory | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.categoryAll', 'All Categories')}\n </option>\n {PROVIDER_CATEGORIES.map((cat) => (\n <option key={cat.value} value={cat.value}>\n {tr(`integrations.category.${cat.value}`, cat.label)}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.connections.error.title', 'Error loading connections')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} /> {tr('integrations.common.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {loading && (\n <div\n className={cn(\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {[...Array(6)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-11 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Connections — the page's primary emphasis zone */}\n {!loading && !error && (\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"flex items-center justify-between gap-2 p-5 border-b border-border-seam\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tr('integrations.connections.results.title', 'Your Connections')}\n {filteredConnections.length > 0 && (\n <span className=\"ml-2 text-sm font-normal text-text-secondary tabular-nums\">\n ({filteredConnections.length})\n </span>\n )}\n </h2>\n </div>\n {canCreate && filteredConnections.length > 0 && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => openAddConnectionDialog()}>\n <Plus size={14} /> {tr('integrations.connections.actions.add', 'Add')}\n </Button>\n )}\n </div>\n\n {filteredConnections.length > 0 ? (\n <div\n className={cn(\n 'p-5',\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {filteredConnections.map((conn: IntegrationConnection) => (\n <ConnectionCard\n key={conn.id}\n connection={conn}\n displayMode={viewMode}\n onClick={handleConnectionClick}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={\n hasActiveFilters\n ? tr('integrations.connections.empty.filteredTitle', 'No matching connections')\n : tr('integrations.connections.empty.title', 'No connections yet')\n }\n description={\n hasActiveFilters\n ? tr(\n 'integrations.connections.empty.filteredDescription',\n 'Try adjusting your search or filters.'\n )\n : canCreate\n ? tr(\n 'integrations.connections.empty.description',\n 'Add a connection to start integrating with external services.'\n )\n : tr(\n 'integrations.connections.empty.readOnlyDescription',\n 'No connections are configured yet. Contact your workspace admin to add one.'\n )\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} />{' '}\n {tr('integrations.connections.empty.clearFilters', 'Clear Filters')}\n </Button>\n ) : canCreate ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={14} />{' '}\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n </EmphasisPanel>\n )}\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,IAAkB;CAChC,IAAM,EAAE,cAAW,KAAK,aAAU,0BAAuB,GAAiB,EACpE,IAAK,GAAO,EACZ,EACJ,aACA,gBACA,qBACA,2BACA,4BACA,4BACA,gCACE,GAAsB,EAEpB,EAAE,gBAAa,YAAS,UAAO,eAAY,GAAgB,EAC3D,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAY,CAAC,KAAsB,EAAc,EAAwB,kBAAkB,EAC3F,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,IAAW,IAAO,EAClB,IAAiB,GAAG,EAAS,UAC7B,IAAmB,GAAG,EAAS,YAE/B,IAAsB,QAAc;EACxC,IAAI,IAAS,KAAe,E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AChE;UACP,KAAA;KAEN,CAAA,CAEU;;GAGlB,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACzB,QAAS;;IAEX,CAAA;GACE"}
|
|
1
|
+
{"version":3,"file":"ConnectionsList.js","names":[],"sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n Search,\n Filter,\n X,\n Grid3x3,\n List,\n Plus,\n Link2,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { useConnections } from '../hooks/useConnections';\nimport { joinPath } from '../utils/navigation';\nimport { ConnectionCard } from '../components/ConnectionCard';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { CONNECTION_STATUS_OPTIONS, PROVIDER_CATEGORIES } from '../utils/constants';\nimport type { IntegrationConnection, ConnectionStatus, ProviderCategory } from '../types';\nimport { Button, EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\n/**\n * Connections List — list of all connections with search and status filter.\n */\nexport function ConnectionsList() {\n const { basePath = '/', navigate, onConnectionSelect } = useIntegrations();\n const tr = useTr();\n const {\n viewMode,\n setViewMode,\n connectionFilter,\n updateConnectionFilter,\n addConnectionDialogOpen,\n openAddConnectionDialog,\n closeAddConnectionDialog,\n } = useIntegrationsStore();\n\n const { connections, loading, answered, error, refetch } = useConnections();\n\n /**\n * ★★ NEVER CLAIM \"no connections\" UNTIL THE SERVER HAS SAID SO.\n *\n * Measured in production 2026-09-13: this page rendered \"No connections yet\"\n * while the workspace held 46 connections — 8 ACTIVE (Gmail, GitHub, Google\n * Sheets, Linear, Anthropic), 1 EXPIRED, 37 PENDING_AUTH. The assistant, asked\n * the same question through the API, listed all 46. The loading state never\n * appeared and no error was shown, so the page presented a confident, wrong\n * answer and the user reasonably believed they had nothing connected.\n *\n * The cause is that `loading: false, error: undefined, data: undefined` — what\n * Apollo returns for a SKIPPED query, and equally for one resolved from an\n * empty cache entry — is indistinguishable here from \"asked and found none\".\n * `answered` closes that gap: it is false until `data.getConnections` exists.\n *\n * Gating the empty state is the point. Rendering the unanswered case as\n * loading is a presentation choice; claiming emptiness we never verified is a\n * correctness bug.\n */\n const unanswered = !loading && !error && !answered;\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [showFilters, setShowFilters] = useState(false);\n const idPrefix = useId();\n const statusFilterId = `${idPrefix}-status`;\n const categoryFilterId = `${idPrefix}-category`;\n\n const filteredConnections = useMemo(() => {\n let result = connections ?? [];\n\n if (connectionFilter.search) {\n const q = connectionFilter.search.toLowerCase();\n result = result.filter(\n (c: IntegrationConnection) =>\n c.name.toLowerCase().includes(q) ||\n c.provider.name.toLowerCase().includes(q) ||\n (c.externalAccountEmail?.toLowerCase().includes(q) ?? false)\n );\n }\n\n if (connectionFilter.status !== 'all') {\n result = result.filter((c: IntegrationConnection) => c.status === connectionFilter.status);\n }\n\n if (connectionFilter.providerId) {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.id === connectionFilter.providerId\n );\n }\n\n if (connectionFilter.category !== 'all') {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.category === connectionFilter.category\n );\n }\n\n return result.sort(\n (a: IntegrationConnection, b: IntegrationConnection) =>\n new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()\n );\n }, [connections, connectionFilter]);\n\n const hasActiveFilters =\n connectionFilter.search ||\n connectionFilter.status !== 'all' ||\n connectionFilter.providerId ||\n connectionFilter.category !== 'all';\n\n const handleClearFilters = () => {\n updateConnectionFilter({ search: '', status: 'all', providerId: null, category: 'all' });\n };\n\n const handleConnectionClick = (connection: IntegrationConnection) => {\n onConnectionSelect?.(connection);\n navigate?.(joinPath(basePath, `connections/${connection.id}`));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-connections-header\"\n >\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex min-w-0 items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"shrink-0\"\n onClick={() => navigate?.(basePath)}\n aria-label={tr('integrations.connections.actions.backAriaLabel', 'Back to overview')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"shrink-0 p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Link2 size={24} className=\"text-primary\" />\n </div>\n <div className=\"min-w-0\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tr('integrations.connections.title', 'Connections')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr('integrations.connections.subtitle', 'Manage your integration connections')}\n </p>\n </div>\n </div>\n {canCreate && (\n <Button className=\"shrink-0\" onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n )}\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Link2 size={16} />}>\n {tr(\n 'integrations.connections.purpose',\n 'A connection is one authenticated link between your workspace and an external service (for example, \"Marketing Slack\" or \"Finance Google Drive\"). Use this page to see every connection at a glance, check its health, search by provider or account, and open one to test, refresh, or revoke its access.'\n )}\n </PagePurpose>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\" data-tour=\"integrations-connections-search\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder={tr(\n 'integrations.connections.search.placeholder',\n 'Search connections...'\n )}\n value={connectionFilter.search}\n onChange={(e) => updateConnectionFilter({ search: e.target.value })}\n className=\"w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n aria-label={tr('integrations.connections.search.ariaLabel', 'Search connections')}\n />\n </div>\n\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} />\n {showFilters\n ? tr('integrations.connections.filters.hide', 'Hide')\n : tr('integrations.connections.filters.show', 'Filter')}\n </button>\n\n <div\n className=\"flex items-center border border-border-subtle rounded-lg overflow-hidden\"\n data-tour=\"integrations-connections-view-toggle\"\n >\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'grid'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.gridAriaLabel', 'Grid view')}\n >\n <Grid3x3 size={16} />\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'list'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.listAriaLabel', 'List view')}\n >\n <List size={16} />\n </button>\n </div>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />\n {tr('integrations.connections.filters.panelTitle', 'Filters')}\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1\"\n >\n <X size={14} /> {tr('integrations.connections.filters.clearAll', 'Clear All')}\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={statusFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.statusLabel', 'Status')}\n </label>\n <select\n id={statusFilterId}\n value={connectionFilter.status}\n onChange={(e) =>\n updateConnectionFilter({ status: e.target.value as ConnectionStatus | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.statusAll', 'All Statuses')}\n </option>\n {CONNECTION_STATUS_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.status.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={categoryFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.categoryLabel', 'Category')}\n </label>\n <select\n id={categoryFilterId}\n value={connectionFilter.category}\n onChange={(e) =>\n updateConnectionFilter({ category: e.target.value as ProviderCategory | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.categoryAll', 'All Categories')}\n </option>\n {PROVIDER_CATEGORIES.map((cat) => (\n <option key={cat.value} value={cat.value}>\n {tr(`integrations.category.${cat.value}`, cat.label)}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.connections.error.title', 'Error loading connections')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} /> {tr('integrations.common.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {(loading || unanswered) && (\n <div\n className={cn(\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {[...Array(6)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-11 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Connections — the page's primary emphasis zone */}\n {!loading && !error && !unanswered && (\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"flex items-center justify-between gap-2 p-5 border-b border-border-seam\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tr('integrations.connections.results.title', 'Your Connections')}\n {filteredConnections.length > 0 && (\n <span className=\"ml-2 text-sm font-normal text-text-secondary tabular-nums\">\n ({filteredConnections.length})\n </span>\n )}\n </h2>\n </div>\n {canCreate && filteredConnections.length > 0 && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => openAddConnectionDialog()}>\n <Plus size={14} /> {tr('integrations.connections.actions.add', 'Add')}\n </Button>\n )}\n </div>\n\n {filteredConnections.length > 0 ? (\n <div\n className={cn(\n 'p-5',\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {filteredConnections.map((conn: IntegrationConnection) => (\n <ConnectionCard\n key={conn.id}\n connection={conn}\n displayMode={viewMode}\n onClick={handleConnectionClick}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={\n hasActiveFilters\n ? tr('integrations.connections.empty.filteredTitle', 'No matching connections')\n : tr('integrations.connections.empty.title', 'No connections yet')\n }\n description={\n hasActiveFilters\n ? tr(\n 'integrations.connections.empty.filteredDescription',\n 'Try adjusting your search or filters.'\n )\n : canCreate\n ? tr(\n 'integrations.connections.empty.description',\n 'Add a connection to start integrating with external services.'\n )\n : tr(\n 'integrations.connections.empty.readOnlyDescription',\n 'No connections are configured yet. Contact your workspace admin to add one.'\n )\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} />{' '}\n {tr('integrations.connections.empty.clearFilters', 'Clear Filters')}\n </Button>\n ) : canCreate ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={14} />{' '}\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n </EmphasisPanel>\n )}\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,IAAkB;CAChC,IAAM,EAAE,cAAW,KAAK,aAAU,0BAAuB,GAAiB,EACpE,IAAK,GAAO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E,IACI,EAAG,gDAAgD,0BAA0B,GAC7E,EAAG,wCAAwC,qBAAqB;KAEtE,aACE,IACI,EACE,sDACA,wCACD,GACD,IACE,EACE,8CACA,gEACD,GACD,EACE,sDACA,8EACD;KAET,QACE,IACE,kBAAC,GAAD;MAAQ,SAAQ;MAAU,SAAS;gBAAnC;OACE,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA;OAAC;OACf,EAAG,+CAA+C,gBAAgB;OAC5D;UACP,IACF,kBAAC,GAAD;MAAQ,eAAe,GAAyB;gBAAhD;OACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;OAAC;OAClB,EAAG,kDAAkD,iBAAiB;OAChE;UACP,KAAA;KAEN,CAAA,CAEU;;GAGlB,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACzB,QAAS;;IAEX,CAAA;GACE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,QAAQ,G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,uCAAuC;AACvC,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,oBAAoB,GACpB,eAAe,GACf,KAAK,GACL,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,IAAI,GACJ,SAAS,GACT,QAAQ,GACR,IAAI,GACJ,OAAO,GACP,UAAU,GACV,cAAc,GACd,OAAO,CAAC;AAEZ,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,cAAc,GACd,iBAAiB,GACjB,qBAAqB,GACrB,QAAQ,CAAC;AAEb,wBAAwB;AACxB,MAAM,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAED,oCAAoC;AACpC,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,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