-
Notifications
You must be signed in to change notification settings - Fork 542
Publish Dialog - Connection section #20309
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
base: sai/vscodePublishDialog_2Profile
Are you sure you want to change the base?
Publish Dialog - Connection section #20309
Conversation
…hDialog_3ServerConnection
…hDialog_3ServerConnection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements a connection selection workflow for the Publish Project dialog, enabling users to select SQL Server connections and databases through an improved UI. The changes integrate ConnectionManager
to track active connections, automatically populate server and database fields when a new connection is made, and provide a streamlined experience with a "Select Connection" button and database dropdown.
Key Changes:
- Added connection selection workflow that opens a connection dialog and auto-populates server/database fields when a new connection is established
- Converted database input field to a combobox dropdown populated with databases from the selected server connection
- Added connection string management for publish profiles with different handling for container vs. server targets
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
test/unit/publishProjectWebViewController.test.ts |
Added mock ConnectionManager to tests and updated test descriptions for clarity |
src/sharedInterfaces/publishDialog.ts |
Added connection-related state properties and openConnectionDialog reducer interface |
src/reactviews/pages/PublishProject/publishProjectStateProvider.tsx |
Integrated openConnectionDialog action into the state provider |
src/reactviews/pages/PublishProject/components/PublishTargetSection.tsx |
Applied consistent styling wrapper to the publish target section |
src/reactviews/pages/PublishProject/components/PublishProfileSection.tsx |
Applied consistent styling wrapper to the publish profile section |
src/reactviews/pages/PublishProject/components/FormFieldComponents.tsx |
Added renderCombobox function and contentAfter option to renderInput for custom content after input fields |
src/reactviews/pages/PublishProject/components/ConnectionSection.tsx |
Refactored to use read-only server input with connection button and combobox for database selection |
src/reactviews/index.css |
Added styling for Combobox component to match VS Code theme |
src/publishProject/publishProjectWebViewController.ts |
Integrated ConnectionManager , added connection listener, implemented auto-selection logic, and added database dropdown management based on publish target |
src/publishProject/formComponentHelpers.ts |
Updated form generation to create database as dropdown with initial options and added placeholder for server field |
src/controllers/mainController.ts |
Passed ConnectionManager instance to PublishProjectWebViewController constructor |
src/constants/locConstants.ts |
Added ServerConnectionPlaceholder localization constant |
localization/xliff/vscode-mssql.xlf |
Added "Select Connection" translation entry |
localization/l10n/bundle.l10n.json |
Added "Select Connection" localization entry |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/reactviews/pages/PublishProject/components/FormFieldComponents.tsx
Outdated
Show resolved
Hide resolved
src/reactviews/pages/PublishProject/components/FormFieldComponents.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the event used for listening to new connections.
…hDialog_3ServerConnection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
const connectionProfile = connection?.credentials as IConnectionProfile; | ||
|
||
if (!connectionProfile || !connectionProfile.server) { | ||
return; // Connection no longer available or invalid |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The connection is retrieved from activeConnections without checking if it exists before accessing credentials. If the connection doesn't exist, connection
will be undefined, and connection?.credentials
will be undefined, which is then cast to IConnectionProfile. The subsequent check on line 356 for !connectionProfile
may not catch all error cases. Consider checking !connection
first before accessing credentials.
const connectionProfile = connection?.credentials as IConnectionProfile; | |
if (!connectionProfile || !connectionProfile.server) { | |
return; // Connection no longer available or invalid | |
if (!connection) { | |
return; // Connection no longer available | |
} | |
const connectionProfile = connection.credentials as IConnectionProfile; | |
if (!connectionProfile || !connectionProfile.server) { | |
return; // Connection profile invalid |
Copilot uses AI. Check for mistakes.
…hDialog_3ServerConnection
Pull Request Template – vscode-mssql
Description
Once connected:
The Database field auto-populates with available databases.
Code Changes Checklist
npm run test
)Reviewers: Please read our reviewer guidelines