MCPcopy Create free account
hub / github.com/ShipSecAI/studio / IntegrationsManager

Function IntegrationsManager

frontend/src/pages/IntegrationsManager.tsx:63–587  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61}
62
63export function IntegrationsManager() {
64 const navigate = useNavigate();
65 const location = useLocation();
66 const userId = getCurrentUserId();
67 const {
68 providers,
69 connections,
70 fetchProviders,
71 fetchConnections,
72 refreshConnection,
73 disconnect,
74 upsertConnection,
75 error,
76 resetError,
77 loadingProviders,
78 loadingConnections,
79 } = useIntegrationStore();
80 const { toast } = useToast();
81
82 const [configProvider, setConfigProvider] = useState<IntegrationProvider | null>(null);
83 const [connectingProvider, setConnectingProvider] = useState<string | null>(null);
84 const [refreshingConnectionId, setRefreshingConnectionId] = useState<string | null>(null);
85 const [deletingConnectionId, setDeletingConnectionId] = useState<string | null>(null);
86 const [customScopes, setCustomScopes] = useState<Record<string, string>>({});
87
88 useEffect(() => {
89 fetchProviders().catch((err) => {
90 console.error('Failed to load providers', err);
91 });
92 }, [fetchProviders]);
93
94 useEffect(() => {
95 fetchConnections(userId).catch((err) => {
96 console.error('Failed to load integrations', err);
97 });
98 }, [fetchConnections, userId]);
99
100 useEffect(() => {
101 if (!error) {
102 return;
103 }
104
105 toast({
106 title: 'Integration error',
107 description: error,
108 variant: 'destructive',
109 });
110 }, [error, toast]);
111
112 useEffect(() => {
113 const params = new URLSearchParams(location.search);
114 const connectedProvider = params.get('connected');
115 if (connectedProvider) {
116 toast({
117 title: 'Connection established',
118 description: `Successfully connected to ${connectedProvider}.`,
119 });
120 params.delete('connected');

Callers

nothing calls this directly

Calls 15

getCurrentUserIdFunction · 0.90
useToastFunction · 0.90
handleDisconnectFunction · 0.85
handleManualReconnectFunction · 0.85
getProviderConnectionFunction · 0.85
buildRequestedScopesFunction · 0.85
getLogoUrlFunction · 0.85
parseAdditionalScopesFunction · 0.85
handleConnectFunction · 0.85
handleConfigureProviderFunction · 0.85
errorMethod · 0.80
formatTimestampFunction · 0.70

Tested by

no test coverage detected