Skip to content

Commit 15f73a6

Browse files
committed
add project name to integration management screen
1 parent be53cd0 commit 15f73a6

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

src/notebooks/deepnote/integrations/integrationWebview.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,16 @@ export class IntegrationWebviewProvider implements IIntegrationWebviewProvider {
409409
}));
410410
logger.debug(`IntegrationWebviewProvider: Sending ${integrationsData.length} integrations to webview`);
411411

412+
// Get the project name from the notebook manager
413+
let projectName: string | undefined;
414+
if (this.projectId) {
415+
const project = this.notebookManager.getOriginalProject(this.projectId);
416+
projectName = project?.project.name;
417+
}
418+
412419
await this.currentPanel.webview.postMessage({
413420
integrations: integrationsData,
421+
projectName,
414422
type: 'update'
415423
});
416424
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export interface IIntegrationPanelProps {
2020

2121
export const IntegrationPanel: React.FC<IIntegrationPanelProps> = ({ baseTheme, vscodeApi }) => {
2222
const [integrations, setIntegrations] = React.useState<IntegrationWithStatus[]>([]);
23+
const [projectName, setProjectName] = React.useState<string | undefined>(undefined);
2324
const [selectedIntegrationId, setSelectedIntegrationId] = React.useState<string | null>(null);
2425
const [selectedConfig, setSelectedConfig] = React.useState<ConfigurableDatabaseIntegrationConfig | null>(null);
2526
const [selectedIntegrationDefaultName, setSelectedIntegrationDefaultName] = React.useState<string | undefined>(
@@ -66,6 +67,7 @@ export const IntegrationPanel: React.FC<IIntegrationPanelProps> = ({ baseTheme,
6667

6768
case 'update':
6869
setIntegrations(msg.integrations);
70+
setProjectName(msg.projectName);
6971
break;
7072

7173
case 'showForm':
@@ -205,6 +207,7 @@ export const IntegrationPanel: React.FC<IIntegrationPanelProps> = ({ baseTheme,
205207
return (
206208
<div className={`integration-panel theme-${baseTheme}`}>
207209
<h1>{getLocString('integrationsTitle', 'Deepnote Integrations')}</h1>
210+
{projectName && <p className="project-name">{projectName}</p>}
208211

209212
{message && <div className={`message message-${message.type}`}>{message.text}</div>}
210213

src/webviews/webview-side/integrations/integrations.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99

1010
.integration-panel h1 {
1111
margin-top: 0;
12-
margin-bottom: 20px;
12+
margin-bottom: 8px;
1313
font-size: 1.5em;
1414
font-weight: 600;
1515
}
1616

17+
.project-name {
18+
margin-top: 0;
19+
margin-bottom: 20px;
20+
color: var(--vscode-descriptionForeground);
21+
font-size: 0.95em;
22+
}
23+
1724
/* Message styles */
1825
.message {
1926
padding: 12px 16px;

src/webviews/webview-side/integrations/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface IVsCodeMessage {
2323
export interface UpdateMessage {
2424
type: 'update';
2525
integrations: IntegrationWithStatus[];
26+
projectName?: string;
2627
}
2728

2829
export interface ShowFormMessage {

0 commit comments

Comments
 (0)