Skip to content
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

feat: Support multiple organizations API key. #68

Merged
merged 9 commits into from
Sep 28, 2023
Merged

Conversation

meniRoy
Copy link
Contributor

@meniRoy meniRoy commented Sep 25, 2023

on login when there is more then one org connected to the auth key open Quick-pick dialog and let the user pick the org
image

note: I have conducted a manual QA, and everything appears to be in order, but I strongly recommend that one more person conduct manual QA before the release.

@meniRoy
Copy link
Contributor Author

meniRoy commented Sep 25, 2023

src/auth.ts Outdated
Comment on lines 15 to 19
private selectedOrgId: string | undefined;

public getSelectedOrg() {
return this.selectedOrgId;
}

Choose a reason for hiding this comment

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

why hold the this id in 2 different places, shouldn't there be a single source of truth? ( probably here and not in api client )

Copy link
Contributor Author

@meniRoy meniRoy Sep 26, 2023

Choose a reason for hiding this comment

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

I completely agree. I chose this approach because it aligns with our existing method of managing user credentials.

When I was creating the auth service, my intention was to pass an instance of it to the API client to avoid this very issue. However, I received this comment

4c8a496
also saved selected org id in store

Choose a reason for hiding this comment

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

I think its up to you 👍🏻
this was the only important comment approving 👍🏻

src/auth.ts Show resolved Hide resolved
try {
return apiClient.getEnvironments(organizationId);
return apiClient.getEnvironments();
} catch (e) {
console.log(e);

Choose a reason for hiding this comment

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

where do console logs go in a vs code extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

19cf61c
we don’t need this function anymore because we handle errors from getEnvironments here

Choose a reason for hiding this comment

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

I was just asking for general knowledge 👍🏻

src/test/integration/mocks/server.ts Show resolved Hide resolved
@meniRoy
Copy link
Contributor Author

meniRoy commented Sep 26, 2023

set organization quick peek property, ignore focus out to true.
b1adc4d
ca64d88

@meniRoy meniRoy requested a review from alonnoga September 26, 2023 22:38
Copy link

@alonnoga alonnoga left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@meniRoy meniRoy merged commit 95cd7d9 into main Sep 28, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants