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: change status bar color when in production org setting #5519

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

PierreVanobbergen
Copy link

fix #5517

What does this PR do?

Create a setting to allow the status bar to change color when the default org is a production one

What issues does this PR fix or reference?

Check #5517 for details

Create a setting to allow the status bar to change color when the default org is a production one

fix forcedotcom#5517
Copy link

Thanks for the contribution! Before we can merge this, we need @PierreVanobbergen to sign the Salesforce Inc. Contributor License Agreement.

@PierreVanobbergen
Copy link
Author

Some notes about the feature/PR:

  • The code will change the User settings and not the Workspace setting, as it would modify the file under .vscode/settings.json that could be tracked in version control
  • The Japanese translation was made using DeepL, I'm not fluent at all, so if it's important, it needs to be checked.
  • I would like some feedback about the OrgAuthInfo.isAProductionOrgto see if it's the correct way to deduce if an org is a production one

Thank you :)

@CristiCanizales
Copy link
Contributor

Hi @PierreVanobbergen, thank you for this contribution! I just saw the video you shared in the issue, and the comment I have is that the color should apply to only the org picker (that element where the org alias is displayed), because we have other items in the bottom bar that have colors according to the state and we would miss that with how this is working now. Do you think you could limit the feature to just the org picker? Thanks!

export const colorWhenProductionOrg = async () => {
const baseColorStatusBar = new vscode.ThemeColor('statusBar.background');

const colorWHenProductionOrgHandler = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo colorWHenProductionOrgHandler -> colorWhenProductionOrgHandler

};

WorkspaceContext.getInstance().onOrgChange(() =>
colorWHenProductionOrgHandler()
Copy link
Contributor

Choose a reason for hiding this comment

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

fix typo

*/
vscode.window.onDidChangeWindowState(async e => {
if (e.focused) {
await colorWHenProductionOrgHandler();
Copy link
Contributor

Choose a reason for hiding this comment

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

And here as well

);
}
});
return await colorWHenProductionOrgHandler();
Copy link
Contributor

Choose a reason for hiding this comment

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

And one more here

@@ -114,6 +114,15 @@ export class OrgAuthInfo {
);
}

public static async isAProductionOrg(username: string): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@peternhale is there an affirmative case for "this is a production org"? I'm not seeing that in these docs, so it's looking like Production would be the fallback case.

Copy link
Contributor

Choose a reason for hiding this comment

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

@randi274 Yes. production should be the fallback.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it! @interfaceconjurer and I were chatting about this detail today, it might be worth y'all discussing the possibility of "Production" being overly inclusive.

@PierreVanobbergen
Copy link
Author

Hi @PierreVanobbergen, thank you for this contribution! I just saw the video you shared in the issue, and the comment I have is that the color should apply to only the org picker (that element where the org alias is displayed), because we have other items in the bottom bar that have colors according to the state and we would miss that with how this is working now. Do you think you could limit the feature to just the org picker? Thanks!

I thought about just changing the color of the org picker as well, but I feel that it might not be enough of an eye catcher 👀 .
I would like to keep the status bar color change, but maybe having the setting to be where the change happens might be the way. Like this:
image

We might even add more element later in the picklist.

What do you think about it @CristiCanizales ?

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.

Add setting to change the StatusBar color when working in a production org
4 participants