Skip to content

Commit

Permalink
SLVSCODE-1041 hide region selector instead of not creating it
Browse files Browse the repository at this point in the history
  • Loading branch information
sophio-japharidze-sonarsource committed Feb 26, 2025
1 parent 4df3fcc commit 7d68269
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/connected/connectionsetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,16 @@ function renderServerUrlField(initialState, mode) {
<input type="hidden" id="serverUrl-initial" value="${serverUrl}" />`;
}

if (isDogfoodingEnvironment()) {
// SonarQube Cloud connection - pre-populate region field if available
const region = initialState.conn.region ?? 'EU';
const euChecked = region === 'EU' ? 'checked' : '';
const usChecked = region === 'US' ? 'checked' : '';
return `<vscode-radio-group orientation=vertical id="region" ${mode === 'update' ? 'disabled' : ''}>
<label slot="label">Select the SonarQube Cloud instance you would like to connect to</label>
<vscode-radio ${euChecked} value="EU"><b>EU</b> - sonarcloud.io</vscode-radio>
<vscode-radio ${usChecked} value="US"><b>US</b> - us.sonarcloud.io</vscode-radio>
</vscode-radio-group>`;
}
return '';
// SonarQube Cloud connection - pre-populate region field if available
const hidden = !isDogfoodingEnvironment();
const region = initialState.conn.region ?? 'EU';
const euChecked = region === 'EU' ? 'checked' : '';
const usChecked = region === 'US' ? 'checked' : '';
return `<vscode-radio-group orientation=vertical id="region" ${mode === 'update' ? 'disabled' : ''} ${hidden ? 'hidden' : ''}>
<label slot="label">Select the SonarQube Cloud instance you would like to connect to</label>
<vscode-radio ${euChecked} value="EU"><b>EU</b> - sonarcloud.io</vscode-radio>
<vscode-radio ${usChecked} value="US"><b>US</b> - us.sonarcloud.io</vscode-radio>
</vscode-radio-group>`;
}

function renderGenerateTokenButton(connection, serverProductName) {
Expand Down

0 comments on commit 7d68269

Please sign in to comment.