Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
3d91b3f
refactor App.vue by removing assetType and schedule, and add go to f…
DjamilaBaroudi Jun 25, 2025
4c8675f
add cloud link functionality to BruinPanel and App.vue, including pro…
DjamilaBaroudi Jun 30, 2025
15351a7
Merge branch 'main' into feature/add-open-asset-in-bruin-cloud
DjamilaBaroudi Jun 30, 2025
cca9d97
move setting project name to the extension settings and update packag…
DjamilaBaroudi Jun 30, 2025
58d1f07
update icon for cloud button in App.vue
DjamilaBaroudi Jun 30, 2025
bbf1a3d
implement dynamic title for cloud button in App.vue based on project …
DjamilaBaroudi Jun 30, 2025
87d8a21
add configuration change listener in BruinPanel to refresh webview on…
DjamilaBaroudi Jun 30, 2025
6df4be6
add getProjectName function and update BruinPanel to notify on projec…
DjamilaBaroudi Jun 30, 2025
8180711
refactor test assertions in BruinQueryOutput and BruinQueryExport for…
DjamilaBaroudi Jun 30, 2025
96e00a5
add open asset in cloud tests to extension.test.ts
DjamilaBaroudi Jun 30, 2025
90a7987
add id attribute to cloud button in App.vue for improved accessibility
DjamilaBaroudi Jun 30, 2025
6c1ee26
refactor mouse leave behavior in AssetDetails.vue and remove console …
DjamilaBaroudi Jun 30, 2025
6513be6
add cloud feature integration tests to webview-tests for improved fun…
DjamilaBaroudi Jun 30, 2025
8bd6ccb
enhance webview tests with improved hover behavior and cloud button f…
DjamilaBaroudi Jun 30, 2025
aa84e3c
Merge branch 'main' into feature/add-open-asset-in-bruin-cloud
DjamilaBaroudi Jul 1, 2025
fa29783
Merge branch 'main' into feature/add-open-asset-in-bruin-cloud
DjamilaBaroudi Jul 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@
"type": "string",
"default": "",
"description": "Sets the validate exclude tag to be used with validation commands."
},
"bruin.cloud.projectName": {
"type": "string",
"default": "",
"description": "Bruin Cloud project name for opening assets in cloud links."
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions src/extension/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
return config.get<string>("validate.defaultExcludeTag", "");
}

export function getProjectName(): string {
const config = vscode.workspace.getConfiguration("bruin");
return config.get<string>("cloud.projectName", "");
}

export function getPathSeparator(): string {
const bruinConfig = vscode.workspace.getConfiguration("bruin");
const pathSeparator = bruinConfig.get<string>("pathSeparator") || "/";
Expand Down Expand Up @@ -129,5 +134,11 @@
if (e.affectsConfiguration("bruin.FoldingState")) {
resetDocumentStates();
}
if (e.affectsConfiguration("bruin.cloud.projectName")) {
// Notify all BruinPanel instances of the project name change
const { BruinPanel } = require("../panels/BruinPanel");

Check warning on line 139 in src/extension/configuration.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest)

Variable name `BruinPanel` must match one of the following formats: camelCase, UPPER_CASE

Check warning on line 139 in src/extension/configuration.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

Variable name `BruinPanel` must match one of the following formats: camelCase, UPPER_CASE

Check warning on line 139 in src/extension/configuration.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Variable name `BruinPanel` must match one of the following formats: camelCase, UPPER_CASE
const projectName = getProjectName();
BruinPanel.notifyProjectNameChange(projectName);
}
});
}
43 changes: 42 additions & 1 deletion src/panels/BruinPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { getBruinExecutablePath } from "../providers/BruinExecutableService";
import path = require("path");
import { isBruinAsset } from "../utilities/helperUtils";

import { getDefaultCheckboxSettings, getDefaultExcludeTag } from "../extension/configuration";
import { getDefaultCheckboxSettings, getDefaultExcludeTag, getProjectName } from "../extension/configuration";
import { exec } from "child_process";
import { flowLineageCommand } from "../extension/commands/FlowLineageCommand";

Expand Down Expand Up @@ -94,6 +94,7 @@ export class BruinPanel {
}
}),


window.onDidChangeActiveTextEditor(async (editor) => {
console.log("onDidChangeActiveTextEditor", editor);
if (editor && editor.document.uri) {
Expand Down Expand Up @@ -144,6 +145,16 @@ export class BruinPanel {
}
}

public static notifyProjectNameChange(projectName: string) {
if (BruinPanel.currentPanel?._panel) {
console.log("Notifying BruinPanel of project name change:", projectName);
BruinPanel.currentPanel._panel.webview.postMessage({
command: "bruin.projectName",
projectName: projectName,
});
}
}

/**
* Renders the current webview panel if it exists otherwise a new webview panel
* will be created and displayed.
Expand Down Expand Up @@ -648,6 +659,36 @@ export class BruinPanel {
console.log("Getting pipeline assets");
flowLineageCommand(this._lastRenderedDocumentUri, "BruinPanel");
break;
case "bruin.openAssetUrl":
const url = message.url;
if (url) {
try {
console.log("Opening external URL:", url);
await vscode.env.openExternal(vscode.Uri.parse(url));
} catch (error) {
console.error("Error opening URL:", error);
vscode.window.showErrorMessage(`Failed to open URL: ${url}`);
}
}
break;
case "bruin.getProjectName":
const projectName = getProjectName();
this._panel.webview.postMessage({
command: "bruin.projectName",
projectName: projectName,
});
break;
case "bruin.setProjectName":
const newProjectName = message.projectName;
if (newProjectName) {
const config = workspace.getConfiguration("bruin");
await config.update("cloud.projectName", newProjectName, vscode.ConfigurationTarget.Global);
this._panel.webview.postMessage({
command: "bruin.projectNameSet",
success: true,
});
}
break;
}
},
undefined,
Expand Down
Loading
Loading