Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

remove integrations

Ahmed Essam38f394d34b6c
diff --git a/packages/app/eslint.config.js b/packages/app/eslint.config.js
index d8328e2a..0648c8a0 100644
--- a/packages/app/eslint.config.js
+++ b/packages/app/eslint.config.js
@@ -34,14 +34,14 @@ export default tseslint.config(
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
+ 'max-len': 'off',
+
// General JS/TS Rules
'no-unused-vars': 'warn',
'no-console': 'warn',
'no-debugger': 'warn',
'no-empty': 'warn',
- 'max-len': 'off',
-
// TypeScript
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
diff --git a/packages/app/src/backend/routes/api/page/builder.ts b/packages/app/src/backend/routes/api/page/builder.ts
index 204536d4..d30d0db4 100644
--- a/packages/app/src/backend/routes/api/page/builder.ts
+++ b/packages/app/src/backend/routes/api/page/builder.ts
@@ -14,6 +14,7 @@ import {
smythAPIReq,
} from '../../../utils/';
import { refreshMenu } from '../../pages/builder-sidebar';
+import { getIntegrations } from '../../router.utils/templates.utils';
import axios, { AxiosError, AxiosResponse } from 'axios';
import rateLimit from 'express-rate-limit';
@@ -176,8 +177,8 @@ router.get('/keys/prefix/:keyName/exists', includeTeamDetails, async (req, res)
const team = req?._team?.id;
const keys = await vault.get({ team }, req);
- const keyNames = Object.values(keys).filter(
- (keyEntry: { name: string }) => keyEntry.name?.startsWith(keyName),
+ const keyNames = Object.values(keys).filter((keyEntry: { name: string }) =>
+ keyEntry.name?.startsWith(keyName),
);
/*
@@ -442,6 +443,21 @@ const componentsMWHandler = forwardToSmythM2MAPIMiddleware();
router.get('/app-config/components', componentsMWHandler);
router.get('/app-config/collections', componentsMWHandler);
+router.get('/app-config/collections/:id/components', componentsMWHandler);
+
+router.get('/integrations', async (req, res) => {
+ try {
+ const integrations = await getIntegrations();
+ return res.json({ success: true, data: integrations });
+ } catch (error) {
+ console.error('Error loading integrations:', error);
+ return res.status(500).json({
+ success: false,
+ error: 'Error loading integrations',
+ });
+ }
+});
+
router.post('/app-config/components', (req, res) => {
setTimeout(() => refreshMenu(), 2000);
return componentsMWHandler(req, res);
@@ -1058,7 +1074,7 @@ async function checkUsageLimits(req) {
const maxLimit = isPaidSubscriber
? limitData?.isLimitEnabled
- ? limitData?.limitValue ?? Infinity
+ ? (limitData?.limitValue ?? Infinity)
: Infinity
: freeCredits;
diff --git a/packages/app/src/backend/routes/dbg/router.ts b/packages/app/src/backend/routes/dbg/router.ts
index b8aca5d3..bc4eb535 100644
--- a/packages/app/src/backend/routes/dbg/router.ts
+++ b/packages/app/src/backend/routes/dbg/router.ts
@@ -1,55 +1,25 @@
-import { pipeline, Readable } from 'stream';
-import { promisify } from 'util';
-import express from 'express';
-import axios from 'axios';
import {
- S3Client,
GetObjectCommand,
- HeadObjectCommand,
GetObjectCommandInput,
+ HeadObjectCommand,
+ S3Client,
} from '@aws-sdk/client-s3';
+import axios from 'axios';
+import express from 'express';
+import { pipeline, Readable } from 'stream';
+import { promisify } from 'util';
import config from '../../config';
-import { includeTeamDetails } from '../../middlewares/auth.mw';
import { createProxyMiddleware, Options } from 'http-proxy-middleware';
+import { includeTeamDetails } from '../../middlewares/auth.mw';
const router = express.Router();
const pipelineAsync = promisify(pipeline);
-// const debuggerProxy: any = createProxyMiddleware({
-// target: config.env.API_SERVER, // the target server
-// changeOrigin: false, // needed for virtual hosted sites
-// pathRewrite: {
-// '^/dbg': '', // remove the /proxy prefix when forwarding
-// },
-// onProxyReq: (proxyReq, req: any, res) => {
-// // Log the full URL to which the request is redirected
-// const targetUrl = `//${proxyReq.getHeader('host')}${proxyReq.path}`;
-// console.log(`DBG Proxy Redirecting to: ${targetUrl}`);
-// console.log('body', req.body);
-// console.log('headers', req.headers);
-
-// //const accessToken = req.user.accessToken;
-// //proxyReq.setHeader('Authorization', 'Bearer ' + accessToken);
-
-// // Remove the Cookie header
-// proxyReq.removeHeader('Cookie');
-// },
-// onProxyRes: (proxyRes, req, res) => {
-// console.log('DBG Proxy Response:', proxyRes.statusCode, proxyRes.statusMessage);
-// },
-// onError: (err, req, res) => {
-// console.log(err);
-// },
-// });
-// router.use('/', debuggerProxy);
-
router.get('/debugSession/:id', async (req, res, next) => {
- console.log('DBG Session', req.params.id);
try {
const { id } = req.params;
const url = `${config.env.API_SERVER}/agent/${id}/debugSession`;
- console.log('DBG Session URL', url);
//x-hash-id is configured in smyth load balancer to use user IP by default or custom value if provided
//here we force it to use the real client IP in order to keep debug sessions consistent
@@ -58,10 +28,8 @@ router.get('/debugSession/:id', async (req, res, next) => {
'x-hash-id': client_ip,
'x-smyth-debug': 'true',
};
- console.log('### DBG Session Headers x-hash-id', url, headers);
const result: any = await axios.get(url, { headers });
- console.log('### DBG Session result', result.data);
const dbgSession = result.data?.dbgSession;
res.send({ dbgSession });
@@ -79,12 +47,7 @@ router.post(`/api`, async (req, res) => {
//x-hash-id is configured in smyth load balancer to use user IP by default or custom value if provided
//here we force it to use the real client IP in order to keep debug sessions consistent
const client_ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress;
- console.log(
- 'DBG call with x-hash-id',
- client_ip,
- 'req.socket.remoteAddress',
- req.socket.remoteAddress,
- );
+
const headers = {
'x-hash-id': client_ip,
'x-smyth-debug': 'true',
@@ -116,21 +79,12 @@ const createSSEProxyOptions: (targetUrl: string) => Options = (targetUrl: string
ws: false,
pathRewrite: (path: string) => {
const newPath = path.split('/sse')[1];
- console.log('SSE Path rewrite:', path, '->', newPath);
return newPath;
},
// Configure proxy headers
onProxyReq: (proxyReq: any, req: any, res: any) => {
const hashId = req.headers['x-forwarded-for'] || req.socket.remoteAddress;
- console.log('SSE Proxy Request to:', `${targetUrl}${proxyReq.path}`);
- console.log('SSE Request Headers:', req.headers);
- console.log(
- 'SSE request with x-hash-id',
- hashId,
- 'req.socket.remoteAddress',
- req.socket.remoteAddress,
- );
proxyReq.setHeader('x-hash-id', hashId);
proxyReq.setHeader('x-smyth-debug', 'true');
@@ -139,15 +93,10 @@ const createSSEProxyOptions: (targetUrl: string) => Options = (targetUrl: string
proxyReq.setHeader('Cache-Control', 'no-cache');
proxyReq.removeHeader('Accept-Encoding');
-
- console.log('SSE Modified Headers:', proxyReq.getHeaders());
},
// Handle proxy response
onProxyRes: (proxyRes: any, req: any, res: any) => {
- console.log('SSE Proxy Response Status:', proxyRes.statusCode);
- console.log('SSE Response Headers:', proxyRes.headers);
-
res.writeHead(200, {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache',
@@ -160,8 +109,6 @@ const createSSEProxyOptions: (targetUrl: string) => Options = (targetUrl: string
let buffer = '';
proxyRes.on('data', (chunk: Buffer) => {
- // console.log('SSE Received chunk:', chunk.toString());
-
// Append the new chunk to our buffer
buffer += chunk.toString();
@@ -185,7 +132,6 @@ const createSSEProxyOptions: (targetUrl: string) => Options = (targetUrl: string
if (buffer.trim()) {
res.write(`${buffer}\n\n`);
}
- console.log(`SSE Connection ended after ${messageCount} messages`);
res.end();
});
@@ -194,9 +140,7 @@ const createSSEProxyOptions: (targetUrl: string) => Options = (targetUrl: string
});
// Monitor client disconnection
- req.on('close', () => {
- console.log('SSE Client disconnected');
- });
+ req.on('close', () => {});
},
// Error handling
diff --git a/packages/app/src/backend/routes/router.utils/templates.utils.ts b/packages/app/src/backend/routes/router.utils/templates.utils.ts
index 939228a1..5b7c403f 100644
--- a/packages/app/src/backend/routes/router.utils/templates.utils.ts
+++ b/packages/app/src/backend/routes/router.utils/templates.utils.ts
@@ -2,6 +2,7 @@ import axios from 'axios';
import fs from 'fs';
import path from 'path';
+import { cacheClient } from '@src/backend/services/cache.service';
import config from '../../config';
import SmythFS from '../../services/SmythFS.class';
import { getM2MToken } from '../../services/logto-helper';
@@ -80,56 +81,79 @@ export async function readAgentTemplates(req) {
}
export async function getIntegrations() {
- const integrations = [];
+ const CACHE_KEY = 'smythos-ui-components-integrations';
+ // TODO: cache this
try {
+ const cached = await cacheClient.get(CACHE_KEY).catch(() => null);
+ if (cached) {
+ return JSON.parse(cached);
+ }
+
const token = await getM2MToken();
const result = await axios.get(`${config.api.SMYTH_M2M_API_URL}/app-config/collections`, {
headers: { Authorization: `Bearer ${token}` },
});
const collections = result?.data?.collections || [];
- for (const col of collections) {
+ // Fetch all components for each collection in parallel
+ const componentsPromises = collections.map((col) =>
+ axios
+ .get(`${config.api.SMYTH_M2M_API_URL}/app-config/collections/${col.id}/components`, {
+ headers: { Authorization: `Bearer ${token}` },
+ })
+ .then((response) => ({
+ collectionId: col.id,
+ components: response.data.components || [],
+ })),
+ );
+
+ const componentsResults = await Promise.all(componentsPromises);
+
+ // Transform the data into the expected format
+ const integrations = collections.map((col) => {
const { id, name, color, icon } = col;
- const collection = {
+ const collectionComponents =
+ componentsResults.find((r) => r.collectionId === id)?.components || [];
+
+ return {
name,
label: name,
description: '',
icon,
color: color || '#000000',
- children: [],
+ children: collectionComponents
+ .map((comp) => {
+ let data: any = {};
+ try {
+ data = JSON.parse(comp.data);
+ } catch (e) {
+ // Silent catch for invalid JSON
+ }
+
+ const tplColor = data.templateInfo?.color === '#000000' ? '' : data.templateInfo?.color;
+ return {
+ name: comp.name,
+ label: data.templateInfo?.name || data.name,
+ description: comp.templateInfo?.description || comp.description,
+ icon: data.templateInfo?.icon || icon,
+ color: tplColor || color || '#000000',
+ visible: comp.visible,
+ attributes: { 'smt-template-id': comp.id },
+ };
+ })
+ .filter((c) => c.visible), // REMOVE NON-VISIBLE COMPONENTS
};
+ });
- const componentsResult = await axios.get(
- `${config.api.SMYTH_M2M_API_URL}/app-config/collections/${id}/components`,
- {
- headers: { Authorization: `Bearer ${token}` },
- },
- );
- const components = componentsResult?.data?.components || [];
- collection.children = components.map((comp) => {
- let data: any = {};
- try {
- data = JSON.parse(comp.data);
- } catch (e) {}
-
- let tplColor = data.templateInfo?.color;
- if (tplColor == '#000000') tplColor = '';
- return {
- name: comp.name,
- label: data.templateInfo?.name || data.name,
- description: comp.templateInfo?.description || comp.description,
- icon: data.templateInfo?.icon || icon,
- color: tplColor || color || '#000000',
- visible: comp.visible,
- attributes: { 'smt-template-id': comp.id },
- };
- });
-
- integrations.push(collection);
- //if (collection.children.length > 0) integrations.push(collection);
- }
+ const preparedIntegrations = integrations
+ .filter((i) => i.children.length > 0)
+ .sort((a, b) => a.name.localeCompare(b.name));
+ // cache for 3 minutes
+ await cacheClient
+ .set(CACHE_KEY, JSON.stringify(preparedIntegrations), 'EX', '180')
+ .catch(() => null);
- return integrations;
+ return preparedIntegrations;
} catch (error) {
console.log('error', error);
return [];
diff --git a/packages/app/src/builder-ui/pages/builder/components-menu.ts b/packages/app/src/builder-ui/pages/builder/components-menu.ts
index decc95a4..afcd35bb 100644
--- a/packages/app/src/builder-ui/pages/builder/components-menu.ts
+++ b/packages/app/src/builder-ui/pages/builder/components-menu.ts
@@ -1,5 +1,5 @@
import { EXTENSION_COMP_NAMES } from '../../config';
-import { delay, deleteExtensionHandler, loadDynamicCompMenu, uid } from '../../utils';
+import { delay, deleteExtensionHandler, loadDynamicCompMenu, safe, uid } from '../../utils';
import { Workspace } from '../../workspace/Workspace.class';
import { PRICING_PLAN_REDIRECT } from '@react/shared/constants/navigation';
@@ -19,18 +19,18 @@ const uiServer = config.env.UI_SERVER;
let workspace: Workspace;
export function setupComponentsScripts(_workspace: Workspace) {
workspace = _workspace;
- handleWorkspaceEvents(workspace);
- handleComponentSearch();
- setupGPTExtension();
- setupHuggingFaceExtension();
- setupAgentsExtension();
- setupZapierActionExtension(workspace?.agent);
- setupCollapseAllButton();
- setupPrettifyButton();
- setupZoomInButton();
- setupZoomOutButton();
- setupComponentsCollapseAllButton();
- setupBuilderMenuDragDrop();
+ safe(() => handleWorkspaceEvents(workspace), 'handleWorkspaceEvents');
+ safe(() => handleComponentSearch(), 'handleComponentSearch');
+ safe(() => setupGPTExtension(), 'setupGPTExtension');
+ safe(() => setupHuggingFaceExtension(), 'setupHuggingFaceExtension');
+ safe(() => setupAgentsExtension(), 'setupAgentsExtension');
+ safe(() => setupZapierActionExtension(workspace?.agent), 'setupZapierActionExtension');
+ safe(() => setupCollapseAllButton(), 'setupCollapseAllButton');
+ safe(() => setupPrettifyButton(), 'setupPrettifyButton');
+ safe(() => setupZoomInButton(), 'setupZoomInButton');
+ safe(() => setupZoomOutButton(), 'setupZoomOutButton');
+ safe(() => setupComponentsCollapseAllButton(), 'setupComponentsCollapseAllButton');
+ safe(() => setupBuilderMenuDragDrop(), 'setupBuilderMenuDragDrop');
}
function handleWorkspaceEvents(workspace: Workspace) {
@@ -379,7 +379,7 @@ interface SearchConfig {
* Creates a generic search functionality for a list of items
* @param config - Configuration object for the search functionality
*/
-function setupSearch(config: SearchConfig): void {
+export function setupSearch(config: SearchConfig): void {
const {
searchContainer,
searchInput,
@@ -545,32 +545,6 @@ function handleComponentSearch() {
});
},
});
-
- // Setup search for integrations sidebar
- setupSearch({
- searchContainer: document.querySelector('.integration-search-container'),
- searchInput: document.querySelector('#integrations-cpt-search'),
- clearButton: document.querySelector('.integration-search-container .search-clear-btn'),
- searchIcon: document.querySelector('.integration-search-container .search-glass-icon'),
- itemContainers: document.querySelectorAll(
- '#left-sidebar-integrations-menu .items-group-container',
- ),
- itemSelector: '[smt-component][data-label]',
- searchableAttribute: 'data-label',
- captionSelector: '.name',
- alpine: {
- enabled: true,
- getStoredStateKey: (groupId) => `toggle${groupId}`,
- },
- onSearchStateChange: (isSearching) => {
- const actionButtons = document.querySelectorAll(
- '#left-sidebar-integrations-menu .btn-import, #left-sidebar-integrations-menu .expand-btn',
- );
- actionButtons.forEach((btn: HTMLElement) => {
- if (!isSearching) btn.classList.remove('hidden');
- });
- },
- });
}
/**
diff --git a/packages/app/src/builder-ui/utils/general.utils.ts b/packages/app/src/builder-ui/utils/general.utils.ts
index ad56cfeb..bc82cd1b 100644
--- a/packages/app/src/builder-ui/utils/general.utils.ts
+++ b/packages/app/src/builder-ui/utils/general.utils.ts
@@ -394,3 +394,11 @@ export async function renderDropdown(targetElm: HTMLElement, dropdownElm: HTMLEl
dropdownElm.classList.remove('invisible');
dropdownElm.classList.add('visible');
}
+
+export const safe = (fn: () => void, name: string) => {
+ try {
+ fn();
+ } catch (err) {
+ console.error(`[${name}] failed:`, err);
+ }
+};
diff --git a/packages/app/views/pages/partials/studio/left-sidebar-category.ejs b/packages/app/views/pages/partials/studio/left-sidebar-category.ejs
deleted file mode 100644
index 0fc6acb0..00000000
--- a/packages/app/views/pages/partials/studio/left-sidebar-category.ejs
+++ /dev/null
@@ -1,168 +0,0 @@
-<%
-let dynamic = (typeof entry === 'object' && entry?.type === 'dynamic');
-let sanitizedId = id.replace(/[^a-zA-Z0-9]/g, '');
-let category = id;
-const categoryIcon = icon || '';
-let cssstyle = '';
-let svgstyle = '';
-if (typeof color == 'string' && color) {
- cssstyle += `color:${color};`;
- svgstyle += `fill:${color};`;
-}
-%>
-<% if ((Array.isArray(entry) && entry.length > 0) || (!Array.isArray(entry) && entry)) { %>
-<li>
- <div class="items-group-container navview-menu-group group-<%= category %>"
- x-data="{
- open: true,
- hasItems: false,
- observer: null,
- storageKey: 'toggle<%= sanitizedId %>',
-
- init() {
- // Initialize from localStorage
- this.open = localStorage.getItem(this.storageKey) !== 'false';
-
- if (<%= dynamic %>) {
- this.initDynamicCategory();
- } else {
- this.hasItems = true;
- }
- },
-
- initDynamicCategory() {
- // Initial check
- this.checkItems();
-
- // Set up observer
- this.setupObserver();
-
- // Fallback check every 500ms
- setInterval(() => this.checkItems(), 500);
- },
-
- setupObserver() {
- // Clean up existing observer if any
- if (this.observer) {
- this.observer.disconnect();
- }
-
- // Create new observer
- this.observer = new MutationObserver(() => this.checkItems());
-
- // Observe the entire document for changes
- this.observer.observe(document.body, {
- childList: true,
- subtree: true
- });
- },
-
- checkItems() {
- const items = document.querySelectorAll('.comp-menuitem-list-<%= category %> li');
- let hasValidItems = false;
-
- // Check and clean up items
- items.forEach(item => {
- if (item.innerHTML.trim() !== '' && item.querySelector('a')) {
- hasValidItems = true;
- } else {
- item.remove();
- }
- });
-
- // Update state and auto-close if needed
- this.hasItems = hasValidItems;
- if (!hasValidItems && this.open) {
- this.open = false;
- localStorage.setItem(this.storageKey, 'false');
- }
- },
-
- toggleOpen() {
- if (this.hasItems) {
- this.open = !this.open;
- localStorage.setItem(this.storageKey, this.open);
- }
- }
- }"
- x-init="init()">
- <div @click="toggleOpen()"
- class="group-btn flex justify-between w-full text-sm items-center p-3 text-black transition duration-75 group bg-white"
- :class="{ 'cursor-pointer': hasItems, 'cursor-default': !hasItems }"
- :aria-expanded="hasItems ? open.toString() : 'false'"
- aria-controls="<%= sanitizedId %>">
- <div class="flex w-full items-center">
- <div class="w-[calc(100%_-_16px)]">
- <span class="flex-1 text-left flex items-center justify-between gap-2 select-none" sidebar-toggle-item>
- <div class="flex items-center gap-2">
- <% if (categoryIcon) { %>
- <span class="icon" style="<%= cssstyle %>">
- <% if (categoryIcon.startsWith('fa-')) { %>
- <i class="<%= categoryIcon %>"></i>
- <% } else if (categoryIcon.trim().startsWith('<svg')) { %>
- <span class="svg-icon w-6 h-6">
- <%- categoryIcon.match(/<path(?=.*?\sfill="[^"]*")[^>]*>/gm) ? categoryIcon : categoryIcon.replace(/<path /gm, '<path style="'+svgstyle+'"') %>
- </span>
- <% } else { %>
- <span class="svg-icon <%= categoryIcon %> w-6 h-6"></span>
- <% } %>
- </span>
- <% } %>
- <span class="name max-w-[150px] truncate inline-block"><%= label %></span>
- </div>
- <% if (dynamic) { %>
- <button id="btn-import-<%= category %>"
- @click.stop
- class="btn-import outline-1 outline-gray-200 cursor-pointer items-center justify-center w-4 h-4 p-2 text-sm font-medium text-gray-500 bg-gray-200 rounded-sm hover:text-white hover:font-bold hover:bg-gray-400 inline-flex">+</button>
- <% } %>
- </span>
- </div>
- <template x-if="hasItems">
- <i class="text-xs fa-solid fa-chevron-down transition-transform duration-200"
- :class="open ? 'rotate-0' : '-rotate-90'"></i>
- </template>
- </div>
- </div>
-
- <% if (!dynamic) { %>
- <!-- Static category content -->
- <ul id="<%= sanitizedId %>"
- x-show="open"
- class="items-group space-y-2 py-2 origin-top"
- x-transition:enter="transition ease-out duration-200"
- x-transition:enter-start="opacity-0 transform scale-y-50"
- x-transition:enter-end="opacity-100 transform scale-y-100"
- x-transition:leave="transition ease-out duration-100"
- x-transition:leave-end="opacity-0 transform scale-y-50">
-
- <% entry.forEach((item, index) => { %>
- <%- include('left-sidebar-cptItem', {
- name: item.name,
- level: 1,
- description: item.description,
- label: item.label||item.name,
- visible: (typeof item.visible === 'undefined') || item.visible,
- color: item.color,
- icon: item.icon||item.name,
- attributes: item.attributes||{},
- children: item.children,
- externalLink: item.externalLink
- }) %>
- <% }) %>
- </ul>
- <% } else { %>
- <!-- Dynamic category content -->
- <ul id="<%= sanitizedId %>"
- x-show="hasItems && open"
- x-cloak
- class="comp-menuitem-list comp-menuitem-list-<%= category %> py-2 space-y-2"
- x-transition:enter="transition ease-out duration-200"
- x-transition:enter-start="opacity-0 transform scale-y-50"
- x-transition:enter-end="opacity-100 transform scale-y-100"
- x-transition:leave="transition ease-out duration-100"
- x-transition:leave-end="opacity-0 transform scale-y-50">
- </ul>
- <% } %>
- </div>
-</li>
-<% } %>
\ No newline at end of file
diff --git a/packages/app/views/pages/partials/studio/left-sidebar-cptItem.ejs b/packages/app/views/pages/partials/studio/left-sidebar-cptItem.ejs
deleted file mode 100644
index fad8b673..00000000
--- a/packages/app/views/pages/partials/studio/left-sidebar-cptItem.ejs
+++ /dev/null
@@ -1,109 +0,0 @@
-<li title="<%= label %>">
- <%
- let cssstyle = '';
- let svgstyle = '';
- if (typeof color == 'string' && color) {
- cssstyle += `color:${color};`;
- svgstyle += `fill:${color};`;
- }
- if (typeof children !== 'undefined' && Array.isArray(children)) {
- let sanitizedId = name.replace(/[^a-zA-Z0-9]/g, '');
- %>
- <div class="items-group-container px-2 <%=(!visible || children.length < 1)?'hidden':''%>" x-data="{ open: false }"
- x-init="open = localStorage.getItem('toggle<%= sanitizedId %>') === 'true'">
-
- <button @click="open = !open; localStorage.setItem('toggle<%= sanitizedId %>', open)"
- class="group-btn group flex w-full max-w-[232px] items-center px-2 py-2 text-sm text-black rounded-md bg-gray-100"
- :aria-expanded="open.toString()" aria-controls="<%= sanitizedId %>">
-
- <span class="icon" style="<%= cssstyle %>">
- <% if (icon.startsWith('fa-')) { %>
- <i class="<%= icon %>"></i>
- <% } else if (icon.trim().startsWith('<svg')) { %>
- <span class="svg-icon w-6 h-6">
- <%- icon.match(/<path(?=.*?\sfill="[^"]*")[^>]*>/gm) ? icon : icon.replace(/<path /gm, '<path style="'+svgstyle+'"') %>
- </span>
- <% } else { %>
- <span class="svg-icon <%= icon %> w-6 h-6"></span>
- <% } %>
- </span>
-
- <span class="flex-1 ml-2 whitespace-nowrap text-left max-w-[150px] truncate select-none" data-label="<%= label %>" data-group="true"
- sidebar-toggle-item><span class="name"><%= label %></span></span>
-
- <span class="expand-btn cursor-pointer items-center justify-center
- w-3.5 h-3.5 p-1 ml-2 text-xs font-semibold border
- border-solid border-gray-800 text-gray-800 rounded-full inline-flex" x-text="open ? '-' : '+'"></span>
- </button>
-
- <ul id="<%= sanitizedId %>" x-show="open" x-cloak class="items-group py-2 space-y-2">
- <% children.forEach((item, index) => { %>
- <%- include('left-sidebar-cptItem', { name: item.name, level:2, description: item.description, visible: (typeof item.visible === 'undefined') || item.visible, color:item.color||color, label:item.label||item.name, icon:item.icon||icon||item.name, attributes:item.attributes||{}, children:item.children }) %>
- <% }) %>
- </ul>
- </div>
- <% } else {
- if (visible || isSmythStaff) {
- %>
- <div class="h-9" data-visible="<%= visible%>">
- <% if (typeof externalLink !== 'undefined') { %>
- <a href="<%= externalLink %>" target="_blank" rel="noopener noreferrer"
- class="group flex items-center justify-between h-full pr-2 text-sm rounded-md bg-white <%=level==1 ? 'mx-2 pl-2': 'pl-1'%> text-black">
- <% if (icon) { %>
- <span class="icon" style="<%= cssstyle %>">
- <% if (icon.startsWith('fa')) { %>
- <i class="<%= icon %>"></i>
- <% } else if (icon.trim().startsWith('<svg')) { %>
- <span class="svg-icon w-6 h-6">
- <%- icon.match(/<path(?=.*?\sfill="[^"]*")[^>]*>/gm) ? icon : icon.replace(/<path /gm, '<path style="'+svgstyle+'"') %>
- </span>
- <% } else { %>
- <span class="svg-icon <%= icon %> w-6 h-6"></span>
- <% } %>
- </span>
- <% } %>
- <span class="name flex-1 whitespace-nowrap max-w-[150px] truncate"><%= label %></span>
- <span class="external-link-icon">
- <svg class="w-4 h-4" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M3.5 3C3.22386 3 3 3.22386 3 3.5C3 3.77614 3.22386 4 3.5 4H7.29289L2.64645 8.64645C2.45118 8.84171 2.45118 9.15829 2.64645 9.35355C2.84171 9.54882 3.15829 9.54882 3.35355 9.35355L8 4.70711V8.5C8 8.77614 8.22386 9 8.5 9C8.77614 9 9 8.77614 9 8.5V3.5C9 3.22386 8.77614 3 8.5 3H3.5Z" fill="currentColor"/>
- </svg>
- </span>
- </a>
- <% } else { %>
- <a href="#" data-label="<%= label %>"
- class="group flex items-center justify-between h-full pr-2 text-sm rounded-md bg-white <%=level==1 ? 'mx-2 pl-2': 'pl-1'%> <%= visible ? 'text-black' : 'text-red-600' %>"
- smt-component="<%= name %>" <% for (const attr in attributes) { %><%= attr %>="<%= attributes[attr] %>"
- <% } %>>
-
- <span class="icon" style="<%= cssstyle %>">
- <% if (icon?.startsWith('fa')) { %>
- <i class="<%= icon %>"></i>
- <% } else if (icon?.trim()?.startsWith('<svg')) { %>
- <span class="svg-icon w-6 h-6">
- <%- icon?.match(/<path(?=.*?\sfill="[^"]*")[^>]*>/gm) ? icon : icon?.replace(/<path /gm, '<path style="'+svgstyle+'"') %>
- </span>
- <% } else { %>
- <span class="svg-icon <%= icon %> w-6 h-6"></span>
- <% } %>
- </span>
-
- <span class="name flex-1 whitespace-nowrap max-w-[150px] truncate"><%= label %></span>
-
- <span class="cursor-grab [.dragging_&]:hidden">
- <svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" clip-rule="evenodd" d="M9.26468 18.2891C9.82267 18.2891 10.2754 18.7413 10.2754 19.2998C10.2754 19.8576 9.82326 20.3106 9.26468 20.3106C8.70609 20.3106 8.25391 19.8576 8.25391 19.2998C8.25391 18.7413 8.70669 18.2891 9.26468 18.2891Z" fill="#797979"/>
- <path fill-rule="evenodd" clip-rule="evenodd" d="M9.26468 12.2656C9.82267 12.2656 10.2754 12.7179 10.2754 13.2763C10.2754 13.8342 9.82326 14.2872 9.26468 14.2872C8.70609 14.2872 8.25391 13.8342 8.25391 13.2763C8.25391 12.7179 8.70669 12.2656 9.26468 12.2656Z" fill="#797979"/>
- <path fill-rule="evenodd" clip-rule="evenodd" d="M9.26468 6.24609C9.82267 6.24609 10.2754 6.69833 10.2754 7.25679C10.2754 7.81467 9.82326 8.26765 9.26468 8.26765C8.70609 8.26765 8.25391 7.81467 8.25391 7.25679C8.25391 6.69832 8.70669 6.24609 9.26468 6.24609Z" fill="#797979"/>
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15.7334 18.2891C16.2914 18.2891 16.7442 18.7413 16.7442 19.2998C16.7442 19.8576 16.292 20.3106 15.7334 20.3106C15.1748 20.3106 14.7227 19.8576 14.7227 19.2998C14.7227 18.7413 15.1754 18.2891 15.7334 18.2891Z" fill="#797979"/>
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15.7334 12.2656C16.2914 12.2656 16.7442 12.7179 16.7442 13.2763C16.7442 13.8342 16.292 14.2872 15.7334 14.2872C15.1748 14.2872 14.7227 13.8342 14.7227 13.2763C14.7227 12.7179 15.1754 12.2656 15.7334 12.2656Z" fill="#797979"/>
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15.7334 6.24609C16.2914 6.24609 16.7442 6.69833 16.7442 7.25679C16.7442 7.81467 16.292 8.26765 15.7334 8.26765C15.1748 8.26765 14.7227 7.81467 14.7227 7.25679C14.7227 6.69832 15.1754 6.24609 15.7334 6.24609Z" fill="#797979"/>
- </svg>
- </span>
- </a>
- <% } %>
- </div>
- <%
- }
- } %>
-
-</li>
\ No newline at end of file
diff --git a/packages/app/views/pages/partials/studio/left-sidebar-integrations.ejs b/packages/app/views/pages/partials/studio/left-sidebar-integrations.ejs
deleted file mode 100644
index 0bbee139..00000000
--- a/packages/app/views/pages/partials/studio/left-sidebar-integrations.ejs
+++ /dev/null
@@ -1,74 +0,0 @@
-<div class="h-16 flex flex-shrink-0 p-4">
- <div class="flex items-center justify-between w-full">
- <div class="flex items-center gap-2 text-[#374151]">
- <%- include('icons/plugin') %>
- <span class="text-2xl font-semibold text-v2-gray-darker">Integrations</span>
- </div>
- <button
- type="button"
- class="close-btn p-0.5 rounded-full text-[#757575]"
- data-tooltip-target="tooltip-close-integrations"
- data-tooltip-placement="left"
- @click="toggleSidebar"
- >
- <%- include('icons/close-icon'); -%>
- </button>
- <div
- id="tooltip-close-integrations"
- role="tooltip"
- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- style="font-family: 'Inter', sans-serif"
- >
- Close
- </div>
- </div>
-</div>
-
-<div class="flex items-center p-4 flex-shrink-0 border-solid border-b border-b-gray-200">
- <div class="integration-search-container suggest-box w-full bg-white dark:bg-gray-800 relative">
- <input
- type="search"
- id="integrations-cpt-search"
- autocomplete="off"
- placeholder="Search integrations"
- class="bg-white border text-gray-900 shadow-none sm:text-sm rounded block w-full pl-3 pr-10 py-2.5 border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500 focus:outline-none focus:ring-0 focus:shadow-none transition-colors duration-200"
- />
- <div class="absolute inset-y-0 right-0 flex items-center pr-3 w-7">
- <i class="search-clear-btn fa-solid fa-xmark cursor-pointer text-gray-500 hidden"></i>
- <!-- don't like using icons like this, we'll need to replace this and stick with an icon library -->
- <img class="search-glass-icon" src="/img/home.icons/search.svg" />
- </div>
- </div>
- <button
- id="collapse-all-btn"
- class="p-2 rounded-full hover:bg-gray-100 group relative ml-2"
- data-tooltip-target="tooltip-collapse-all"
- data-tooltip-placement="top"
- >
- <img
- src="/img/home.icons/collapse.svg"
- alt="Collapse all"
- class="w-6 h-6 group-hover:text-primary-600"
- />
- </button>
- <div
- id="tooltip-collapse-all"
- role="tooltip"
- class="tooltip absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 -ml-[2.5rem]! after:absolute after:content-[''] after:border-[6px] after:border-t-gray-900 after:border-x-transparent after:border-b-transparent after:top-full after:left-[calc(50%+16px)] after:-translate-x-1/2"
- >
- Collapse all
- </div>
-</div>
-
-<div class="overflow-y-auto overflow-x-hidden h-[calc(100vh-200px)]">
- <aside id="left-sidebar-integrations-menu" aria-label="Integrations Sidebar" class="p-0 m-0">
- <div class="bg-gray-100">
- <ul class="divide-y divide-solid divide-gray-200">
- <% if (menu.Integrations) { %> <% menu.Integrations.forEach(integration => { %> <%-
- include('left-sidebar-category', { icon: integration.icon || '', label: integration.label,
- id: integration.label.replace(/\s+/g, ''), entry: integration.children }) %> <% }) %> <% }
- %>
- </ul>
- </div>
- </aside>
-</div>
diff --git a/packages/app/views/pages/partials/studio/left-sidebar.ejs b/packages/app/views/pages/partials/studio/left-sidebar.ejs
index 5cff8e9c..47562f2d 100644
--- a/packages/app/views/pages/partials/studio/left-sidebar.ejs
+++ b/packages/app/views/pages/partials/studio/left-sidebar.ejs
@@ -97,58 +97,7 @@
</div>
</div>
- <div class="relative group integrations-btn">
- <button
- id="integrations-button"
- class="relative w-full flex items-center h-10 justify-center"
- @click="setSidebarTab('integrationsTab')"
- data-tooltip-target="tooltip-integrations"
- data-tooltip-placement="right"
- >
- <div
- class="w-8 h-8 flex items-center justify-center transition-colors fill-gray-700 rounded-md"
- :class="{'!bg-gray-700': currentSidebarTab === 'integrationsTab' && isSidebarOpen}"
- >
- <svg
- width="20"
- height="20"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- :class="{'[&>g>path]:!stroke-white': currentSidebarTab === 'integrationsTab' && isSidebarOpen}"
- >
- <mask
- id="mask0_14426_43463"
- style="mask-type: alpha"
- maskUnits="userSpaceOnUse"
- x="0"
- y="0"
- width="24"
- height="24"
- >
- <rect width="24" height="24" fill="#D9D9D9" />
- </mask>
- <g mask="url(#mask0_14426_43463)">
- <path
- d="M18 20.25H14.8862C14.7625 19.548 14.4586 18.9163 13.97 18.3733C13.3102 17.6402 12.4735 17.25 11.5 17.25C10.5265 17.25 9.68978 17.6402 9.03003 18.3733C8.54135 18.9163 8.23748 19.548 8.11382 20.25H5C4.65049 20.25 4.36997 20.1343 4.11783 19.8822C3.86569 19.63 3.75 19.3495 3.75 19V15.8842C4.42572 15.762 5.04171 15.4699 5.58481 15.0097C6.35225 14.3595 6.75 13.5048 6.75 12.5C6.75 11.4952 6.35225 10.6405 5.58481 9.99026C5.04171 9.53013 4.42572 9.23803 3.75 9.11583V6C3.75 5.65049 3.86569 5.36997 4.11783 5.11783C4.36997 4.86569 4.65049 4.75 5 4.75H9H9.75V4C9.75 3.49355 9.9164 3.09426 10.2553 2.75533C10.5943 2.4164 10.9935 2.25 11.5 2.25C12.0065 2.25 12.4057 2.4164 12.7447 2.75533C13.0836 3.09426 13.25 3.49354 13.25 4V4.75H14H18C18.3495 4.75 18.63 4.86569 18.8822 5.11783C19.1343 5.36997 19.25 5.65049 19.25 6V10V10.75H20C20.5065 10.75 20.9057 10.9164 21.2447 11.2553C21.5836 11.5943 21.75 11.9935 21.75 12.5C21.75 13.0065 21.5836 13.4057 21.2447 13.7447C20.9057 14.0836 20.5065 14.25 20 14.25H19.25V15V19C19.25 19.3495 19.1343 19.63 18.8822 19.8822C18.63 20.1343 18.3495 20.25 18 20.25Z"
- stroke="currentColor"
- stroke-width="1.5"
- />
- </g>
- </svg>
- </div>
- </button>
- <div
- id="tooltip-integrations"
- role="tooltip"
- class="tooltip absolute z-10 inline-block text-sm w-max bg-black shadow-lg text-white py-2 px-4 rounded-lg opacity-0 invisible"
- data-popper-reference-hidden=""
- data-popper-escaped=""
- data-popper-placement="bottom"
- >
- Integrations
- </div>
- </div>
+
<!-- Deploy -->
<div class="relative group deploy-btn">
@@ -802,12 +751,7 @@
- <section
- x-show="(currentSidebarTab == 'integrationsTab')"
- class="integrationsTab pb-1 m-0 relative w-full overflow-hidden h-[100%]"
- >
- <%- include('left-sidebar-integrations'); -%>
- </section>
+
</div>
</div>