Skip to content

Commit 9d4f53b

Browse files
committed
feat: add display name field and fix status display in integration UI
1 parent 734cdac commit 9d4f53b

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

src/notebooks/deepnote/integrations/integrationWebview.ts

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,15 @@ export class IntegrationWebviewProvider {
374374
}
375375
376376
listEl.innerHTML = integrations.map(integration => {
377-
const statusClass = integration.status === 1 ? 'status-connected' : 'status-disconnected';
378-
const statusText = integration.status === 1 ? 'Connected' : 'Not Configured';
377+
const statusClass = integration.status === 'connected' ? 'status-connected' : 'status-disconnected';
378+
const statusText = integration.status === 'connected' ? 'Connected' : 'Not Configured';
379379
const configureText = integration.config ? 'Reconfigure' : 'Configure';
380+
const displayName = integration.config?.name || integration.id;
380381
381382
return \`
382383
<div class="integration-item">
383384
<div class="integration-info">
384-
<div class="integration-name">\${integration.id}</div>
385+
<div class="integration-name">\${displayName}</div>
385386
<div class="integration-status \${statusClass}">\${statusText}</div>
386387
</div>
387388
<div class="integration-actions">
@@ -458,6 +459,10 @@ export class IntegrationWebviewProvider {
458459
if (type === 'postgres') {
459460
formContainer.innerHTML = \`
460461
<h2>Configure PostgreSQL: \${currentIntegrationId}</h2>
462+
<div class="form-group">
463+
<label>Display Name:</label>
464+
<input type="text" id="name" value="\${config?.name || ''}" placeholder="My PostgreSQL Database" required>
465+
</div>
461466
<div class="form-group">
462467
<label>Host:</label>
463468
<input type="text" id="host" value="\${config?.host || ''}" placeholder="localhost" required>
@@ -486,6 +491,10 @@ export class IntegrationWebviewProvider {
486491
} else if (type === 'bigquery') {
487492
formContainer.innerHTML = \`
488493
<h2>Configure BigQuery: \${currentIntegrationId}</h2>
494+
<div class="form-group">
495+
<label>Display Name:</label>
496+
<input type="text" id="name" value="\${config?.name || ''}" placeholder="My BigQuery Project" required>
497+
</div>
489498
<div class="form-group">
490499
<label>GCP Project ID:</label>
491500
<input type="text" id="projectId" value="\${config?.projectId || ''}" placeholder="my-gcp-project" required>
@@ -505,9 +514,15 @@ export class IntegrationWebviewProvider {
505514
}
506515
507516
function savePostgresConfig() {
517+
const name = document.getElementById('name').value.trim();
518+
if (!name) {
519+
showMessage('Display name is required', 'error');
520+
return;
521+
}
522+
508523
const config = {
509524
id: currentIntegrationId,
510-
name: currentIntegrationId,
525+
name: name,
511526
type: 'postgres',
512527
host: document.getElementById('host').value,
513528
port: parseInt(document.getElementById('port').value),
@@ -520,6 +535,12 @@ export class IntegrationWebviewProvider {
520535
}
521536
522537
function saveBigQueryConfig() {
538+
const name = document.getElementById('name').value.trim();
539+
if (!name) {
540+
showMessage('Display name is required', 'error');
541+
return;
542+
}
543+
523544
const credentials = document.getElementById('credentials').value;
524545
525546
// Validate JSON
@@ -532,7 +553,7 @@ export class IntegrationWebviewProvider {
532553
533554
const config = {
534555
id: currentIntegrationId,
535-
name: currentIntegrationId,
556+
name: name,
536557
type: 'bigquery',
537558
projectId: document.getElementById('projectId').value,
538559
credentials: credentials

0 commit comments

Comments
 (0)