diff --git a/packages/vscode-extension/CHANGELOG.md b/packages/vscode-extension/CHANGELOG.md index 236943ae1..b914030b5 100644 --- a/packages/vscode-extension/CHANGELOG.md +++ b/packages/vscode-extension/CHANGELOG.md @@ -8,7 +8,7 @@ - Add command to run single cypher statement (ctrl+enter) and add new keybind for running all statements (ctrl+alt/cmd+enter) - Modify run button to run selected text on selection and otherwise run single statement at cursor - Auto-focus on query results panel when running query -- Minor bugfixes (handling new linter naming scheme, formatter capitalizing preparser keywords in namespaces, linter terminating on slow queries, missing label warnings, queries needing implicit transactions, "run cypher" keybind being active when cypher can't be run, formatting of dynamic labels, duplication in connections pane when db uses clustering (ex. aura business critical), linter switching for aura, point printing alignment with cypher shell) +- Minor bugfixes (handling new linter naming scheme, formatter capitalizing preparser keywords in namespaces, linter terminating on slow queries, missing label warnings, queries needing implicit transactions, "run cypher" keybind being active when cypher can't be run, formatting of dynamic labels, duplication in connections pane when db uses clustering (ex. aura business critical), linter switching for aura, point printing alignment with cypher shell, empty fields being forbidden in the password/user fields when adding a connection) ## 1.13.0 - Adjusts linting automatically depending on the neo4j version. diff --git a/packages/vscode-extension/src/webviews/controllers/connectionPanelController.ts b/packages/vscode-extension/src/webviews/controllers/connectionPanelController.ts index 330904414..2e4906773 100644 --- a/packages/vscode-extension/src/webviews/controllers/connectionPanelController.ts +++ b/packages/vscode-extension/src/webviews/controllers/connectionPanelController.ts @@ -13,41 +13,28 @@ declare const vscode: vscode; /** * Validates a Connection object and a password from the webview form.ƒ - * @param connection The Connection object to validate. Only scheme, host, user, and password are required. + * @param connection The Connection object to validate. Only scheme and host are required. * @param password The password to validate. * @returns True if the connection is valid, false otherwise. */ -export function validateConnection( - connection: Connection | null, - password: string, -): boolean { +export function validateConnection(connection: Connection | null): boolean { highlightInvalidFields(); - return ( - !connection || - (!!connection.scheme && - !!connection.host && - !!connection.user && - !!password) - ); + return !connection || (!!connection.scheme && !!connection.host); } /** * Highlights any invalid fields in the webview form by toggling the invalid class. - * Only scheme, host, user, and password are required. + * Only scheme and host are required. */ export function highlightInvalidFields(): void { const scheme = document.getElementById('scheme') as HTMLInputElement; const host = document.getElementById('host') as HTMLInputElement; - const user = document.getElementById('user') as HTMLInputElement; - const password = document.getElementById('password') as HTMLInputElement; scheme.classList.toggle( 'invalid', !scheme.value || !isValidScheme(scheme.value), ); host.classList.toggle('invalid', !host.value); - user.classList.toggle('invalid', !user.value); - password.classList.toggle('invalid', !password.value); } /** @@ -123,7 +110,7 @@ export function onSubmit(event: Event): boolean { const connection = getConnection(); const password = getPassword(); - if (!validateConnection(connection, password)) { + if (!validateConnection(connection)) { vscode.postMessage({ command: 'onValidationError', });