@burdenoff/microfe-integrations 2026.1117.2 → 2026.1118.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/generated/global-types.d.ts +398 -121
- package/dist/generated/wspace-operations.d.ts +727 -0
- package/dist/generated/wspace-operations.js +453 -174
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +3838 -130
- package/dist/generated/wspace-types.js +28 -10
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/integrations/ConnectSourceDialog.js +30 -21
- package/dist/integrations/ConnectSourceDialog.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.js +32 -27
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/connected-apps/components/ActivitySections.d.ts +31 -0
- package/dist/integrations/connected-apps/components/ActivitySections.js +147 -0
- package/dist/integrations/connected-apps/components/ActivitySections.js.map +1 -0
- package/dist/integrations/connected-apps/components/AppItems.d.ts +26 -0
- package/dist/integrations/connected-apps/components/AppItems.js +171 -0
- package/dist/integrations/connected-apps/components/AppItems.js.map +1 -0
- package/dist/integrations/connected-apps/components/AppPanels.d.ts +48 -0
- package/dist/integrations/connected-apps/components/AppPanels.js +244 -0
- package/dist/integrations/connected-apps/components/AppPanels.js.map +1 -0
- package/dist/integrations/connected-apps/components/AppsSections.d.ts +30 -0
- package/dist/integrations/connected-apps/components/AppsSections.js +133 -0
- package/dist/integrations/connected-apps/components/AppsSections.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionActionDialogs.d.ts +30 -0
- package/dist/integrations/connected-apps/components/ConnectionActionDialogs.js +200 -0
- package/dist/integrations/connected-apps/components/ConnectionActionDialogs.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionActions.d.ts +38 -0
- package/dist/integrations/connected-apps/components/ConnectionActions.js +162 -0
- package/dist/integrations/connected-apps/components/ConnectionActions.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionHealth.d.ts +19 -0
- package/dist/integrations/connected-apps/components/ConnectionHealth.js +136 -0
- package/dist/integrations/connected-apps/components/ConnectionHealth.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionItems.d.ts +38 -0
- package/dist/integrations/connected-apps/components/ConnectionItems.js +358 -0
- package/dist/integrations/connected-apps/components/ConnectionItems.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionPanels.d.ts +37 -0
- package/dist/integrations/connected-apps/components/ConnectionPanels.js +248 -0
- package/dist/integrations/connected-apps/components/ConnectionPanels.js.map +1 -0
- package/dist/integrations/connected-apps/components/ConnectionsSections.d.ts +44 -0
- package/dist/integrations/connected-apps/components/ConnectionsSections.js +222 -0
- package/dist/integrations/connected-apps/components/ConnectionsSections.js.map +1 -0
- package/dist/integrations/connected-apps/components/Explainer.d.ts +3 -0
- package/dist/integrations/connected-apps/components/Explainer.js +56 -0
- package/dist/integrations/connected-apps/components/Explainer.js.map +1 -0
- package/dist/integrations/connected-apps/components/ListOrigin.d.ts +21 -0
- package/dist/integrations/connected-apps/components/ListOrigin.js +35 -0
- package/dist/integrations/connected-apps/components/ListOrigin.js.map +1 -0
- package/dist/integrations/connected-apps/components/Notices.d.ts +9 -0
- package/dist/integrations/connected-apps/components/Notices.js +71 -0
- package/dist/integrations/connected-apps/components/Notices.js.map +1 -0
- package/dist/integrations/connected-apps/components/PageFrame.d.ts +27 -0
- package/dist/integrations/connected-apps/components/PageFrame.js +55 -0
- package/dist/integrations/connected-apps/components/PageFrame.js.map +1 -0
- package/dist/integrations/connected-apps/components/Panels.d.ts +28 -0
- package/dist/integrations/connected-apps/components/Panels.js +50 -0
- package/dist/integrations/connected-apps/components/Panels.js.map +1 -0
- package/dist/integrations/connected-apps/components/Results.d.ts +50 -0
- package/dist/integrations/connected-apps/components/Results.js +129 -0
- package/dist/integrations/connected-apps/components/Results.js.map +1 -0
- package/dist/integrations/connected-apps/components/SearchPicker.d.ts +20 -0
- package/dist/integrations/connected-apps/components/SearchPicker.js +139 -0
- package/dist/integrations/connected-apps/components/SearchPicker.js.map +1 -0
- package/dist/integrations/connected-apps/components/StatusChip.d.ts +11 -0
- package/dist/integrations/connected-apps/components/StatusChip.js +40 -0
- package/dist/integrations/connected-apps/components/StatusChip.js.map +1 -0
- package/dist/integrations/connected-apps/components/Toolbar.d.ts +74 -0
- package/dist/integrations/connected-apps/components/Toolbar.js +216 -0
- package/dist/integrations/connected-apps/components/Toolbar.js.map +1 -0
- package/dist/integrations/connected-apps/components/styles.d.ts +12 -0
- package/dist/integrations/connected-apps/components/styles.js +15 -0
- package/dist/integrations/connected-apps/components/styles.js.map +1 -0
- package/dist/integrations/connected-apps/connect/AppPicker.d.ts +7 -0
- package/dist/integrations/connected-apps/connect/AppPicker.js +257 -0
- package/dist/integrations/connected-apps/connect/AppPicker.js.map +1 -0
- package/dist/integrations/connected-apps/connect/ConnectAppDialog.d.ts +18 -0
- package/dist/integrations/connected-apps/connect/ConnectAppDialog.js +224 -0
- package/dist/integrations/connected-apps/connect/ConnectAppDialog.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/useCanCreateConnection.d.ts +1 -0
- package/dist/integrations/connected-apps/hooks/useCanCreateConnection.js +10 -0
- package/dist/integrations/connected-apps/hooks/useCanCreateConnection.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/useConnectedAppsData.d.ts +372 -0
- package/dist/integrations/connected-apps/hooks/useConnectedAppsData.js +311 -0
- package/dist/integrations/connected-apps/hooks/useConnectedAppsData.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/useListState.d.ts +21 -0
- package/dist/integrations/connected-apps/hooks/useListState.js +43 -0
- package/dist/integrations/connected-apps/hooks/useListState.js.map +1 -0
- package/dist/integrations/connected-apps/hooks/usePageChrome.d.ts +12 -0
- package/dist/integrations/connected-apps/hooks/usePageChrome.js +46 -0
- package/dist/integrations/connected-apps/hooks/usePageChrome.js.map +1 -0
- package/dist/integrations/connected-apps/model/activity.d.ts +26 -0
- package/dist/integrations/connected-apps/model/activity.js +79 -0
- package/dist/integrations/connected-apps/model/activity.js.map +1 -0
- package/dist/integrations/connected-apps/model/apps.d.ts +68 -0
- package/dist/integrations/connected-apps/model/apps.js +101 -0
- package/dist/integrations/connected-apps/model/apps.js.map +1 -0
- package/dist/integrations/connected-apps/model/connections.d.ts +58 -0
- package/dist/integrations/connected-apps/model/connections.js +55 -0
- package/dist/integrations/connected-apps/model/connections.js.map +1 -0
- package/dist/integrations/connected-apps/model/health.d.ts +30 -0
- package/dist/integrations/connected-apps/model/health.js +54 -0
- package/dist/integrations/connected-apps/model/health.js.map +1 -0
- package/dist/integrations/connected-apps/model/queries.d.ts +56 -0
- package/dist/integrations/connected-apps/model/queries.js +117 -0
- package/dist/integrations/connected-apps/model/queries.js.map +1 -0
- package/dist/integrations/connected-apps/model/status.d.ts +36 -0
- package/dist/integrations/connected-apps/model/status.js +73 -0
- package/dist/integrations/connected-apps/model/status.js.map +1 -0
- package/dist/integrations/connected-apps/model/translate.d.ts +2 -0
- package/dist/integrations/connected-apps/model/urlState.d.ts +52 -0
- package/dist/integrations/connected-apps/model/urlState.js +87 -0
- package/dist/integrations/connected-apps/model/urlState.js.map +1 -0
- package/dist/integrations/connected-apps/pages/ActivityPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/ActivityPage.js +261 -0
- package/dist/integrations/connected-apps/pages/ActivityPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/AppDetailsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/AppDetailsPage.js +163 -0
- package/dist/integrations/connected-apps/pages/AppDetailsPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/AppsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/AppsPage.js +209 -0
- package/dist/integrations/connected-apps/pages/AppsPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionDetailsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionDetailsPage.js +240 -0
- package/dist/integrations/connected-apps/pages/ConnectionDetailsPage.js.map +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionsPage.d.ts +1 -0
- package/dist/integrations/connected-apps/pages/ConnectionsPage.js +254 -0
- package/dist/integrations/connected-apps/pages/ConnectionsPage.js.map +1 -0
- package/dist/integrations/providers/IntegrationsProvider.js +22 -21
- package/dist/integrations/providers/IntegrationsProvider.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +426 -0
- package/dist/integrations/types/index.d.ts +9 -0
- package/package.json +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionActions.js","names":["ConnectionActionsContext","createContext","useConnectionActions","value","use","ConnectionActionsProvider","tr","useTr","notify","useNotify","client","useApolloClient","can","useConnectionPermissions","useTestConnection","useRefreshToken","deleting","useDeleteConnection","busyId","setBusyId","useState","dialog","setDialog","refetchLists","useCallback","QUERIES_AFTER_CHANGE","test","connection","result","testConnection","outcome","onTested","error","refresh","refreshToken","isRefreshed","confirmRemove","deleteConnection","alsoVault","nativeNotify","onRemoved","remove","native","nativeConfirm","useMemo","close","children","ActionDialogs","permissionsLoading","usePermissions","canRefreshFlag","useFeatureFlag","INTEGRATION_FEATURE_FLAGS","permitted","hasPermission","permission","update","INTEGRATION_PERMISSIONS","del","signIn","flowOf","canTestStatus","canReconnectStatus","canManageSharing","ConnectionStatus"],"sources":["../../../../src/integrations/connected-apps/components/ConnectionActions.tsx"],"sourcesContent":["/**\n * Everything a person can do to one connection, from its row or its page\n * (BOFF-15373): Test, Reconnect, Rename, Share, Refresh token, Disconnect and\n * Remove. One provider per page renders the dialogs these open, so a row's ⋯\n * menu and the connection page offer the same actions with the same checks.\n *\n * Today's rules are kept: the role's permissions decide what shows (the\n * service enforces them again), sharing also needs owner, editor or admin\n * access to that connection, Refresh token is for sign-in connections behind\n * its feature flag, and Remove can also delete the key the connection kept in\n * a vault. \"Turn off\" has no API yet, so it is not offered.\n */\nimport { createContext, use, useCallback, useMemo, useState, type ReactNode } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { canManageSharing } from '@burdenoff/fe-libs/connections';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { ConnectionStatus } from '../../../generated/wspace-types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../utils/nativeBridge';\nimport { INTEGRATION_FEATURE_FLAGS } from '../../constants/featureFlags';\nimport { INTEGRATION_PERMISSIONS } from '../../constants/permissions';\nimport {\n useDeleteConnection,\n useRefreshToken,\n useTestConnection,\n} from '../../hooks/useConnections';\nimport { useTr } from '../../hooks/useTr';\nimport type { ConnectionAccess as UiConnectionAccess } from '../../types';\nimport { isRefreshed } from '../../utils/connectedApps';\nimport { flowOf, QUERIES_AFTER_CHANGE, type ActionableConnection } from '../model/connections';\nimport { canReconnectStatus, canTestStatus } from '../model/status';\nimport { ActionDialogs, type OpenDialog } from './ConnectionActionDialogs';\nimport { useNotify } from './Notices';\n\nexport interface TestOutcome {\n success: boolean;\n message: string;\n latencyMs: number | null;\n}\n\nexport interface ConnectionActionsValue {\n /** What this person may do to `connection`. */\n can: (connection: ActionableConnection) => {\n test: boolean;\n reconnect: boolean;\n rename: boolean;\n share: boolean;\n refresh: boolean;\n disconnect: boolean;\n remove: boolean;\n };\n /** The id of the connection an action is running on, if any. */\n busyId: string | null;\n test: (connection: ActionableConnection) => Promise<TestOutcome | null>;\n refresh: (connection: ActionableConnection) => Promise<void>;\n reconnect: (connection: ActionableConnection) => void;\n rename: (connection: ActionableConnection) => void;\n share: (connection: ActionableConnection) => void;\n disconnect: (connection: ActionableConnection) => void;\n remove: (connection: ActionableConnection) => void;\n}\n\nconst ConnectionActionsContext = createContext<ConnectionActionsValue | null>(null);\n\nexport function useConnectionActions(): ConnectionActionsValue {\n const value = use(ConnectionActionsContext);\n if (!value) throw new Error('useConnectionActions must be used within ConnectionActionsProvider');\n return value;\n}\n\ninterface ConnectionActionsProviderProps {\n children: ReactNode;\n /** After a connection is removed (the details page leaves). */\n onRemoved?: (connection: ActionableConnection) => void;\n /** After a test, with its result (the details page shows it in place). */\n onTested?: (connection: ActionableConnection, outcome: TestOutcome) => void;\n}\n\nexport function ConnectionActionsProvider({\n children,\n onRemoved,\n onTested,\n}: ConnectionActionsProviderProps) {\n const tr = useTr();\n const notify = useNotify();\n const client = useApolloClient();\n const can = useConnectionPermissions();\n const { testConnection } = useTestConnection();\n const { refreshToken } = useRefreshToken();\n const { deleteConnection, loading: deleting } = useDeleteConnection();\n const [busyId, setBusyId] = useState<string | null>(null);\n const [dialog, setDialog] = useState<OpenDialog | null>(null);\n\n const refetchLists = useCallback(() => {\n void client.refetchQueries({ include: QUERIES_AFTER_CHANGE });\n }, [client]);\n\n const test = useCallback<ConnectionActionsValue['test']>(\n async (connection) => {\n setBusyId(connection.id);\n try {\n const result = await testConnection(connection.id);\n if (!result)\n throw new Error(\n tr('integrations.connectedApps.testing.noAnswer', 'The test did not answer.')\n );\n const outcome: TestOutcome = {\n success: result.success,\n message: result.message,\n latencyMs: typeof result.latencyMs === 'number' ? result.latencyMs : null,\n };\n notify(\n outcome.success ? 'success' : 'error',\n outcome.success\n ? tr('integrations.connectedApps.testing.passedNamed', '{{name}}: test passed', {\n name: connection.name,\n })\n : tr(\n 'integrations.connectedApps.testing.failedNamed',\n '{{name}}: test failed. {{message}}',\n {\n name: connection.name,\n message: outcome.message,\n }\n )\n );\n onTested?.(connection, outcome);\n refetchLists();\n return outcome;\n } catch (error) {\n notify('error', error instanceof Error ? error.message : String(error));\n return null;\n } finally {\n setBusyId(null);\n }\n },\n [testConnection, notify, tr, onTested, refetchLists]\n );\n\n const refresh = useCallback<ConnectionActionsValue['refresh']>(\n async (connection) => {\n setBusyId(connection.id);\n try {\n const result = await refreshToken(connection.id);\n if (isRefreshed(result)) {\n notify(\n 'success',\n tr(\n 'integrations.connectionDetail.notifications.refreshSuccess',\n 'Token refreshed successfully'\n )\n );\n } else {\n notify(\n 'error',\n tr(\n 'integrations.connectionDetail.notifications.refreshFailed',\n 'The token could not be refreshed. Reconnect to sign in again.'\n )\n );\n }\n } catch (error) {\n notify(\n 'error',\n error instanceof Error\n ? error.message\n : tr(\n 'integrations.connectionDetail.notifications.refreshFailed',\n 'The token could not be refreshed. Reconnect to sign in again.'\n )\n );\n } finally {\n setBusyId(null);\n refetchLists();\n }\n },\n [refreshToken, notify, tr, refetchLists]\n );\n\n const confirmRemove = useCallback(\n async (connection: ActionableConnection, alsoVault: boolean) => {\n setBusyId(connection.id);\n try {\n await deleteConnection(connection.id, alsoVault);\n notify(\n 'success',\n tr('integrations.connectedApps.removeDialog.done', '{{name}} was removed', {\n name: connection.name,\n })\n );\n void nativeNotify('success');\n setDialog(null);\n refetchLists();\n onRemoved?.(connection);\n } catch (error) {\n notify(\n 'error',\n error instanceof Error\n ? error.message\n : tr(\n 'integrations.connectedApps.removeDialog.failed',\n 'The connection could not be removed.'\n )\n );\n void nativeNotify('error');\n } finally {\n setBusyId(null);\n }\n },\n [deleteConnection, notify, tr, refetchLists, onRemoved]\n );\n\n const remove = useCallback<ConnectionActionsValue['remove']>(\n (connection) => {\n void (async () => {\n void nativeImpact('medium');\n // The installed apps confirm natively; the web (null) opens the dialog,\n // which also offers deleting the key kept in a vault.\n const native = await nativeConfirm({\n title: tr('integrations.connectedApps.removeDialog.title', 'Remove {{name}}?', {\n name: connection.name,\n }),\n message: tr(\n 'integrations.connectedApps.removeMessage',\n 'Remove {{name}}? Workflows that use it stop working until you connect {{provider}} again.',\n { name: connection.name, provider: connection.provider.name }\n ),\n okButtonTitle: tr('integrations.connectedApps.remove', 'Remove'),\n cancelButtonTitle: tr('integrations.connectedApps.actions.cancel', 'Cancel'),\n });\n if (native === null) setDialog({ kind: 'remove', connection });\n else if (native) await confirmRemove(connection, false);\n })();\n },\n [tr, confirmRemove]\n );\n\n const value = useMemo<ConnectionActionsValue>(\n () => ({\n can,\n busyId,\n test,\n refresh,\n reconnect: (connection) => setDialog({ kind: 'reconnect', connection }),\n rename: (connection) => setDialog({ kind: 'rename', connection }),\n share: (connection) => setDialog({ kind: 'share', connection }),\n disconnect: (connection) => setDialog({ kind: 'disconnect', connection }),\n remove,\n }),\n [can, busyId, test, refresh, remove]\n );\n\n const close = useCallback(() => setDialog(null), []);\n\n return (\n <ConnectionActionsContext.Provider value={value}>\n {children}\n <ActionDialogs\n dialog={dialog}\n onClose={close}\n onChanged={refetchLists}\n onBusy={setBusyId}\n removing={deleting}\n onRemove={(connection, alsoVault) => void confirmRemove(connection, alsoVault)}\n />\n </ConnectionActionsContext.Provider>\n );\n}\n\n/**\n * What the person's role allows on a connection (the service checks again).\n * Sharing also needs owner, editor or admin access to that connection, and\n * Refresh token is for sign-in connections behind its feature flag.\n */\nfunction useConnectionPermissions(): ConnectionActionsValue['can'] {\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canRefreshFlag = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.OAUTH_REFRESH, true);\n return useCallback<ConnectionActionsValue['can']>(\n (connection) => {\n const permitted = (permission: string) => !permissionsLoading && hasPermission(permission);\n const update = permitted(INTEGRATION_PERMISSIONS.CONNECTION_UPDATE);\n const del = permitted(INTEGRATION_PERMISSIONS.CONNECTION_DELETE);\n // The connection's own way of signing in, which can differ from the app's default.\n const signIn = flowOf(connection) === 'oauth';\n return {\n test: canTestStatus(connection.status),\n reconnect:\n permitted(INTEGRATION_PERMISSIONS.CONNECTION_CREATE) &&\n canReconnectStatus(connection.status),\n rename: update,\n share:\n permitted(INTEGRATION_PERMISSIONS.CONNECTION_SHARE) &&\n // The generated enum and fe-libs' union are the same strings\n // (OWNER, EDITOR, …); TypeScript won't equate an enum with literals.\n canManageSharing((connection.myAccess as UiConnectionAccess | null) ?? null),\n refresh: update && signIn && canRefreshFlag,\n disconnect:\n del &&\n connection.status !== ConnectionStatus.Revoked &&\n connection.status !== ConnectionStatus.PendingAuth,\n remove: del,\n };\n },\n [permissionsLoading, hasPermission, canRefreshFlag]\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AAUI,EAAwB,iBAAiB,KACnDK,EAAmBnC,EAAW,MAAM;GACtC,QAAQ6B;GACR,OACEH,EAAUI,EAAwB,gBAAgB,KAGlDM,EAAkBpC,EAAW,YAA0C,IAAI;GAC7E,SAAS6B,KAAUG,KAAUT;GAC7B,YACEQ,KACA/B,EAAW,WAAWqC,EAAiB,WACvCrC,EAAW,WAAWqC,EAAiB;GACzC,QAAQN;EACV;CACF,GACA;EAACV;EAAoBM;EAAeJ;CAAc,CACpD;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HealthSubject } from '../model/health';
|
|
2
|
+
import { TestOutcome } from './ConnectionActions';
|
|
3
|
+
interface HealthBlockProps {
|
|
4
|
+
connection: HealthSubject & {
|
|
5
|
+
lastHealthCheck: string | null;
|
|
6
|
+
};
|
|
7
|
+
/** The last test's result on this page, if one ran. */
|
|
8
|
+
test: TestOutcome | null;
|
|
9
|
+
/** This connection's activity. */
|
|
10
|
+
logsPath: string;
|
|
11
|
+
/** Null when the connection can't be tested. */
|
|
12
|
+
onTest: (() => void) | null;
|
|
13
|
+
/** Null when the person may not remove it. */
|
|
14
|
+
onRemove: (() => void) | null;
|
|
15
|
+
/** A test or another action is running. */
|
|
16
|
+
busy: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function HealthBlock({ connection, test, logsPath, onTest, onRemove, busy, }: HealthBlockProps): import('react').JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { useFormatLastUsed as e } from "../../hooks/useFormatLastUsed.js";
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { cn as n } from "../../utils/cn.js";
|
|
4
|
+
import { healthOf as r } from "../model/health.js";
|
|
5
|
+
import { AlertCircle as i, AlertTriangle as a, CheckCircle2 as o, Clock as s, Link2Off as c, Power as l, XCircle as u, Zap as d } from "lucide-react";
|
|
6
|
+
import { Link as f } from "react-router";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { Button as h } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
// src/integrations/connected-apps/components/ConnectionHealth.tsx
|
|
10
|
+
var g = {
|
|
11
|
+
working: o,
|
|
12
|
+
error: i,
|
|
13
|
+
expired: a,
|
|
14
|
+
pending: s,
|
|
15
|
+
off: l,
|
|
16
|
+
revoked: c
|
|
17
|
+
}, _ = {
|
|
18
|
+
success: "border-status-success-border bg-status-success-bg-subtle",
|
|
19
|
+
danger: "border-status-error-border bg-status-error-bg-subtle",
|
|
20
|
+
warning: "border-status-warning-border bg-status-warning-bg-subtle",
|
|
21
|
+
neutral: "border-border-subtle bg-bg-sunken"
|
|
22
|
+
}, v = {
|
|
23
|
+
success: "text-status-success-text",
|
|
24
|
+
danger: "text-status-error-text",
|
|
25
|
+
warning: "text-status-warning-text",
|
|
26
|
+
neutral: "text-text-secondary"
|
|
27
|
+
}, y = {
|
|
28
|
+
success: "text-status-success-text",
|
|
29
|
+
danger: "text-status-error-text",
|
|
30
|
+
warning: "text-status-warning-text",
|
|
31
|
+
neutral: "text-text-primary"
|
|
32
|
+
};
|
|
33
|
+
function b({ connection: n, test: i, logsPath: a, onTest: o, onRemove: s, busy: c }) {
|
|
34
|
+
let l = t(), u = e();
|
|
35
|
+
if (i) return /* @__PURE__ */ p(x, {
|
|
36
|
+
test: i,
|
|
37
|
+
onTest: o,
|
|
38
|
+
busy: c
|
|
39
|
+
});
|
|
40
|
+
let _ = n.lastHealthCheck ? l("integrations.connectedApps.health.checked", "Checked {{time}}.", { time: u(n.lastHealthCheck) }) : "", v = r(l, n, _), y = g[v.icon], b = v.action === "test" && o ? /* @__PURE__ */ m(h, {
|
|
41
|
+
size: "sm",
|
|
42
|
+
variant: "outline",
|
|
43
|
+
onClick: o,
|
|
44
|
+
disabled: c,
|
|
45
|
+
children: [/* @__PURE__ */ p(d, {
|
|
46
|
+
className: "size-4",
|
|
47
|
+
"aria-hidden": "true"
|
|
48
|
+
}), l("integrations.connectedApps.health.testNow", "Test now")]
|
|
49
|
+
}) : v.action === "activity" ? /* @__PURE__ */ p(h, {
|
|
50
|
+
size: "sm",
|
|
51
|
+
variant: "outline",
|
|
52
|
+
asChild: !0,
|
|
53
|
+
children: /* @__PURE__ */ p(f, {
|
|
54
|
+
to: a,
|
|
55
|
+
children: l("integrations.connectedApps.health.viewActivity", "View activity")
|
|
56
|
+
})
|
|
57
|
+
}) : v.action === "remove" && s ? /* @__PURE__ */ p(h, {
|
|
58
|
+
size: "sm",
|
|
59
|
+
variant: "outline",
|
|
60
|
+
onClick: s,
|
|
61
|
+
children: l("integrations.connectedApps.remove", "Remove")
|
|
62
|
+
}) : null;
|
|
63
|
+
return /* @__PURE__ */ p(S, {
|
|
64
|
+
tone: v.tone,
|
|
65
|
+
icon: /* @__PURE__ */ p(y, {
|
|
66
|
+
className: "size-5",
|
|
67
|
+
"aria-hidden": "true"
|
|
68
|
+
}),
|
|
69
|
+
title: v.title,
|
|
70
|
+
text: v.text,
|
|
71
|
+
role: v.role,
|
|
72
|
+
action: b
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function x({ test: e, onTest: n, busy: r }) {
|
|
76
|
+
let i = t();
|
|
77
|
+
return e.success ? /* @__PURE__ */ p(S, {
|
|
78
|
+
tone: "success",
|
|
79
|
+
icon: /* @__PURE__ */ p(o, {
|
|
80
|
+
className: "size-5",
|
|
81
|
+
"aria-hidden": "true"
|
|
82
|
+
}),
|
|
83
|
+
title: e.latencyMs === null ? i("integrations.connectedApps.testing.passed", "Test passed") : i("integrations.connectedApps.testing.passedIn", "Test passed in {{ms}} ms", { ms: e.latencyMs }),
|
|
84
|
+
text: e.message,
|
|
85
|
+
role: "status",
|
|
86
|
+
action: n ? /* @__PURE__ */ m(h, {
|
|
87
|
+
size: "sm",
|
|
88
|
+
variant: "outline",
|
|
89
|
+
onClick: n,
|
|
90
|
+
disabled: r,
|
|
91
|
+
children: [/* @__PURE__ */ p(d, {
|
|
92
|
+
className: "size-4",
|
|
93
|
+
"aria-hidden": "true"
|
|
94
|
+
}), i("integrations.connectedApps.health.testAgain", "Test again")]
|
|
95
|
+
}) : null
|
|
96
|
+
}) : /* @__PURE__ */ p(S, {
|
|
97
|
+
tone: "danger",
|
|
98
|
+
icon: /* @__PURE__ */ p(u, {
|
|
99
|
+
className: "size-5",
|
|
100
|
+
"aria-hidden": "true"
|
|
101
|
+
}),
|
|
102
|
+
title: i("integrations.connectedApps.testing.failed", "Test failed"),
|
|
103
|
+
text: e.message,
|
|
104
|
+
role: "alert"
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function S({ tone: e, icon: t, title: r, text: i, action: a, role: o }) {
|
|
108
|
+
return /* @__PURE__ */ m("div", {
|
|
109
|
+
role: o,
|
|
110
|
+
className: n("flex flex-col gap-3 rounded-xl border p-4 sm:flex-row sm:items-center", _[e]),
|
|
111
|
+
"data-testid": "connection-health",
|
|
112
|
+
"data-tone": e,
|
|
113
|
+
children: [/* @__PURE__ */ m("div", {
|
|
114
|
+
className: "flex min-w-0 flex-1 items-start gap-3",
|
|
115
|
+
children: [/* @__PURE__ */ p("span", {
|
|
116
|
+
className: n("mt-0.5 shrink-0", v[e]),
|
|
117
|
+
children: t
|
|
118
|
+
}), /* @__PURE__ */ m("div", {
|
|
119
|
+
className: "min-w-0",
|
|
120
|
+
children: [/* @__PURE__ */ p("p", {
|
|
121
|
+
className: n("font-semibold", y[e]),
|
|
122
|
+
children: r
|
|
123
|
+
}), i && /* @__PURE__ */ p("p", {
|
|
124
|
+
className: "break-words text-sm text-text-secondary",
|
|
125
|
+
children: i
|
|
126
|
+
})]
|
|
127
|
+
})]
|
|
128
|
+
}), a && /* @__PURE__ */ p("div", {
|
|
129
|
+
className: "flex shrink-0 flex-wrap items-center gap-2",
|
|
130
|
+
children: a
|
|
131
|
+
})]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
export { b as HealthBlock };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=ConnectionHealth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionHealth.js","names":["Link","Link$1","HEALTH_ICONS","CheckCircle2","AlertCircle","AlertTriangle","Clock","Power","Link2Off","TONE_BLOCK","TONE_ICON","TONE_TITLE","HealthBlock","tr","useTr","formatLastUsed","useFormatLastUsed","test","TestResult","checked","connection","health","healthOf","Icon","action","onTest","Button","busy","Zap","logsPath","onRemove","Alert","XCircle","cn","tone","icon","title","text"],"sources":["../../../../src/integrations/connected-apps/components/ConnectionHealth.tsx"],"sourcesContent":["/**\n * A connection's health, one block under its header (BOFF-15373). The status\n * decides the colour and words (model/health); a test, once run, takes its\n * place with the result.\n */\nimport type { ReactNode } from 'react';\nimport { Link } from 'react-router';\nimport {\n AlertCircle,\n AlertTriangle,\n CheckCircle2,\n Clock,\n Link2Off,\n Power,\n XCircle,\n Zap,\n} from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nimport { useFormatLastUsed } from '../../hooks/useFormatLastUsed';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\nimport { healthOf, type HealthIcon, type HealthSubject, type HealthTone } from '../model/health';\nimport type { TestOutcome } from './ConnectionActions';\n\nconst HEALTH_ICONS: Record<HealthIcon, typeof Zap> = {\n working: CheckCircle2,\n error: AlertCircle,\n expired: AlertTriangle,\n pending: Clock,\n off: Power,\n revoked: Link2Off,\n};\n\nconst TONE_BLOCK: Record<HealthTone, string> = {\n success: 'border-status-success-border bg-status-success-bg-subtle',\n danger: 'border-status-error-border bg-status-error-bg-subtle',\n warning: 'border-status-warning-border bg-status-warning-bg-subtle',\n neutral: 'border-border-subtle bg-bg-sunken',\n};\n\nconst TONE_ICON: Record<HealthTone, string> = {\n success: 'text-status-success-text',\n danger: 'text-status-error-text',\n warning: 'text-status-warning-text',\n neutral: 'text-text-secondary',\n};\n\nconst TONE_TITLE: Record<HealthTone, string> = {\n success: 'text-status-success-text',\n danger: 'text-status-error-text',\n warning: 'text-status-warning-text',\n neutral: 'text-text-primary',\n};\n\ninterface HealthBlockProps {\n connection: HealthSubject & { lastHealthCheck: string | null };\n /** The last test's result on this page, if one ran. */\n test: TestOutcome | null;\n /** This connection's activity. */\n logsPath: string;\n /** Null when the connection can't be tested. */\n onTest: (() => void) | null;\n /** Null when the person may not remove it. */\n onRemove: (() => void) | null;\n /** A test or another action is running. */\n busy: boolean;\n}\n\nexport function HealthBlock({\n connection,\n test,\n logsPath,\n onTest,\n onRemove,\n busy,\n}: HealthBlockProps) {\n const tr = useTr();\n const formatLastUsed = useFormatLastUsed();\n if (test) return <TestResult test={test} onTest={onTest} busy={busy} />;\n\n const checked = connection.lastHealthCheck\n ? tr('integrations.connectedApps.health.checked', 'Checked {{time}}.', {\n time: formatLastUsed(connection.lastHealthCheck),\n })\n : '';\n const health = healthOf(tr, connection, checked);\n const Icon = HEALTH_ICONS[health.icon];\n const action =\n health.action === 'test' && onTest ? (\n <Button size=\"sm\" variant=\"outline\" onClick={onTest} disabled={busy}>\n <Zap className=\"size-4\" aria-hidden=\"true\" />\n {tr('integrations.connectedApps.health.testNow', 'Test now')}\n </Button>\n ) : health.action === 'activity' ? (\n <Button size=\"sm\" variant=\"outline\" asChild>\n <Link to={logsPath}>\n {tr('integrations.connectedApps.health.viewActivity', 'View activity')}\n </Link>\n </Button>\n ) : health.action === 'remove' && onRemove ? (\n <Button size=\"sm\" variant=\"outline\" onClick={onRemove}>\n {tr('integrations.connectedApps.remove', 'Remove')}\n </Button>\n ) : null;\n\n return (\n <Alert\n tone={health.tone}\n icon={<Icon className=\"size-5\" aria-hidden=\"true\" />}\n title={health.title}\n text={health.text}\n role={health.role}\n action={action}\n />\n );\n}\n\nfunction TestResult({\n test,\n onTest,\n busy,\n}: {\n test: TestOutcome;\n onTest: (() => void) | null;\n busy: boolean;\n}) {\n const tr = useTr();\n if (!test.success) {\n return (\n <Alert\n tone=\"danger\"\n icon={<XCircle className=\"size-5\" aria-hidden=\"true\" />}\n title={tr('integrations.connectedApps.testing.failed', 'Test failed')}\n text={test.message}\n role=\"alert\"\n />\n );\n }\n return (\n <Alert\n tone=\"success\"\n icon={<CheckCircle2 className=\"size-5\" aria-hidden=\"true\" />}\n title={\n test.latencyMs !== null\n ? tr('integrations.connectedApps.testing.passedIn', 'Test passed in {{ms}} ms', {\n ms: test.latencyMs,\n })\n : tr('integrations.connectedApps.testing.passed', 'Test passed')\n }\n text={test.message}\n role=\"status\"\n action={\n onTest ? (\n <Button size=\"sm\" variant=\"outline\" onClick={onTest} disabled={busy}>\n <Zap className=\"size-4\" aria-hidden=\"true\" />\n {tr('integrations.connectedApps.health.testAgain', 'Test again')}\n </Button>\n ) : null\n }\n />\n );\n}\n\nfunction Alert({\n tone,\n icon,\n title,\n text,\n action,\n role,\n}: {\n tone: HealthTone;\n icon: ReactNode;\n title: string;\n text: string;\n action?: ReactNode;\n role?: 'alert' | 'status';\n}) {\n return (\n <div\n role={role}\n className={cn(\n 'flex flex-col gap-3 rounded-xl border p-4 sm:flex-row sm:items-center',\n TONE_BLOCK[tone]\n )}\n data-testid=\"connection-health\"\n data-tone={tone}\n >\n <div className=\"flex min-w-0 flex-1 items-start gap-3\">\n <span className={cn('mt-0.5 shrink-0', TONE_ICON[tone])}>{icon}</span>\n <div className=\"min-w-0\">\n <p className={cn('font-semibold', TONE_TITLE[tone])}>{title}</p>\n {text && <p className=\"break-words text-sm text-text-secondary\">{text}</p>}\n </div>\n </div>\n {action && <div className=\"flex shrink-0 flex-wrap items-center gap-2\">{action}</div>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAyBA,IAAME,IAA+C;CACnD,SAASC;CACT,OAAOC;CACP,SAASC;CACT,SAASC;CACT,KAAKC;CACL,SAASC;AACX,GAEMC,IAAyC;CAC7C,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;AACX,GAEMC,IAAwC;CAC5C,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;AACX,GAEMC,IA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,38 @@
|
|
|
1
|
+
import { ConnectionVisibility } from '../../../generated/wspace-types';
|
|
2
|
+
import { ActionableConnection, ConnectionItem } from '../model/connections';
|
|
3
|
+
/** "Private" or "Workspace", with its icon. */
|
|
4
|
+
export declare function AccessLabel({ visibility }: {
|
|
5
|
+
visibility: ConnectionVisibility;
|
|
6
|
+
}): import('react').JSX.Element;
|
|
7
|
+
/** The ⋯ menu: every action this person may take on the connection. */
|
|
8
|
+
export declare function ConnectionMenu({ connection, openTo, onOpen, includeOpen, exclude, triggerClassName, }: {
|
|
9
|
+
connection: ActionableConnection;
|
|
10
|
+
openTo?: string;
|
|
11
|
+
onOpen?: () => void;
|
|
12
|
+
includeOpen?: boolean;
|
|
13
|
+
/** Actions the page already shows as buttons. */
|
|
14
|
+
exclude?: ReadonlyArray<'test' | 'share'>;
|
|
15
|
+
triggerClassName?: string;
|
|
16
|
+
}): import('react').JSX.Element;
|
|
17
|
+
interface ItemProps {
|
|
18
|
+
connection: ConnectionItem;
|
|
19
|
+
/** Where the name links to. */
|
|
20
|
+
to: string;
|
|
21
|
+
/** The host's `onConnectionSelect`, told when the connection is opened. */
|
|
22
|
+
onOpen?: () => void;
|
|
23
|
+
}
|
|
24
|
+
/** The list header over compact rows (from medium widths). */
|
|
25
|
+
export declare function ConnectionRowsHeader(): import('react').JSX.Element;
|
|
26
|
+
/** A compact row: status, account and the fix sit in fixed columns. */
|
|
27
|
+
export declare function ConnectionRow({ connection, to, onOpen }: ItemProps): import('react').JSX.Element;
|
|
28
|
+
/** A rich card, for the grid view. */
|
|
29
|
+
export declare function ConnectionCard({ connection, to, onOpen }: ItemProps): import('react').JSX.Element;
|
|
30
|
+
/** Rows' placeholder for the first load. */
|
|
31
|
+
export declare function ConnectionRowsSkeleton({ count }: {
|
|
32
|
+
count?: number;
|
|
33
|
+
}): import('react').JSX.Element;
|
|
34
|
+
/** Cards' placeholder for the first load. */
|
|
35
|
+
export declare function CardsSkeleton({ count }: {
|
|
36
|
+
count?: number;
|
|
37
|
+
}): import('react').JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { ConnectionStatus as e, ConnectionVisibility as t } from "../../../generated/wspace-types.js";
|
|
2
|
+
import { cn as n } from "../../utils/cn.js";
|
|
3
|
+
import { useFormatLastUsed as r } from "../../hooks/useFormatLastUsed.js";
|
|
4
|
+
import { useTr as i } from "../../hooks/useTr.js";
|
|
5
|
+
import { accountOf as a, flowOf as o, toActionable as s } from "../model/connections.js";
|
|
6
|
+
import { fixLabel as c, shortReason as l, statusTone as u } from "../model/status.js";
|
|
7
|
+
import { useConnectionActions as d } from "./ConnectionActions.js";
|
|
8
|
+
import { useOriginState as f } from "./ListOrigin.js";
|
|
9
|
+
import { ReasonLine as p, StatusChip as m } from "./StatusChip.js";
|
|
10
|
+
import { CARD_GRID_COLUMNS as h, CONTROL_RING as g } from "./styles.js";
|
|
11
|
+
import { Eye as _, Lock as v, MoreHorizontal as y, Pencil as b, RefreshCw as x, RotateCcw as S, Share2 as C, Trash2 as w, Unplug as T, Users as E, Zap as D } from "lucide-react";
|
|
12
|
+
import { Link as O } from "react-router";
|
|
13
|
+
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
14
|
+
import { ProviderIcon as M } from "@burdenoff/fe-libs/connections";
|
|
15
|
+
import { Button as N, DropdownMenu as P, DropdownMenuContent as F, DropdownMenuItem as I, DropdownMenuSeparator as L, DropdownMenuTrigger as R } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
// src/integrations/connected-apps/components/ConnectionItems.tsx
|
|
17
|
+
function z({ visibility: e }) {
|
|
18
|
+
let n = i();
|
|
19
|
+
return e === t.Restricted ? /* @__PURE__ */ j("span", {
|
|
20
|
+
className: "inline-flex items-center gap-1 whitespace-nowrap",
|
|
21
|
+
"data-testid": "connection-access",
|
|
22
|
+
children: [/* @__PURE__ */ A(v, {
|
|
23
|
+
className: "size-3.5",
|
|
24
|
+
"aria-hidden": "true"
|
|
25
|
+
}), n("integrations.connectedApps.access.private", "Private")]
|
|
26
|
+
}) : /* @__PURE__ */ j("span", {
|
|
27
|
+
className: "inline-flex items-center gap-1 whitespace-nowrap",
|
|
28
|
+
"data-testid": "connection-access",
|
|
29
|
+
children: [/* @__PURE__ */ A(E, {
|
|
30
|
+
className: "size-3.5",
|
|
31
|
+
"aria-hidden": "true"
|
|
32
|
+
}), n("integrations.connectedApps.access.workspace", "Workspace")]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var B = {
|
|
36
|
+
[e.Error]: "bg-status-error-bg-subtle/60 hover:bg-status-error-bg-subtle",
|
|
37
|
+
[e.Expired]: "bg-status-warning-bg-subtle/55 hover:bg-status-warning-bg-subtle"
|
|
38
|
+
}, V = {
|
|
39
|
+
[e.Error]: "border-status-error-border bg-status-error-bg-subtle/60",
|
|
40
|
+
[e.Expired]: "border-status-warning-border bg-status-warning-bg-subtle/55"
|
|
41
|
+
};
|
|
42
|
+
function H({ to: e, name: t, onOpen: r, className: i }) {
|
|
43
|
+
let a = f();
|
|
44
|
+
return /* @__PURE__ */ A(O, {
|
|
45
|
+
to: e,
|
|
46
|
+
state: a,
|
|
47
|
+
onClick: r,
|
|
48
|
+
className: n("outline-none after:absolute after:inset-0 after:rounded-[inherit] after:content-[\"\"] hover:underline focus-visible:after:ring-2 focus-visible:after:ring-accent-glow", i),
|
|
49
|
+
"data-testid": "connection-name-link",
|
|
50
|
+
children: t
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function U({ connection: e }) {
|
|
54
|
+
let t = i(), r = d();
|
|
55
|
+
if (!r.can(s(e)).reconnect) return null;
|
|
56
|
+
let a = u(e.status);
|
|
57
|
+
return /* @__PURE__ */ j(N, {
|
|
58
|
+
size: "sm",
|
|
59
|
+
variant: "outline",
|
|
60
|
+
onClick: () => r.reconnect(s(e)),
|
|
61
|
+
className: n("h-8 gap-1.5", a === "danger" && "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle hover:text-status-error-text", a === "warning" && "border-status-warning-border text-status-warning-text hover:bg-status-warning-bg-subtle hover:text-status-warning-text"),
|
|
62
|
+
"data-testid": "connection-fix",
|
|
63
|
+
children: [/* @__PURE__ */ A(S, {
|
|
64
|
+
className: "size-3.5",
|
|
65
|
+
"aria-hidden": "true"
|
|
66
|
+
}), c(t, {
|
|
67
|
+
status: e.status,
|
|
68
|
+
flow: o(e)
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function W({ connection: e, openTo: t, onOpen: r, includeOpen: a = !0, exclude: o = [], triggerClassName: s }) {
|
|
73
|
+
let c = i(), l = d(), u = f(), p = l.can(e), m = {
|
|
74
|
+
...p,
|
|
75
|
+
test: p.test && !o.includes("test"),
|
|
76
|
+
share: p.share && !o.includes("share")
|
|
77
|
+
}, h = l.busyId === e.id, v = (e, t, n, r) => /* @__PURE__ */ j(I, {
|
|
78
|
+
onSelect: r,
|
|
79
|
+
disabled: h,
|
|
80
|
+
className: "gap-2",
|
|
81
|
+
children: [t, n]
|
|
82
|
+
}, e);
|
|
83
|
+
return /* @__PURE__ */ j(P, { children: [/* @__PURE__ */ A(R, {
|
|
84
|
+
asChild: !0,
|
|
85
|
+
children: /* @__PURE__ */ A("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
"aria-label": c("integrations.connectedApps.menu.label", "Actions for {{name}}", { name: e.name }),
|
|
88
|
+
className: n("relative z-10 inline-flex size-8 items-center justify-center rounded-md text-text-secondary hover:bg-bg-sunken hover:text-text-primary", g, s),
|
|
89
|
+
"data-testid": "connection-menu",
|
|
90
|
+
children: /* @__PURE__ */ A(y, {
|
|
91
|
+
className: "size-4",
|
|
92
|
+
"aria-hidden": "true"
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
}), /* @__PURE__ */ j(F, {
|
|
96
|
+
align: "end",
|
|
97
|
+
className: "min-w-48",
|
|
98
|
+
children: [
|
|
99
|
+
a && t && /* @__PURE__ */ A(I, {
|
|
100
|
+
asChild: !0,
|
|
101
|
+
className: "gap-2",
|
|
102
|
+
children: /* @__PURE__ */ j(O, {
|
|
103
|
+
to: t,
|
|
104
|
+
state: u,
|
|
105
|
+
onClick: r,
|
|
106
|
+
children: [/* @__PURE__ */ A(_, {
|
|
107
|
+
className: "size-4",
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
}), c("integrations.connectedApps.menu.open", "Open")]
|
|
110
|
+
})
|
|
111
|
+
}),
|
|
112
|
+
m.test && v("test", /* @__PURE__ */ A(D, {
|
|
113
|
+
className: "size-4",
|
|
114
|
+
"aria-hidden": "true"
|
|
115
|
+
}), c("integrations.connectedApps.test", "Test"), () => void l.test(e)),
|
|
116
|
+
m.share && v("share", /* @__PURE__ */ A(C, {
|
|
117
|
+
className: "size-4",
|
|
118
|
+
"aria-hidden": "true"
|
|
119
|
+
}), c("integrations.connectionDetail.actions.share", "Share"), () => l.share(e)),
|
|
120
|
+
m.rename && v("rename", /* @__PURE__ */ A(b, {
|
|
121
|
+
className: "size-4",
|
|
122
|
+
"aria-hidden": "true"
|
|
123
|
+
}), c("integrations.connectedApps.menu.rename", "Rename"), () => l.rename(e)),
|
|
124
|
+
m.refresh && v("refresh", /* @__PURE__ */ A(x, {
|
|
125
|
+
className: "size-4",
|
|
126
|
+
"aria-hidden": "true"
|
|
127
|
+
}), c("integrations.connectedApps.menu.refresh", "Refresh token"), () => void l.refresh(e)),
|
|
128
|
+
m.disconnect && v("disconnect", /* @__PURE__ */ A(T, {
|
|
129
|
+
className: "size-4",
|
|
130
|
+
"aria-hidden": "true"
|
|
131
|
+
}), c("integrations.connectedApps.menu.disconnect", "Disconnect"), () => l.disconnect(e)),
|
|
132
|
+
m.remove && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(L, {}), /* @__PURE__ */ j(I, {
|
|
133
|
+
onSelect: () => l.remove(e),
|
|
134
|
+
disabled: h,
|
|
135
|
+
className: "gap-2 text-status-error-text focus:text-status-error-text",
|
|
136
|
+
children: [/* @__PURE__ */ A(w, {
|
|
137
|
+
className: "size-4",
|
|
138
|
+
"aria-hidden": "true"
|
|
139
|
+
}), c("integrations.connectedApps.menu.remove", "Remove…")]
|
|
140
|
+
})] })
|
|
141
|
+
]
|
|
142
|
+
})] });
|
|
143
|
+
}
|
|
144
|
+
function G() {
|
|
145
|
+
let e = i();
|
|
146
|
+
return /* @__PURE__ */ j("div", {
|
|
147
|
+
"aria-hidden": "true",
|
|
148
|
+
className: "hidden grid-cols-[36px_minmax(0,1fr)_10rem_auto] items-center gap-3 border-b border-border-subtle bg-bg-sunken px-3.5 py-2 text-xs font-semibold text-text-muted @2xl:grid @4xl:grid-cols-[36px_minmax(0,1fr)_10rem_6.5rem_8.5rem]",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ A("span", {}),
|
|
151
|
+
/* @__PURE__ */ A("span", { children: e("integrations.connectedApps.list.columnConnection", "Connection") }),
|
|
152
|
+
/* @__PURE__ */ A("span", { children: e("integrations.connectedApps.list.columnStatus", "Status") }),
|
|
153
|
+
/* @__PURE__ */ A("span", {
|
|
154
|
+
className: "hidden @4xl:block",
|
|
155
|
+
children: e("integrations.connectedApps.list.columnLastUsed", "Last used")
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ A("span", {})
|
|
158
|
+
]
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function K({ connection: e, to: t, onOpen: c }) {
|
|
162
|
+
let d = i(), f = r(), h = u(e.status), g = a(e), _ = l(d, {
|
|
163
|
+
...e,
|
|
164
|
+
flow: o(e)
|
|
165
|
+
}), v = f(e.lastUsedAt);
|
|
166
|
+
return /* @__PURE__ */ j("li", {
|
|
167
|
+
className: n("relative grid grid-cols-[32px_minmax(0,1fr)] gap-x-3 gap-y-1 border-t border-border-subtle px-3.5 py-3 first:border-t-0 hover:bg-bg-sunken @2xl:grid-cols-[36px_minmax(0,1fr)_10rem_auto] @2xl:items-center @2xl:gap-y-0 @4xl:grid-cols-[36px_minmax(0,1fr)_10rem_6.5rem_8.5rem]", B[e.status]),
|
|
168
|
+
"data-testid": "connection-row",
|
|
169
|
+
"data-status": e.status,
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ A("span", {
|
|
172
|
+
className: "row-span-4 self-start @2xl:row-span-1 @2xl:self-center",
|
|
173
|
+
children: /* @__PURE__ */ A(M, {
|
|
174
|
+
provider: e.provider,
|
|
175
|
+
size: 32
|
|
176
|
+
})
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ j("div", {
|
|
179
|
+
className: "min-w-0",
|
|
180
|
+
children: [/* @__PURE__ */ A(H, {
|
|
181
|
+
to: t,
|
|
182
|
+
name: e.name,
|
|
183
|
+
onOpen: c,
|
|
184
|
+
className: "block truncate font-semibold text-text-primary"
|
|
185
|
+
}), /* @__PURE__ */ j("div", {
|
|
186
|
+
className: "flex min-w-0 flex-wrap items-center gap-x-1.5 text-[12.5px] text-text-muted",
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ A("span", {
|
|
189
|
+
className: "truncate",
|
|
190
|
+
children: e.provider.name
|
|
191
|
+
}),
|
|
192
|
+
g && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("span", {
|
|
193
|
+
"aria-hidden": "true",
|
|
194
|
+
children: "·"
|
|
195
|
+
}), /* @__PURE__ */ A("span", {
|
|
196
|
+
className: "max-w-[16rem] truncate",
|
|
197
|
+
children: g
|
|
198
|
+
})] }),
|
|
199
|
+
/* @__PURE__ */ A("span", {
|
|
200
|
+
"aria-hidden": "true",
|
|
201
|
+
children: "·"
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ A(z, { visibility: e.visibility })
|
|
204
|
+
]
|
|
205
|
+
})]
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ j("div", {
|
|
208
|
+
className: "min-w-0",
|
|
209
|
+
children: [/* @__PURE__ */ A(m, { status: e.status }), h !== "quiet" && /* @__PURE__ */ A(p, {
|
|
210
|
+
text: _,
|
|
211
|
+
tone: h
|
|
212
|
+
})]
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ A("div", {
|
|
215
|
+
className: "hidden text-[13px] tabular-nums text-text-secondary @4xl:block",
|
|
216
|
+
children: e.lastUsedAt ? v : d("integrations.connectedApps.list.neverUsed", "Never used")
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ A("div", {
|
|
219
|
+
className: "text-xs text-text-muted @2xl:hidden",
|
|
220
|
+
children: e.lastUsedAt ? d("integrations.connectedApps.list.lastUsed", "Last used {{time}}", { time: v }) : d("integrations.connectedApps.list.neverUsed", "Never used")
|
|
221
|
+
}),
|
|
222
|
+
/* @__PURE__ */ j("div", {
|
|
223
|
+
className: "relative z-10 mt-1 flex items-center justify-start gap-1.5 @2xl:mt-0 @2xl:justify-end",
|
|
224
|
+
children: [/* @__PURE__ */ A(U, { connection: e }), /* @__PURE__ */ A(W, {
|
|
225
|
+
connection: s(e),
|
|
226
|
+
openTo: t,
|
|
227
|
+
onOpen: c
|
|
228
|
+
})]
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function q({ connection: t, to: c, onOpen: d }) {
|
|
234
|
+
let f = i(), p = r(), h = u(t.status), g = a(t), _ = t.status === e.Active ? "" : t.errorMessage || l(f, {
|
|
235
|
+
...t,
|
|
236
|
+
flow: o(t)
|
|
237
|
+
});
|
|
238
|
+
return /* @__PURE__ */ j("article", {
|
|
239
|
+
className: n("group relative flex min-w-0 flex-col gap-3 rounded-xl border border-border-subtle bg-bg-elevated p-3.5", "transition-[transform,box-shadow,border-color] motion-reduce:transition-none motion-safe:duration-150", "hover:border-accent-glow/45 hover:shadow-pop motion-safe:hover:-translate-y-0.5 focus-within:border-accent-glow/45", V[t.status]),
|
|
240
|
+
"data-testid": "connection-card",
|
|
241
|
+
"data-status": t.status,
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ j("div", {
|
|
244
|
+
className: "flex items-start gap-3",
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ A(M, {
|
|
247
|
+
provider: t.provider,
|
|
248
|
+
size: 40
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ j("div", {
|
|
251
|
+
className: "min-w-0 flex-1",
|
|
252
|
+
children: [/* @__PURE__ */ A("h3", {
|
|
253
|
+
className: "line-clamp-2 text-[14.5px] font-semibold leading-snug text-text-primary",
|
|
254
|
+
children: /* @__PURE__ */ A(H, {
|
|
255
|
+
to: c,
|
|
256
|
+
name: t.name,
|
|
257
|
+
onOpen: d
|
|
258
|
+
})
|
|
259
|
+
}), /* @__PURE__ */ A("p", {
|
|
260
|
+
className: "truncate text-[12.5px] text-text-muted",
|
|
261
|
+
children: t.provider.name
|
|
262
|
+
})]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ A(m, { status: t.status })
|
|
265
|
+
]
|
|
266
|
+
}),
|
|
267
|
+
/* @__PURE__ */ j("dl", {
|
|
268
|
+
className: "grid grid-cols-[5.5rem_minmax(0,1fr)] gap-x-2.5 gap-y-1 text-[13px]",
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ A("dt", {
|
|
271
|
+
className: "text-text-muted",
|
|
272
|
+
children: f("integrations.connectedApps.card.account", "Account")
|
|
273
|
+
}),
|
|
274
|
+
/* @__PURE__ */ A("dd", {
|
|
275
|
+
className: "truncate text-text-primary",
|
|
276
|
+
children: g || /* @__PURE__ */ A("span", {
|
|
277
|
+
className: "text-text-muted",
|
|
278
|
+
children: f("integrations.connectedApps.card.noAccount", "Not reported")
|
|
279
|
+
})
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ A("dt", {
|
|
282
|
+
className: "text-text-muted",
|
|
283
|
+
children: f("integrations.connectedApps.card.access", "Access")
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ A("dd", {
|
|
286
|
+
className: "text-text-primary",
|
|
287
|
+
children: /* @__PURE__ */ A(z, { visibility: t.visibility })
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
}),
|
|
291
|
+
_ && /* @__PURE__ */ A("p", {
|
|
292
|
+
className: n("line-clamp-2 text-xs", h === "danger" ? "text-status-error-text" : h === "warning" ? "text-status-warning-text" : "text-text-muted"),
|
|
293
|
+
"data-testid": "connection-reason",
|
|
294
|
+
children: _
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ j("div", {
|
|
297
|
+
className: "relative z-10 mt-auto flex items-center gap-2 border-t border-border-subtle pt-2.5 text-[12.5px] text-text-secondary",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ A("span", {
|
|
300
|
+
className: "min-w-0 flex-1 truncate",
|
|
301
|
+
children: t.lastUsedAt ? f("integrations.connectedApps.list.lastUsed", "Last used {{time}}", { time: p(t.lastUsedAt) }) : f("integrations.connectedApps.list.neverUsed", "Never used")
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ A(U, { connection: t }),
|
|
304
|
+
/* @__PURE__ */ A(W, {
|
|
305
|
+
connection: s(t),
|
|
306
|
+
openTo: c,
|
|
307
|
+
onOpen: d
|
|
308
|
+
})
|
|
309
|
+
]
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
function J({ count: e = 8 }) {
|
|
315
|
+
return /* @__PURE__ */ A("div", {
|
|
316
|
+
className: "@container overflow-hidden rounded-xl border border-border-subtle bg-bg-elevated",
|
|
317
|
+
"aria-hidden": "true",
|
|
318
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ j("div", {
|
|
319
|
+
className: "grid grid-cols-[32px_minmax(0,1fr)] items-center gap-3 border-t border-border-subtle px-3.5 py-3 first:border-t-0 @2xl:grid-cols-[36px_minmax(0,1fr)_10rem_8.5rem]",
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ A("span", { className: "size-8 rounded-[10px] bg-bg-sunken motion-safe:animate-pulse" }),
|
|
322
|
+
/* @__PURE__ */ j("span", {
|
|
323
|
+
className: "flex flex-col gap-1.5",
|
|
324
|
+
children: [/* @__PURE__ */ A("span", { className: "h-3 w-1/2 rounded bg-bg-sunken motion-safe:animate-pulse" }), /* @__PURE__ */ A("span", { className: "h-2.5 w-1/3 rounded bg-bg-sunken motion-safe:animate-pulse" })]
|
|
325
|
+
}),
|
|
326
|
+
/* @__PURE__ */ A("span", { className: "hidden h-3 w-20 rounded bg-bg-sunken motion-safe:animate-pulse @2xl:block" }),
|
|
327
|
+
/* @__PURE__ */ A("span", { className: "hidden h-7 w-24 justify-self-end rounded-lg bg-bg-sunken motion-safe:animate-pulse @2xl:block" })
|
|
328
|
+
]
|
|
329
|
+
}, t))
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
function Y({ count: e = 8 }) {
|
|
333
|
+
return /* @__PURE__ */ A("div", {
|
|
334
|
+
className: n("grid gap-3.5", h),
|
|
335
|
+
"aria-hidden": "true",
|
|
336
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ j("div", {
|
|
337
|
+
className: "flex min-w-0 flex-col gap-2.5 rounded-xl border border-border-subtle bg-bg-elevated p-3.5",
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ j("div", {
|
|
340
|
+
className: "flex items-start gap-3",
|
|
341
|
+
children: [/* @__PURE__ */ A("span", { className: "size-10 flex-none rounded-[11px] bg-bg-sunken motion-safe:animate-pulse" }), /* @__PURE__ */ j("span", {
|
|
342
|
+
className: "flex flex-1 flex-col gap-2 pt-1",
|
|
343
|
+
children: [/* @__PURE__ */ A("span", { className: "h-3 rounded bg-bg-sunken motion-safe:animate-pulse" }), /* @__PURE__ */ A("span", { className: "h-3 w-3/5 rounded bg-bg-sunken motion-safe:animate-pulse" })]
|
|
344
|
+
})]
|
|
345
|
+
}),
|
|
346
|
+
/* @__PURE__ */ A("span", { className: "h-2.5 rounded bg-bg-sunken motion-safe:animate-pulse" }),
|
|
347
|
+
/* @__PURE__ */ A("span", { className: "h-2.5 w-3/4 rounded bg-bg-sunken motion-safe:animate-pulse" }),
|
|
348
|
+
/* @__PURE__ */ j("div", {
|
|
349
|
+
className: "mt-auto flex items-center justify-between",
|
|
350
|
+
children: [/* @__PURE__ */ A("span", { className: "h-5 w-24 rounded-full bg-bg-sunken motion-safe:animate-pulse" }), /* @__PURE__ */ A("span", { className: "h-8 w-16 rounded-lg bg-bg-sunken motion-safe:animate-pulse" })]
|
|
351
|
+
})
|
|
352
|
+
]
|
|
353
|
+
}, t))
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
export { z as AccessLabel, Y as CardsSkeleton, q as ConnectionCard, W as ConnectionMenu, K as ConnectionRow, G as ConnectionRowsHeader, J as ConnectionRowsSkeleton };
|
|
357
|
+
|
|
358
|
+
//# sourceMappingURL=ConnectionItems.js.map
|