Skip to content

Commit 513f460

Browse files
Provide Project and User parameters to Studio add-ins (#1402)
* Provide Project and User parameters to Studio add-ins * Push updated package-lock.json * Avoid adding empty Project queryparam
1 parent 54a0e43 commit 513f460

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/serverActions.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,13 @@ export async function serverActions(): Promise<void> {
255255
});
256256
if (addin) {
257257
const token = await getCSPToken(api, addin.id);
258-
vscode.env.openExternal(
259-
vscode.Uri.parse(`${serverUrl}${addin.id}?Namespace=${nsEncoded}&CSPCHD=${token}`)
260-
);
258+
let params = `Namespace=${nsEncoded}`;
259+
params += `&User=${encodeURIComponent(username)}`;
260+
if (project !== "") {
261+
params += `&Project=${encodeURIComponent(project)}`;
262+
}
263+
params += `&CSPCHD=${token}`;
264+
vscode.env.openExternal(vscode.Uri.parse(`${serverUrl}${addin.id}?${params}`));
261265
}
262266
}
263267
break;

0 commit comments

Comments
 (0)