Skip to content

Commit 01697cc

Browse files
committed
fix: show integration name/type from project when not configured
1 parent 59b90a9 commit 01697cc

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

src/messageTypes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ export type LocalizedMessages = {
179179
integrationsConfigureTitle: string;
180180
integrationsCancel: string;
181181
integrationsSave: string;
182+
// Integration type labels
183+
integrationsPostgresTypeLabel: string;
184+
integrationsBigQueryTypeLabel: string;
182185
// PostgreSQL form strings
183186
integrationsPostgresNameLabel: string;
184187
integrationsPostgresNamePlaceholder: string;

src/notebooks/deepnote/integrations/integrationWebview.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export class IntegrationWebviewProvider implements IIntegrationWebviewProvider {
128128
integrationsConfirmResetMessage: localize.Integrations.confirmResetMessage,
129129
integrationsConfirmResetDetails: localize.Integrations.confirmResetDetails,
130130
integrationsConfigureTitle: localize.Integrations.configureTitle,
131+
integrationsPostgresTypeLabel: localize.Integrations.postgresTypeLabel,
132+
integrationsBigQueryTypeLabel: localize.Integrations.bigQueryTypeLabel,
131133
integrationsCancel: localize.Integrations.cancel,
132134
integrationsSave: localize.Integrations.save,
133135
integrationsRequiredField: localize.Integrations.requiredField,

src/platform/common/utils/localize.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,10 @@ export namespace Integrations {
831831
export const requiredField = l10n.t('*');
832832
export const optionalField = l10n.t('(optional)');
833833

834+
// Integration type labels
835+
export const postgresTypeLabel = l10n.t('PostgreSQL');
836+
export const bigQueryTypeLabel = l10n.t('BigQuery');
837+
834838
// PostgreSQL form strings
835839
export const postgresNameLabel = l10n.t('Name (optional)');
836840
export const postgresNamePlaceholder = l10n.t('My PostgreSQL Database');

src/webviews/webview-side/integrations/IntegrationItem.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
import * as React from 'react';
22
import { getLocString } from '../react-common/locReactSide';
3-
import { IntegrationWithStatus } from './types';
3+
import { IntegrationWithStatus, IntegrationType } from './types';
44

55
export interface IIntegrationItemProps {
66
integration: IntegrationWithStatus;
77
onConfigure: (integrationId: string) => void;
88
onDelete: (integrationId: string) => void;
99
}
1010

11+
const getIntegrationTypeLabel = (type: IntegrationType): string => {
12+
switch (type) {
13+
case 'postgres':
14+
return getLocString('integrationsPostgresTypeLabel', 'PostgreSQL');
15+
case 'bigquery':
16+
return getLocString('integrationsBigQueryTypeLabel', 'BigQuery');
17+
default:
18+
return type;
19+
}
20+
};
21+
1122
export const IntegrationItem: React.FC<IIntegrationItemProps> = ({ integration, onConfigure, onDelete }) => {
1223
const statusClass = integration.status === 'connected' ? 'status-connected' : 'status-disconnected';
1324
const statusText =
@@ -17,7 +28,15 @@ export const IntegrationItem: React.FC<IIntegrationItemProps> = ({ integration,
1728
const configureText = integration.config
1829
? getLocString('integrationsReconfigure', 'Reconfigure')
1930
: getLocString('integrationsConfigure', 'Configure');
20-
const displayName = integration.config?.name || integration.id;
31+
32+
// Get the name: prefer config name, then project name, then ID
33+
const name = integration.config?.name || integration.projectName || integration.id;
34+
35+
// Get the type: prefer config type, then project type
36+
const type = integration.config?.type || integration.projectType;
37+
38+
// Build display name with type
39+
const displayName = type ? `${name} (${getIntegrationTypeLabel(type)})` : name;
2140

2241
return (
2342
<div className="integration-item">

0 commit comments

Comments
 (0)