From 4c9bfdf4e91b95a5a908eec1bc6c914aff4d5079 Mon Sep 17 00:00:00 2001 From: Hildebrando Chavez Date: Mon, 9 Mar 2026 10:50:19 -0600 Subject: [PATCH] Hide database field for Windows authentication Bump WinForms app version to 1.2.0-dev.4. Update MainView.cs and the VS Code webview providers (profiler-panel-provider.ts and profiler-view-provider.ts) to add a databaseGroup id and DOM logic to manage the database input when Windows auth is selected. --- .../LightQueryProfiler.WinFormsApp.csproj | 2 +- .../Views/MainView.cs | 1 + .../src/views/profiler-panel-provider.ts | 11 ++++++++++- .../src/views/profiler-view-provider.ts | 14 ++++++++++++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/LightQueryProfiler.WinFormsApp/LightQueryProfiler.WinFormsApp.csproj b/src/LightQueryProfiler.WinFormsApp/LightQueryProfiler.WinFormsApp.csproj index eb81d21..444f2e8 100644 --- a/src/LightQueryProfiler.WinFormsApp/LightQueryProfiler.WinFormsApp.csproj +++ b/src/LightQueryProfiler.WinFormsApp/LightQueryProfiler.WinFormsApp.csproj @@ -8,7 +8,7 @@ enable true LightQueryProfiler - 1.2.0-dev.3 + 1.2.0-dev.4 1.2.0 1.2.0 Icons\light-query-profiler.ico diff --git a/src/LightQueryProfiler.WinFormsApp/Views/MainView.cs b/src/LightQueryProfiler.WinFormsApp/Views/MainView.cs index 209deb8..29ec23d 100644 --- a/src/LightQueryProfiler.WinFormsApp/Views/MainView.cs +++ b/src/LightQueryProfiler.WinFormsApp/Views/MainView.cs @@ -240,6 +240,7 @@ private void ComboAuthentication_SelectionChangeCommitted(object? sender, EventA toolStripSeparator4.Visible = false; tslDatabase.Visible = false; tstDatabase.Visible = false; + tstDatabase.Text = string.Empty; } else if ((Shared.Enums.AuthenticationMode)selectedAuthenticationMode == Shared.Enums.AuthenticationMode.AzureSQLDatabase) { diff --git a/vscode-extension/src/views/profiler-panel-provider.ts b/vscode-extension/src/views/profiler-panel-provider.ts index 55ede20..807d4a7 100644 --- a/vscode-extension/src/views/profiler-panel-provider.ts +++ b/vscode-extension/src/views/profiler-panel-provider.ts @@ -734,7 +734,7 @@ export class ProfilerPanelProvider { -
+
@@ -795,6 +795,7 @@ export class ProfilerPanelProvider { const passwordInput = document.getElementById('password'); const usernameGroup = document.getElementById('usernameGroup'); const passwordGroup = document.getElementById('passwordGroup'); + const databaseGroup = document.getElementById('databaseGroup'); const startBtn = document.getElementById('startBtn'); const pauseBtn = document.getElementById('pauseBtn'); const resumeBtn = document.getElementById('resumeBtn'); @@ -813,8 +814,16 @@ export class ProfilerPanelProvider { // Update auth mode visibility authMode.addEventListener('change', () => { const mode = parseInt(authMode.value); + const isWindowsAuth = mode === 0; const requiresCredentials = mode === 1 || mode === 2; + if (isWindowsAuth) { + databaseGroup.classList.add('hidden'); + databaseInput.value = ''; + } else { + databaseGroup.classList.remove('hidden'); + } + if (requiresCredentials) { usernameGroup.classList.remove('hidden'); passwordGroup.classList.remove('hidden'); diff --git a/vscode-extension/src/views/profiler-view-provider.ts b/vscode-extension/src/views/profiler-view-provider.ts index b76c9e4..7edf924 100644 --- a/vscode-extension/src/views/profiler-view-provider.ts +++ b/vscode-extension/src/views/profiler-view-provider.ts @@ -734,7 +734,7 @@ export class ProfilerViewProvider implements vscode.WebviewViewProvider {
-
+
@@ -803,6 +803,7 @@ export class ProfilerViewProvider implements vscode.WebviewViewProvider { const password = document.getElementById('password'); const usernameGroup = document.getElementById('usernameGroup'); const passwordGroup = document.getElementById('passwordGroup'); + const databaseGroup = document.getElementById('databaseGroup'); const startBtn = document.getElementById('startBtn'); const pauseBtn = document.getElementById('pauseBtn'); const resumeBtn = document.getElementById('resumeBtn'); @@ -818,7 +819,16 @@ export class ProfilerViewProvider implements vscode.WebviewViewProvider { // Update credential fields visibility based on auth mode authMode.addEventListener('change', () => { const mode = parseInt(authMode.value); - const showCredentials = mode !== 0; // 0 = Windows Auth + const isWindowsAuth = mode === 0; + const showCredentials = !isWindowsAuth; + + if (isWindowsAuth) { + databaseGroup.style.display = 'none'; + (database as HTMLInputElement).value = ''; + } else { + databaseGroup.style.display = 'block'; + } + usernameGroup.style.display = showCredentials ? 'block' : 'none'; passwordGroup.style.display = showCredentials ? 'block' : 'none'; });