Skip to content

Commit

Permalink
Provide Project and User parameters to Studio add-ins (#1402)
Browse files Browse the repository at this point in the history
* Provide Project and User parameters to Studio add-ins

* Push updated package-lock.json

* Avoid adding empty Project queryparam
  • Loading branch information
gjsjohnmurray authored Jul 22, 2024
1 parent 54a0e43 commit 513f460
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/commands/serverActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,13 @@ export async function serverActions(): Promise<void> {
});
if (addin) {
const token = await getCSPToken(api, addin.id);
vscode.env.openExternal(
vscode.Uri.parse(`${serverUrl}${addin.id}?Namespace=${nsEncoded}&CSPCHD=${token}`)
);
let params = `Namespace=${nsEncoded}`;
params += `&User=${encodeURIComponent(username)}`;
if (project !== "") {
params += `&Project=${encodeURIComponent(project)}`;
}
params += `&CSPCHD=${token}`;
vscode.env.openExternal(vscode.Uri.parse(`${serverUrl}${addin.id}?${params}`));
}
}
break;
Expand Down

0 comments on commit 513f460

Please sign in to comment.