Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

Commit 7c06b27

Browse files
authored
feat: global connections per organization (#1433)
# Global Connections Management System ## Summary Introduces organization-level global connections that can be shared across all projects within an organization. This feature allows users to create, edit, and delete connections at the organization level, making them available for use in triggers across any project. **Key highlights:** - New dedicated `/connections` page for managing global connections - Side-drawer for quick access to global connections from anywhere in the app - Integration with triggers via grouped select showing both project and global connections - Feature flag controlled (`VITE_DISPLAY_GLOBAL_CONNECTIONS`) --- ## Changes ### New Features **Global Connections Management** - New `/connections` route with full CRUD operations for organization-level connections - Resizable split-panel UI with connections list and edit form - Connection status display with error handling - Delete confirmation modal with safety warnings **Global Connections Drawer** - Side-drawer accessible from sidebar for quick connection management - Supports add/edit modes without leaving current context - Keyboard navigation (Escape key support) **Grouped Select Component** - New `GroupedSelect` molecule for categorized dropdown options - Used in trigger forms to show connections grouped by scope (Project vs Organization) - Visual indicators ("Global" badge) for organization-level connections **Connection Status Button** - New `ConnectionStatusButton` atom for displaying connection health - Shows error messages and provides quick access to configuration --- ### Modified Components **Trigger Form (`nameAndConnection.tsx`)** - Integrated global connections alongside project connections - Grouped dropdown showing: - Base trigger types (Schedule, Webhook) - Project connections - Organization (global) connections with "Global" label **Connection Add/Edit Forms** - Added `isGlobalConnection` and `isDrawerMode` props - Conditional behavior based on connection scope - Support for both page and drawer contexts **Sidebar & Topbar** - Added "Connections" menu item in sidebar (feature-flagged) - Event-based drawer toggle integration --- ### Bug Fixes - Fixed Google JSON key connection setup issues - Fixed Google connections authentication flow - Renamed `jsonKey.tsx` to `json.tsx` for consistency in Google auth methods --- ## Feature Flag Enable with environment variable: ```bash VITE_DISPLAY_GLOBAL_CONNECTIONS=true ``` ## Screenshots/Demo ## What type of PR is this? (check all applicable) - [x] 💡 (feat) - A new feature (non-breaking change which adds functionality) - [ ] 🔄 (refactor) - Code Refactoring - A code change that neither fixes a bug nor adds a feature - [ ] 🐞 (fix) - Bug Fix (non-breaking change which fixes an issue) - [ ] 🏎 (perf) - Optimization - [ ] 📄 (docs) - Documentation - Documentation only changes - [ ] 📄 (test) - Tests - Adding missing tests or correcting existing tests - [ ] ⚙️ (ci) - Continuous Integrations - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) - [ ] ☑️ (chore) - Chores - Other changes that don't modify src or test files - [ ] ↩️ (revert) - Reverts - Reverts a previous commit(s). <!-- For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments. Before submitting a Pull Request, please ensure you've done the following: - 👷‍♀️ Create small PRs. In most cases this will be possible. - ✅ Provide tests for your changes. - 📝 Use descriptive commit messages (as described below). - 📗 Update any related documentation and include any relevant screenshots. Commit Message Structure (all lower-case): <type>(optional ticket number): <description> [optional body] -->
1 parent 0a1758f commit 7c06b27

246 files changed

Lines changed: 4575 additions & 578 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_test_and_release.yml

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ jobs:
136136
browser: ${{ matrix.browser }}
137137
autokitteh-image: ${{ vars.AUTOKITTEH_IMAGE }}
138138

139+
- name: Generate connection test data
140+
run: npm run generate:connection-test-data
141+
139142
- name: Run Playwright tests
140143
env:
141144
TESTS_JWT_AUTH_TOKEN: ${{ secrets.TESTS_JWT_AUTH_TOKEN }}
@@ -149,6 +152,72 @@ jobs:
149152
browser: ${{ matrix.browser }}
150153
run-id: ${{ github.run_id }}
151154

155+
visual-regression:
156+
name: 🎨 Visual Regression Tests
157+
needs: setup
158+
runs-on: ubuntu-latest
159+
if: github.ref != 'refs/heads/main'
160+
timeout-minutes: 30
161+
continue-on-error: true
162+
163+
steps:
164+
- uses: actions/checkout@v4
165+
with:
166+
token: ${{ secrets.PAT_TOKEN }}
167+
submodules: true
168+
169+
- uses: actions/setup-node@v4
170+
with:
171+
node-version: ${{ env.NODE_VERSION }}
172+
cache: "npm"
173+
174+
- name: Restore cached node_modules
175+
uses: actions/cache/restore@v4
176+
with:
177+
path: node_modules
178+
key: node-modules-${{ hashFiles('package-lock.json') }}
179+
180+
- name: Restore Playwright browsers
181+
uses: actions/cache/restore@v4
182+
with:
183+
path: ~/.cache/ms-playwright
184+
key: playwright-${{ hashFiles('package-lock.json') }}
185+
186+
- name: Cache Docker images
187+
id: cache-docker
188+
uses: ./.github/actions/cache-docker-images
189+
with:
190+
cache-key: "test-env-images-v1"
191+
images: "${{ vars.AUTOKITTEH_IMAGE }}"
192+
restore-only: "false"
193+
check-updates: false
194+
195+
- name: Setup test environment
196+
uses: ./.github/actions/setup-test-env
197+
with:
198+
descope-project-id: ${{ secrets.VITE_DESCOPE_PROJECT_ID }}
199+
browser: Chrome
200+
autokitteh-image: ${{ vars.AUTOKITTEH_IMAGE }}
201+
202+
- name: Generate connection test data
203+
run: npm run generate:connection-test-data
204+
205+
- name: Run visual regression tests
206+
env:
207+
TESTS_JWT_AUTH_TOKEN: ${{ secrets.TESTS_JWT_AUTH_TOKEN }}
208+
VITE_DISPLAY_CHATBOT: true
209+
run: npx playwright test project/connections/buttonPresence.visual.spec.ts --project="Visual Regression" --workers=1
210+
211+
- name: Upload visual regression artifacts
212+
if: always()
213+
uses: actions/upload-artifact@v4
214+
with:
215+
name: visual-regression-results
216+
path: |
217+
test-results/
218+
playwright-report/
219+
retention-days: 7
220+
152221
build:
153222
needs: setup
154223
runs-on: ubuntu-latest
@@ -183,7 +252,7 @@ jobs:
183252
run: |
184253
git submodule update --remote
185254
npm run type-check
186-
npm run type-check
255+
npm run generate:connection-test-data
187256
npm run lint:ci
188257
npm run build
189258
echo '!dist' >> .gitignore

.husky/pre-commit

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@ if [ -z "$all_staged_files" ]; then
88
exit 0
99
fi
1010

11+
# ===========================================
12+
# Connection Test Data Check
13+
# ===========================================
14+
CONNECTIONS_FILE="e2e/fixtures/connectionsTestCases.json"
15+
16+
echo "🔄 Running generate:connection-test-data..."
17+
npm run generate:connection-test-data
18+
19+
# Check if connectionsTestCases.json has unstaged changes
20+
if git diff --name-only | grep -q "^${CONNECTIONS_FILE}$"; then
21+
echo ""
22+
echo "❌ ERROR: ${CONNECTIONS_FILE} has changed after running generate:connection-test-data!"
23+
echo " The connections data is out of sync."
24+
echo ""
25+
echo " Please stage the file and commit again:"
26+
echo " git add ${CONNECTIONS_FILE}"
27+
echo ""
28+
exit 1
29+
fi
30+
31+
# ===========================================
32+
# Lint-staged Check
33+
# ===========================================
34+
1135
# Run lint-staged and check if it fails
1236
if ! npx lint-staged; then
1337
echo "⚠️ lint-staged failed, running lint --fix on staged files..."

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,3 +863,7 @@ This helps Claude understand purpose + intention beyond syntax.
863863
---
864864

865865
*This document should be referenced before making any changes to ensure consistency with project standards and conventions.*
866+
867+
## Task Master AI Instructions
868+
**Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file.**
869+
@./.taskmaster/CLAUDE.md
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const testConnectionName = "twilioTest";
2+
export const testIntegrationName = "Twilio";

e2e/fixtures.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
/* eslint-disable react-hooks/rules-of-hooks */
2-
import { expect, test as base } from "@playwright/test";
2+
import { expect, test as base, type Page } from "@playwright/test";
33

4-
import { DashboardPage, ProjectPage } from "./pages";
4+
import { ConnectionsConfig, DashboardPage, GlobalConnectionsPage, ProjectPage } from "./pages";
55

66
// eslint-disable-next-line @typescript-eslint/naming-convention
77
const RATE_LIMIT_DELAY = process.env.E2E_RATE_LIMIT_DELAY ? parseInt(process.env.E2E_RATE_LIMIT_DELAY, 10) : 0;
88

9-
const test = base.extend<{ dashboardPage: DashboardPage; projectPage: ProjectPage }>({
10-
dashboardPage: async ({ page }, use) => {
9+
type PageFixtureArgs = { page: Page };
10+
type UseFixture<T> = (fixture: T) => Promise<void>;
11+
12+
const test = base.extend<{
13+
connectionsConfig: ConnectionsConfig;
14+
dashboardPage: DashboardPage;
15+
globalConnectionsPage: GlobalConnectionsPage;
16+
projectPage: ProjectPage;
17+
}>({
18+
connectionsConfig: async ({ page }: PageFixtureArgs, use: UseFixture<ConnectionsConfig>) => {
19+
await use(new ConnectionsConfig(page));
20+
},
21+
dashboardPage: async ({ page }: PageFixtureArgs, use: UseFixture<DashboardPage>) => {
1122
await use(new DashboardPage(page));
1223
},
13-
projectPage: async ({ page }, use) => {
24+
globalConnectionsPage: async ({ page }: PageFixtureArgs, use: UseFixture<GlobalConnectionsPage>) => {
25+
await use(new GlobalConnectionsPage(page));
26+
},
27+
projectPage: async ({ page }: PageFixtureArgs, use: UseFixture<ProjectPage>) => {
1428
await use(new ProjectPage(page));
1529
},
1630
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
declare module "./connectionsTestCases.json" {
2+
interface ConnectionTestCase {
3+
authLabel?: string | null;
4+
authType?: string | null;
5+
category: "single-type" | "multi-type";
6+
integration: string;
7+
label: string;
8+
testName: string;
9+
}
10+
11+
const value: ConnectionTestCase[];
12+
export default value;
13+
}

0 commit comments

Comments
 (0)