@friggframework/devtools 2.0.0-next.3 → 2.0.0-next.30
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/frigg-cli/.eslintrc.js +141 -0
- package/frigg-cli/__tests__/jest.config.js +102 -0
- package/frigg-cli/__tests__/unit/commands/build.test.js +483 -0
- package/frigg-cli/__tests__/unit/commands/install.test.js +418 -0
- package/frigg-cli/__tests__/unit/commands/ui.test.js +592 -0
- package/frigg-cli/__tests__/utils/command-tester.js +170 -0
- package/frigg-cli/__tests__/utils/mock-factory.js +270 -0
- package/frigg-cli/__tests__/utils/test-fixtures.js +463 -0
- package/frigg-cli/__tests__/utils/test-setup.js +286 -0
- package/frigg-cli/build-command/index.js +54 -0
- package/frigg-cli/deploy-command/index.js +36 -0
- package/frigg-cli/generate-command/__tests__/generate-command.test.js +312 -0
- package/frigg-cli/generate-command/azure-generator.js +43 -0
- package/frigg-cli/generate-command/gcp-generator.js +47 -0
- package/frigg-cli/generate-command/index.js +332 -0
- package/frigg-cli/generate-command/terraform-generator.js +555 -0
- package/frigg-cli/generate-iam-command.js +115 -0
- package/frigg-cli/index.js +47 -1
- package/frigg-cli/index.test.js +1 -4
- package/frigg-cli/init-command/backend-first-handler.js +756 -0
- package/frigg-cli/init-command/index.js +93 -0
- package/frigg-cli/init-command/template-handler.js +143 -0
- package/frigg-cli/install-command/index.js +1 -4
- package/frigg-cli/package.json +51 -0
- package/frigg-cli/start-command/index.js +24 -4
- package/frigg-cli/test/init-command.test.js +180 -0
- package/frigg-cli/test/npm-registry.test.js +319 -0
- package/frigg-cli/ui-command/index.js +154 -0
- package/frigg-cli/utils/app-resolver.js +319 -0
- package/frigg-cli/utils/backend-path.js +16 -17
- package/frigg-cli/utils/npm-registry.js +167 -0
- package/frigg-cli/utils/process-manager.js +199 -0
- package/frigg-cli/utils/repo-detection.js +405 -0
- package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +245 -0
- package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +596 -0
- package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +268 -0
- package/infrastructure/GENERATE-IAM-DOCS.md +253 -0
- package/infrastructure/IAM-POLICY-TEMPLATES.md +176 -0
- package/infrastructure/README-TESTING.md +332 -0
- package/infrastructure/README.md +421 -0
- package/infrastructure/WEBSOCKET-CONFIGURATION.md +105 -0
- package/infrastructure/__tests__/fixtures/mock-aws-resources.js +391 -0
- package/infrastructure/__tests__/helpers/test-utils.js +277 -0
- package/infrastructure/aws-discovery.js +568 -0
- package/infrastructure/aws-discovery.test.js +373 -0
- package/infrastructure/build-time-discovery.js +206 -0
- package/infrastructure/build-time-discovery.test.js +375 -0
- package/infrastructure/create-frigg-infrastructure.js +3 -5
- package/infrastructure/frigg-deployment-iam-stack.yaml +379 -0
- package/infrastructure/iam-generator.js +687 -0
- package/infrastructure/iam-generator.test.js +169 -0
- package/infrastructure/iam-policy-basic.json +212 -0
- package/infrastructure/iam-policy-full.json +282 -0
- package/infrastructure/integration.test.js +383 -0
- package/infrastructure/run-discovery.js +110 -0
- package/infrastructure/serverless-template.js +923 -113
- package/infrastructure/serverless-template.test.js +541 -0
- package/management-ui/.eslintrc.js +22 -0
- package/management-ui/README.md +203 -0
- package/management-ui/components.json +21 -0
- package/management-ui/docs/phase2-integration-guide.md +320 -0
- package/management-ui/index.html +13 -0
- package/management-ui/package-lock.json +16517 -0
- package/management-ui/package.json +76 -0
- package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +302 -0
- package/management-ui/postcss.config.js +6 -0
- package/management-ui/server/api/backend.js +256 -0
- package/management-ui/server/api/cli.js +315 -0
- package/management-ui/server/api/codegen.js +663 -0
- package/management-ui/server/api/connections.js +857 -0
- package/management-ui/server/api/discovery.js +185 -0
- package/management-ui/server/api/environment/index.js +1 -0
- package/management-ui/server/api/environment/router.js +378 -0
- package/management-ui/server/api/environment.js +328 -0
- package/management-ui/server/api/integrations.js +876 -0
- package/management-ui/server/api/logs.js +248 -0
- package/management-ui/server/api/monitoring.js +282 -0
- package/management-ui/server/api/open-ide.js +31 -0
- package/management-ui/server/api/project.js +1029 -0
- package/management-ui/server/api/users/sessions.js +371 -0
- package/management-ui/server/api/users/simulation.js +254 -0
- package/management-ui/server/api/users.js +362 -0
- package/management-ui/server/api-contract.md +275 -0
- package/management-ui/server/index.js +873 -0
- package/management-ui/server/middleware/errorHandler.js +93 -0
- package/management-ui/server/middleware/security.js +32 -0
- package/management-ui/server/processManager.js +296 -0
- package/management-ui/server/server.js +346 -0
- package/management-ui/server/services/aws-monitor.js +413 -0
- package/management-ui/server/services/npm-registry.js +347 -0
- package/management-ui/server/services/template-engine.js +538 -0
- package/management-ui/server/utils/cliIntegration.js +220 -0
- package/management-ui/server/utils/environment/auditLogger.js +471 -0
- package/management-ui/server/utils/environment/awsParameterStore.js +264 -0
- package/management-ui/server/utils/environment/encryption.js +278 -0
- package/management-ui/server/utils/environment/envFileManager.js +286 -0
- package/management-ui/server/utils/import-commonjs.js +28 -0
- package/management-ui/server/utils/response.js +83 -0
- package/management-ui/server/websocket/handler.js +325 -0
- package/management-ui/src/App.jsx +109 -0
- package/management-ui/src/assets/FriggLogo.svg +1 -0
- package/management-ui/src/components/AppRouter.jsx +65 -0
- package/management-ui/src/components/Button.jsx +70 -0
- package/management-ui/src/components/Card.jsx +97 -0
- package/management-ui/src/components/EnvironmentCompare.jsx +400 -0
- package/management-ui/src/components/EnvironmentEditor.jsx +372 -0
- package/management-ui/src/components/EnvironmentImportExport.jsx +469 -0
- package/management-ui/src/components/EnvironmentSchema.jsx +491 -0
- package/management-ui/src/components/EnvironmentSecurity.jsx +463 -0
- package/management-ui/src/components/ErrorBoundary.jsx +73 -0
- package/management-ui/src/components/IntegrationCard.jsx +481 -0
- package/management-ui/src/components/IntegrationCardEnhanced.jsx +770 -0
- package/management-ui/src/components/IntegrationExplorer.jsx +379 -0
- package/management-ui/src/components/IntegrationStatus.jsx +336 -0
- package/management-ui/src/components/Layout.jsx +716 -0
- package/management-ui/src/components/LoadingSpinner.jsx +113 -0
- package/management-ui/src/components/RepositoryPicker.jsx +248 -0
- package/management-ui/src/components/SessionMonitor.jsx +350 -0
- package/management-ui/src/components/StatusBadge.jsx +208 -0
- package/management-ui/src/components/UserContextSwitcher.jsx +212 -0
- package/management-ui/src/components/UserSimulation.jsx +327 -0
- package/management-ui/src/components/Welcome.jsx +434 -0
- package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +637 -0
- package/management-ui/src/components/codegen/APIModuleSelector.jsx +227 -0
- package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +247 -0
- package/management-ui/src/components/codegen/CodePreviewEditor.jsx +316 -0
- package/management-ui/src/components/codegen/DynamicModuleForm.jsx +271 -0
- package/management-ui/src/components/codegen/FormBuilder.jsx +737 -0
- package/management-ui/src/components/codegen/IntegrationGenerator.jsx +855 -0
- package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +797 -0
- package/management-ui/src/components/codegen/SchemaBuilder.jsx +303 -0
- package/management-ui/src/components/codegen/TemplateSelector.jsx +586 -0
- package/management-ui/src/components/codegen/index.js +10 -0
- package/management-ui/src/components/connections/ConnectionConfigForm.jsx +362 -0
- package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +182 -0
- package/management-ui/src/components/connections/ConnectionTester.jsx +200 -0
- package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +292 -0
- package/management-ui/src/components/connections/OAuthFlow.jsx +204 -0
- package/management-ui/src/components/connections/index.js +5 -0
- package/management-ui/src/components/index.js +21 -0
- package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +222 -0
- package/management-ui/src/components/monitoring/LambdaMetrics.jsx +169 -0
- package/management-ui/src/components/monitoring/MetricsChart.jsx +197 -0
- package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +393 -0
- package/management-ui/src/components/monitoring/SQSMetrics.jsx +246 -0
- package/management-ui/src/components/monitoring/index.js +6 -0
- package/management-ui/src/components/monitoring/monitoring.css +218 -0
- package/management-ui/src/components/theme-provider.jsx +52 -0
- package/management-ui/src/components/theme-toggle.jsx +39 -0
- package/management-ui/src/components/ui/badge.tsx +36 -0
- package/management-ui/src/components/ui/button.test.jsx +56 -0
- package/management-ui/src/components/ui/button.tsx +57 -0
- package/management-ui/src/components/ui/card.tsx +76 -0
- package/management-ui/src/components/ui/dropdown-menu.tsx +199 -0
- package/management-ui/src/components/ui/select.tsx +157 -0
- package/management-ui/src/components/ui/skeleton.jsx +15 -0
- package/management-ui/src/hooks/useFrigg.jsx +601 -0
- package/management-ui/src/hooks/useSocket.jsx +58 -0
- package/management-ui/src/index.css +193 -0
- package/management-ui/src/lib/utils.ts +6 -0
- package/management-ui/src/main.jsx +10 -0
- package/management-ui/src/pages/CodeGeneration.jsx +14 -0
- package/management-ui/src/pages/Connections.jsx +252 -0
- package/management-ui/src/pages/ConnectionsEnhanced.jsx +633 -0
- package/management-ui/src/pages/Dashboard.jsx +311 -0
- package/management-ui/src/pages/Environment.jsx +314 -0
- package/management-ui/src/pages/IntegrationConfigure.jsx +669 -0
- package/management-ui/src/pages/IntegrationDiscovery.jsx +567 -0
- package/management-ui/src/pages/IntegrationTest.jsx +742 -0
- package/management-ui/src/pages/Integrations.jsx +253 -0
- package/management-ui/src/pages/Monitoring.jsx +17 -0
- package/management-ui/src/pages/Simulation.jsx +155 -0
- package/management-ui/src/pages/Users.jsx +492 -0
- package/management-ui/src/services/api.js +41 -0
- package/management-ui/src/services/apiModuleService.js +193 -0
- package/management-ui/src/services/websocket-handlers.js +120 -0
- package/management-ui/src/test/api/project.test.js +273 -0
- package/management-ui/src/test/components/Welcome.test.jsx +378 -0
- package/management-ui/src/test/mocks/server.js +178 -0
- package/management-ui/src/test/setup.js +61 -0
- package/management-ui/src/test/utils/test-utils.jsx +134 -0
- package/management-ui/src/utils/repository.js +98 -0
- package/management-ui/src/utils/repository.test.js +118 -0
- package/management-ui/src/workflows/phase2-integration-workflows.js +884 -0
- package/management-ui/tailwind.config.js +63 -0
- package/management-ui/tsconfig.json +37 -0
- package/management-ui/tsconfig.node.json +10 -0
- package/management-ui/vite.config.js +26 -0
- package/management-ui/vitest.config.js +38 -0
- package/package.json +16 -9
- package/infrastructure/app-handler-helpers.js +0 -57
- package/infrastructure/backend-utils.js +0 -90
- package/infrastructure/routers/auth.js +0 -26
- package/infrastructure/routers/integration-defined-routers.js +0 -37
- package/infrastructure/routers/middleware/loadUser.js +0 -15
- package/infrastructure/routers/middleware/requireLoggedInUser.js +0 -12
- package/infrastructure/routers/user.js +0 -41
- package/infrastructure/routers/websocket.js +0 -55
- package/infrastructure/workers/integration-defined-workers.js +0 -24
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import React, { useState, useMemo } from 'react'
|
|
2
|
+
import { Search, Filter, Grid3X3, List, Package } from 'lucide-react'
|
|
3
|
+
import { useFrigg } from '../hooks/useFrigg'
|
|
4
|
+
import IntegrationCard from '../components/IntegrationCard'
|
|
5
|
+
import { Button } from '../components/Button'
|
|
6
|
+
import { cn } from '../lib/utils'
|
|
7
|
+
|
|
8
|
+
const Integrations = () => {
|
|
9
|
+
const { integrations, installIntegration, uninstallIntegration } = useFrigg()
|
|
10
|
+
const [searchQuery, setSearchQuery] = useState('')
|
|
11
|
+
const [selectedCategory, setSelectedCategory] = useState('all')
|
|
12
|
+
const [viewMode, setViewMode] = useState('grid') // 'grid' or 'list'
|
|
13
|
+
const [installing, setInstalling] = useState(false)
|
|
14
|
+
const [selectedIntegration, setSelectedIntegration] = useState(null)
|
|
15
|
+
|
|
16
|
+
// Mock available integrations - in real app, this would come from API
|
|
17
|
+
const availableIntegrations = [
|
|
18
|
+
{
|
|
19
|
+
name: 'slack',
|
|
20
|
+
displayName: 'Slack',
|
|
21
|
+
description: 'Team communication and collaboration platform',
|
|
22
|
+
category: 'communication',
|
|
23
|
+
tags: ['messaging', 'team', 'notifications'],
|
|
24
|
+
version: '2.1.0',
|
|
25
|
+
docsUrl: 'https://docs.frigg.dev/integrations/slack'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'salesforce',
|
|
29
|
+
displayName: 'Salesforce',
|
|
30
|
+
description: 'Customer relationship management and sales platform',
|
|
31
|
+
category: 'crm',
|
|
32
|
+
tags: ['sales', 'crm', 'leads'],
|
|
33
|
+
version: '1.8.2',
|
|
34
|
+
docsUrl: 'https://docs.frigg.dev/integrations/salesforce'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'hubspot',
|
|
38
|
+
displayName: 'HubSpot',
|
|
39
|
+
description: 'Inbound marketing, sales, and service software',
|
|
40
|
+
category: 'marketing',
|
|
41
|
+
tags: ['marketing', 'automation', 'analytics'],
|
|
42
|
+
version: '3.0.1',
|
|
43
|
+
docsUrl: 'https://docs.frigg.dev/integrations/hubspot'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'google-sheets',
|
|
47
|
+
displayName: 'Google Sheets',
|
|
48
|
+
description: 'Online spreadsheet collaboration and data management',
|
|
49
|
+
category: 'productivity',
|
|
50
|
+
tags: ['spreadsheet', 'data', 'collaboration'],
|
|
51
|
+
version: '1.5.0',
|
|
52
|
+
docsUrl: 'https://docs.frigg.dev/integrations/google-sheets'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'stripe',
|
|
56
|
+
displayName: 'Stripe',
|
|
57
|
+
description: 'Online payment processing and financial services',
|
|
58
|
+
category: 'payments',
|
|
59
|
+
tags: ['payments', 'ecommerce', 'billing'],
|
|
60
|
+
version: '2.3.1',
|
|
61
|
+
docsUrl: 'https://docs.frigg.dev/integrations/stripe'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'mailchimp',
|
|
65
|
+
displayName: 'Mailchimp',
|
|
66
|
+
description: 'Email marketing and automation platform',
|
|
67
|
+
category: 'marketing',
|
|
68
|
+
tags: ['email', 'marketing', 'campaigns'],
|
|
69
|
+
version: '1.9.0',
|
|
70
|
+
docsUrl: 'https://docs.frigg.dev/integrations/mailchimp'
|
|
71
|
+
},
|
|
72
|
+
].map(integration => ({
|
|
73
|
+
...integration,
|
|
74
|
+
installed: integrations.some(i => i.name === integration.name),
|
|
75
|
+
connections: Math.floor(Math.random() * 10), // Mock data
|
|
76
|
+
lastUpdated: new Date(Date.now() - Math.random() * 30 * 24 * 60 * 60 * 1000).toISOString()
|
|
77
|
+
}))
|
|
78
|
+
|
|
79
|
+
const categories = ['all', 'communication', 'crm', 'marketing', 'productivity', 'payments']
|
|
80
|
+
|
|
81
|
+
const filteredIntegrations = useMemo(() => {
|
|
82
|
+
return availableIntegrations.filter(integration => {
|
|
83
|
+
const matchesSearch = integration.displayName.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
84
|
+
integration.description.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
85
|
+
integration.tags.some(tag => tag.toLowerCase().includes(searchQuery.toLowerCase()))
|
|
86
|
+
|
|
87
|
+
const matchesCategory = selectedCategory === 'all' || integration.category === selectedCategory
|
|
88
|
+
return matchesSearch && matchesCategory
|
|
89
|
+
})
|
|
90
|
+
}, [availableIntegrations, searchQuery, selectedCategory])
|
|
91
|
+
|
|
92
|
+
const installedIntegrations = useMemo(() => {
|
|
93
|
+
return availableIntegrations.filter(integration => integration.installed)
|
|
94
|
+
}, [availableIntegrations])
|
|
95
|
+
|
|
96
|
+
const availableForInstall = useMemo(() => {
|
|
97
|
+
return filteredIntegrations.filter(integration => !integration.installed)
|
|
98
|
+
}, [filteredIntegrations])
|
|
99
|
+
|
|
100
|
+
const handleInstall = async (integrationName) => {
|
|
101
|
+
setInstalling(true)
|
|
102
|
+
setSelectedIntegration(integrationName)
|
|
103
|
+
try {
|
|
104
|
+
await installIntegration(integrationName)
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error('Installation failed:', error)
|
|
107
|
+
} finally {
|
|
108
|
+
setInstalling(false)
|
|
109
|
+
setSelectedIntegration(null)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const handleUninstall = async (integrationName) => {
|
|
114
|
+
try {
|
|
115
|
+
if (uninstallIntegration) {
|
|
116
|
+
await uninstallIntegration(integrationName)
|
|
117
|
+
}
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.error('Uninstall failed:', error)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const handleConfigure = (integrationName) => {
|
|
124
|
+
// Navigate to configuration page or open modal
|
|
125
|
+
console.log('Configure integration:', integrationName)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<div className="space-y-6">
|
|
130
|
+
{/* Header */}
|
|
131
|
+
<div>
|
|
132
|
+
<h2 className="text-3xl font-bold text-gray-900">Integration Discovery</h2>
|
|
133
|
+
<p className="mt-2 text-gray-600">Browse and manage Frigg integrations</p>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
{/* Search and Filters */}
|
|
137
|
+
<div className="flex flex-col sm:flex-row gap-4">
|
|
138
|
+
<div className="relative flex-1">
|
|
139
|
+
<Search size={20} className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400" />
|
|
140
|
+
<input
|
|
141
|
+
type="text"
|
|
142
|
+
className="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
143
|
+
placeholder="Search integrations..."
|
|
144
|
+
value={searchQuery}
|
|
145
|
+
onChange={(e) => setSearchQuery(e.target.value)}
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div className="flex items-center gap-2">
|
|
150
|
+
<select
|
|
151
|
+
value={selectedCategory}
|
|
152
|
+
onChange={(e) => setSelectedCategory(e.target.value)}
|
|
153
|
+
className="px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
154
|
+
>
|
|
155
|
+
{categories.map(category => (
|
|
156
|
+
<option key={category} value={category}>
|
|
157
|
+
{category.charAt(0).toUpperCase() + category.slice(1)}
|
|
158
|
+
</option>
|
|
159
|
+
))}
|
|
160
|
+
</select>
|
|
161
|
+
|
|
162
|
+
<div className="flex border border-gray-300 rounded-lg">
|
|
163
|
+
<Button
|
|
164
|
+
variant={viewMode === 'grid' ? 'default' : 'ghost'}
|
|
165
|
+
size="sm"
|
|
166
|
+
onClick={() => setViewMode('grid')}
|
|
167
|
+
className="rounded-r-none"
|
|
168
|
+
>
|
|
169
|
+
<Grid3X3 size={16} />
|
|
170
|
+
</Button>
|
|
171
|
+
<Button
|
|
172
|
+
variant={viewMode === 'list' ? 'default' : 'ghost'}
|
|
173
|
+
size="sm"
|
|
174
|
+
onClick={() => setViewMode('list')}
|
|
175
|
+
className="rounded-l-none border-l"
|
|
176
|
+
>
|
|
177
|
+
<List size={16} />
|
|
178
|
+
</Button>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
{/* Installed Integrations */}
|
|
184
|
+
{installedIntegrations.length > 0 && (
|
|
185
|
+
<div>
|
|
186
|
+
<div className="flex items-center mb-4">
|
|
187
|
+
<Package size={20} className="mr-2 text-green-600" />
|
|
188
|
+
<h3 className="text-lg font-medium text-gray-900">
|
|
189
|
+
Installed Integrations ({installedIntegrations.length})
|
|
190
|
+
</h3>
|
|
191
|
+
</div>
|
|
192
|
+
<div className={cn(
|
|
193
|
+
viewMode === 'grid'
|
|
194
|
+
? 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6'
|
|
195
|
+
: 'space-y-4'
|
|
196
|
+
)}>
|
|
197
|
+
{installedIntegrations.map((integration) => (
|
|
198
|
+
<IntegrationCard
|
|
199
|
+
key={integration.name}
|
|
200
|
+
integration={integration}
|
|
201
|
+
onConfigure={handleConfigure}
|
|
202
|
+
onUninstall={handleUninstall}
|
|
203
|
+
className={viewMode === 'list' ? 'max-w-none' : ''}
|
|
204
|
+
/>
|
|
205
|
+
))}
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
)}
|
|
209
|
+
|
|
210
|
+
{/* Available Integrations */}
|
|
211
|
+
<div>
|
|
212
|
+
<h3 className="text-lg font-medium text-gray-900 mb-4">
|
|
213
|
+
Available Integrations ({availableForInstall.length})
|
|
214
|
+
</h3>
|
|
215
|
+
|
|
216
|
+
{availableForInstall.length === 0 ? (
|
|
217
|
+
<div className="text-center py-12">
|
|
218
|
+
<Package size={48} className="mx-auto text-gray-300 mb-4" />
|
|
219
|
+
<p className="text-gray-500">No integrations found matching your criteria</p>
|
|
220
|
+
<Button
|
|
221
|
+
variant="outline"
|
|
222
|
+
onClick={() => {
|
|
223
|
+
setSearchQuery('')
|
|
224
|
+
setSelectedCategory('all')
|
|
225
|
+
}}
|
|
226
|
+
className="mt-4"
|
|
227
|
+
>
|
|
228
|
+
Clear Filters
|
|
229
|
+
</Button>
|
|
230
|
+
</div>
|
|
231
|
+
) : (
|
|
232
|
+
<div className={cn(
|
|
233
|
+
viewMode === 'grid'
|
|
234
|
+
? 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6'
|
|
235
|
+
: 'space-y-4'
|
|
236
|
+
)}>
|
|
237
|
+
{availableForInstall.map((integration) => (
|
|
238
|
+
<IntegrationCard
|
|
239
|
+
key={integration.name}
|
|
240
|
+
integration={integration}
|
|
241
|
+
onInstall={handleInstall}
|
|
242
|
+
installing={installing && selectedIntegration === integration.name}
|
|
243
|
+
className={viewMode === 'list' ? 'max-w-none' : ''}
|
|
244
|
+
/>
|
|
245
|
+
))}
|
|
246
|
+
</div>
|
|
247
|
+
)}
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export default Integrations
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Layout } from '../components/Layout'
|
|
3
|
+
import { MonitoringDashboard } from '../components/monitoring'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Monitoring Page Component
|
|
7
|
+
* Provides production monitoring and metrics visualization
|
|
8
|
+
*/
|
|
9
|
+
function Monitoring() {
|
|
10
|
+
return (
|
|
11
|
+
<Layout>
|
|
12
|
+
<MonitoringDashboard />
|
|
13
|
+
</Layout>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default Monitoring
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useFrigg } from '../hooks/useFrigg'
|
|
3
|
+
import UserSimulation from '../components/UserSimulation'
|
|
4
|
+
|
|
5
|
+
const Simulation = () => {
|
|
6
|
+
const { users, integrations, currentUser } = useFrigg()
|
|
7
|
+
const [selectedUser, setSelectedUser] = useState(null)
|
|
8
|
+
const [selectedIntegration, setSelectedIntegration] = useState(null)
|
|
9
|
+
|
|
10
|
+
// Use current user context if available
|
|
11
|
+
const simulationUser = selectedUser || currentUser
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div>
|
|
15
|
+
<div className="mb-8">
|
|
16
|
+
<h2 className="text-3xl font-bold text-gray-900">Integration Testing Simulator</h2>
|
|
17
|
+
<p className="mt-2 text-gray-600">Simulate user interactions with integrations for development testing</p>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
{/* Selection Controls */}
|
|
21
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
|
|
22
|
+
{/* User Selection */}
|
|
23
|
+
<div className="bg-white shadow rounded-lg p-6">
|
|
24
|
+
<h3 className="text-lg font-medium text-gray-900 mb-4">Select Test User</h3>
|
|
25
|
+
{currentUser && (
|
|
26
|
+
<div className="mb-4 p-3 bg-blue-50 border border-blue-200 rounded-md">
|
|
27
|
+
<p className="text-sm text-blue-800">
|
|
28
|
+
Using context user: <strong>{currentUser.firstName} {currentUser.lastName}</strong>
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
)}
|
|
32
|
+
<div className="space-y-2 max-h-64 overflow-y-auto">
|
|
33
|
+
{users.length === 0 ? (
|
|
34
|
+
<p className="text-sm text-gray-500 text-center py-4">
|
|
35
|
+
No test users available. Create some users first.
|
|
36
|
+
</p>
|
|
37
|
+
) : (
|
|
38
|
+
users.map(user => (
|
|
39
|
+
<label
|
|
40
|
+
key={user.id}
|
|
41
|
+
className={`flex items-center p-3 border rounded-md cursor-pointer transition-colors ${
|
|
42
|
+
(simulationUser?.id === user.id)
|
|
43
|
+
? 'border-blue-500 bg-blue-50'
|
|
44
|
+
: 'border-gray-200 hover:border-gray-300'
|
|
45
|
+
}`}
|
|
46
|
+
>
|
|
47
|
+
<input
|
|
48
|
+
type="radio"
|
|
49
|
+
name="user"
|
|
50
|
+
value={user.id}
|
|
51
|
+
checked={simulationUser?.id === user.id}
|
|
52
|
+
onChange={() => setSelectedUser(user)}
|
|
53
|
+
className="mr-3"
|
|
54
|
+
/>
|
|
55
|
+
<div className="flex-1">
|
|
56
|
+
<p className="text-sm font-medium text-gray-900">
|
|
57
|
+
{user.firstName} {user.lastName}
|
|
58
|
+
</p>
|
|
59
|
+
<p className="text-xs text-gray-500">{user.email}</p>
|
|
60
|
+
<div className="flex items-center space-x-2 mt-1">
|
|
61
|
+
<span className="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">
|
|
62
|
+
{user.role}
|
|
63
|
+
</span>
|
|
64
|
+
{user.appOrgId && (
|
|
65
|
+
<span className="text-xs text-gray-500">
|
|
66
|
+
Org: {user.appOrgId}
|
|
67
|
+
</span>
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</label>
|
|
72
|
+
))
|
|
73
|
+
)}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
{/* Integration Selection */}
|
|
78
|
+
<div className="bg-white shadow rounded-lg p-6">
|
|
79
|
+
<h3 className="text-lg font-medium text-gray-900 mb-4">Select Integration</h3>
|
|
80
|
+
<div className="space-y-2 max-h-64 overflow-y-auto">
|
|
81
|
+
{integrations.length === 0 ? (
|
|
82
|
+
<p className="text-sm text-gray-500 text-center py-4">
|
|
83
|
+
No integrations available. Install some integrations first.
|
|
84
|
+
</p>
|
|
85
|
+
) : (
|
|
86
|
+
integrations.map(integration => (
|
|
87
|
+
<label
|
|
88
|
+
key={integration.id}
|
|
89
|
+
className={`flex items-center p-3 border rounded-md cursor-pointer transition-colors ${
|
|
90
|
+
selectedIntegration?.id === integration.id
|
|
91
|
+
? 'border-blue-500 bg-blue-50'
|
|
92
|
+
: 'border-gray-200 hover:border-gray-300'
|
|
93
|
+
}`}
|
|
94
|
+
>
|
|
95
|
+
<input
|
|
96
|
+
type="radio"
|
|
97
|
+
name="integration"
|
|
98
|
+
value={integration.id}
|
|
99
|
+
checked={selectedIntegration?.id === integration.id}
|
|
100
|
+
onChange={() => setSelectedIntegration(integration)}
|
|
101
|
+
className="mr-3"
|
|
102
|
+
/>
|
|
103
|
+
<div className="flex-1">
|
|
104
|
+
<p className="text-sm font-medium text-gray-900">
|
|
105
|
+
{integration.name}
|
|
106
|
+
</p>
|
|
107
|
+
<p className="text-xs text-gray-500">
|
|
108
|
+
{integration.description || 'No description'}
|
|
109
|
+
</p>
|
|
110
|
+
<div className="flex items-center space-x-2 mt-1">
|
|
111
|
+
<span className={`text-xs px-2 py-0.5 rounded ${
|
|
112
|
+
integration.status === 'active'
|
|
113
|
+
? 'bg-green-100 text-green-700'
|
|
114
|
+
: 'bg-gray-100 text-gray-600'
|
|
115
|
+
}`}>
|
|
116
|
+
{integration.status || 'inactive'}
|
|
117
|
+
</span>
|
|
118
|
+
<span className="text-xs text-gray-500">
|
|
119
|
+
v{integration.version || '1.0.0'}
|
|
120
|
+
</span>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</label>
|
|
124
|
+
))
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
{/* Simulation Component */}
|
|
131
|
+
<UserSimulation
|
|
132
|
+
user={simulationUser}
|
|
133
|
+
integration={selectedIntegration}
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
{/* Help Section */}
|
|
137
|
+
<div className="mt-8 bg-yellow-50 border border-yellow-200 rounded-lg p-6">
|
|
138
|
+
<h4 className="text-sm font-semibold text-yellow-900 mb-2">How to Use the Simulator</h4>
|
|
139
|
+
<ol className="text-sm text-yellow-800 space-y-2 list-decimal list-inside">
|
|
140
|
+
<li>Select a test user or use the current context user from the header</li>
|
|
141
|
+
<li>Choose an integration to test</li>
|
|
142
|
+
<li>Start a simulation session</li>
|
|
143
|
+
<li>Execute actions and observe the responses</li>
|
|
144
|
+
<li>Simulate webhook events to test integration reactions</li>
|
|
145
|
+
<li>Monitor the activity log for debugging</li>
|
|
146
|
+
</ol>
|
|
147
|
+
<p className="text-xs text-yellow-700 mt-3">
|
|
148
|
+
Note: All simulations are for local development only and do not affect real data.
|
|
149
|
+
</p>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export default Simulation
|