Skip to content

Provide Project and User parameters to Studio add-ins #1402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
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.

8 changes: 5 additions & 3 deletions src/commands/serverActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ 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)}`;
params += `&Project=${encodeURIComponent(project)}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't have a project (which will be most cases), should we not pass the parameter instead of passing it with an empty value? I don't know if that matters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I have pushed a change to do that.

params += `&CSPCHD=${token}`;
vscode.env.openExternal(vscode.Uri.parse(`${serverUrl}${addin.id}?${params}`));
}
}
break;
Expand Down