Skip to content

Commit cf0ec09

Browse files
Merge pull request #62 from techops-services/feature/KEEP-1209-keeperhub-theme
feature/KEEP 1209 Keeperhub theme - fix UI anomalies
2 parents 338a112 + b8c4fcc commit cf0ec09

File tree

4 files changed

+40
-57
lines changed

4 files changed

+40
-57
lines changed

components/workflow/config/action-config.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ import {
2626
TooltipProvider,
2727
TooltipTrigger,
2828
} from "@/components/ui/tooltip";
29+
// start keeperhub
30+
import { integrationRequiresCredentials } from "@/keeperhub/lib/integration-helpers";
31+
// end keeperhub
2932
import { aiGatewayStatusAtom } from "@/lib/ai-gateway/state";
3033
import {
3134
integrationsAtom,
@@ -393,6 +396,14 @@ export function ActionConfig({
393396
return action?.integration as IntegrationType | undefined;
394397
}, [actionType]);
395398

399+
// start keeperhub
400+
// Check if integration requires credentials (some like web3 don't)
401+
const requiresCredentials = useMemo(
402+
() => integrationRequiresCredentials(integrationType),
403+
[integrationType]
404+
);
405+
// end keeperhub
406+
396407
// Check if AI Gateway managed keys should be offered (user can have multiple for different teams)
397408
const shouldUseManagedKeys =
398409
integrationType === "ai-gateway" &&
@@ -496,7 +507,8 @@ export function ActionConfig({
496507
</div>
497508
</div>
498509

499-
{integrationType && isOwner && (
510+
{/* start keeperhub - added requiresCredentials check (upstream: integrationType && isOwner) */}
511+
{integrationType && isOwner && requiresCredentials && (
500512
<div className="space-y-2">
501513
<div className="ml-1 flex items-center justify-between">
502514
<div className="flex items-center gap-1">
@@ -532,6 +544,7 @@ export function ActionConfig({
532544
/>
533545
</div>
534546
)}
547+
{/* end keeperhub */}
535548

536549
{/* System actions - hardcoded config fields */}
537550
<SystemActionFields

components/workflow/node-config-panel.tsx

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ import {
4949
updateNodeDataAtom,
5050
} from "@/lib/workflow-store";
5151

52-
import { findActionById, getIntegration } from "@/plugins";
53-
import { IntegrationSelector } from "../ui/integration-selector";
52+
import { findActionById } from "@/plugins";
5453

5554
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs";
5655
import { ActionConfig } from "./config/action-config";
@@ -916,59 +915,6 @@ export const PanelInner = () => {
916915
Delete
917916
</Button>
918917
</div>
919-
920-
{/* KeeperHub: Integration selector in footer */}
921-
{selectedNode.data.type === "action" &&
922-
(() => {
923-
const actionType = selectedNode.data.config
924-
?.actionType as string;
925-
926-
const SYSTEM_INTEGRATION_MAP: Record<string, string> = {
927-
"Database Query": "database",
928-
};
929-
930-
let integrationType: string | undefined;
931-
let requiresCredentials = true;
932-
933-
if (actionType) {
934-
if (SYSTEM_INTEGRATION_MAP[actionType]) {
935-
integrationType = SYSTEM_INTEGRATION_MAP[actionType];
936-
} else {
937-
const action = findActionById(actionType);
938-
if (action) {
939-
integrationType = action.integration;
940-
const plugin = getIntegration(action.integration);
941-
requiresCredentials =
942-
plugin?.requiresCredentials !== false;
943-
}
944-
}
945-
}
946-
947-
if (integrationType && requiresCredentials) {
948-
return (
949-
<IntegrationSelector
950-
integrationType={integrationType as IntegrationType}
951-
onChange={(id) =>
952-
handleUpdateConfig("integrationId", id)
953-
}
954-
value={
955-
(selectedNode.data.config
956-
?.integrationId as string) || ""
957-
}
958-
/>
959-
);
960-
}
961-
if (integrationType && !requiresCredentials) {
962-
return (
963-
<div className="flex items-center gap-2 rounded-md bg-muted px-3 py-2">
964-
<span className="text-muted-foreground text-sm">
965-
No integration required
966-
</span>
967-
</div>
968-
);
969-
}
970-
return null;
971-
})()}
972918
</div>
973919
)}
974920
</div>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* KeeperHub integration helpers
3+
* These helpers extend upstream functionality for KeeperHub-specific features
4+
*/
5+
6+
import type { IntegrationType } from "@/lib/types/integration";
7+
import { getIntegration } from "@/plugins";
8+
9+
/**
10+
* Check if an integration type requires credentials
11+
* Some integrations (like web3) don't require user credentials
12+
*/
13+
export function integrationRequiresCredentials(
14+
integrationType: IntegrationType | string | undefined
15+
): boolean {
16+
if (!integrationType) {
17+
return false;
18+
}
19+
20+
const plugin = getIntegration(integrationType as IntegrationType);
21+
return plugin?.requiresCredentials !== false;
22+
}

keeperhub/plugins/discord/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ const discordPlugin: IntegrationPlugin = {
1010
icon: DiscordIcon,
1111

1212
// Webhook URL is stored in the integration for centralized management
13+
// start keeperhub - type is 'password' so it shows "Configured" state when editing (upstream: 'url')
1314
formFields: [
1415
{
1516
id: "webhookUrl",
1617
label: "Webhook URL",
17-
type: "url",
18+
type: "password",
1819
placeholder: "https://discord.com/api/webhooks/...",
1920
configKey: "webhookUrl",
2021
envVar: "webhookUrl",
@@ -26,6 +27,7 @@ const discordPlugin: IntegrationPlugin = {
2627
},
2728
},
2829
],
30+
// end keeperhub
2931

3032
actions: [
3133
{

0 commit comments

Comments
 (0)