Skip to content

Commit 3fa65ad

Browse files
committed
show "no integration" when sql block is not connected
1 parent 430fec2 commit 3fa65ad

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/notebooks/deepnote/sqlCellStatusBarProvider.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,25 @@ export class SqlCellStatusBarProvider implements NotebookCellStatusBarItemProvid
9898
private async createStatusBarItems(cell: NotebookCell): Promise<NotebookCellStatusBarItem[]> {
9999
const items: NotebookCellStatusBarItem[] = [];
100100

101-
// Add integration status bar item if integration ID is present
101+
// Add integration status bar item
102102
const integrationId = this.getIntegrationId(cell);
103103
if (integrationId) {
104104
const integrationItem = await this.createIntegrationStatusBarItem(cell, integrationId);
105105
if (integrationItem) {
106106
items.push(integrationItem);
107107
}
108+
} else {
109+
// Show "No integration connected" when no integration is selected
110+
items.push({
111+
text: `$(database) ${l10n.t('No integration connected')}`,
112+
alignment: 1, // NotebookCellStatusBarAlignment.Left
113+
tooltip: l10n.t('No SQL integration connected\nClick to select an integration'),
114+
command: {
115+
title: l10n.t('Switch Integration'),
116+
command: 'deepnote.switchSqlIntegration',
117+
arguments: [cell]
118+
}
119+
});
108120
}
109121

110122
// Always add variable status bar item for SQL cells

src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,25 @@ suite('SqlCellStatusBarProvider', () => {
3838
assert.isUndefined(result);
3939
});
4040

41-
test('returns only variable status bar item for SQL cells without integration ID', async () => {
41+
test('returns status bar items for SQL cells without integration ID', async () => {
4242
const cell = createMockCell('sql', {});
4343

4444
const result = await provider.provideCellStatusBarItems(cell, cancellationToken);
4545

4646
assert.isDefined(result);
4747
assert.isArray(result);
4848
const items = result as any[];
49-
assert.strictEqual(items.length, 1);
49+
assert.strictEqual(items.length, 2);
50+
51+
// Check "No integration connected" status bar item
52+
const integrationItem = items[0];
53+
assert.strictEqual(integrationItem.text, '$(database) No integration connected');
54+
assert.strictEqual(integrationItem.alignment, 1);
55+
assert.isDefined(integrationItem.command);
56+
assert.strictEqual(integrationItem.command.command, 'deepnote.switchSqlIntegration');
5057

5158
// Check variable status bar item
52-
const variableItem = items[0];
59+
const variableItem = items[1];
5360
assert.strictEqual(variableItem.text, 'Variable: df');
5461
assert.strictEqual(variableItem.alignment, 1);
5562
assert.isDefined(variableItem.command);

0 commit comments

Comments
 (0)