Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions localization/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@
"Processing include or exclude all differences operation.": "Processing include or exclude all differences operation.",
"Select Profile": "Select Profile",
"Save As...": "Save As...",
"Advanced Publish Options": "Advanced Publish Options",
"Ignore Options": "Ignore Options",
"Exclude Object Types": "Exclude Object Types",
"Create New Connection Group": "Create New Connection Group",
"Edit Connection Group: {0}/{0} is the name of the connection group being edited": {
"message": "Edit Connection Group: {0}",
Expand Down
9 changes: 9 additions & 0 deletions localization/xliff/vscode-mssql.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
<trans-unit id="++CODE++dfa2817fb2221c8b89c47c4fe8326d07c119b7c32e89e509d1061fc596fdf801">
<source xml:lang="en">Advanced Options</source>
</trans-unit>
<trans-unit id="++CODE++fe80d12c71bbc300158260094cf676c1a9f3546b792f027c84e7a91d9fc75b20">
<source xml:lang="en">Advanced Publish Options</source>
</trans-unit>
<trans-unit id="++CODE++08d0861fba87c9910b6c76342c1783be7d5504ff5248fbacd869963a7322992d">
<source xml:lang="en">All permissions for extensions to access your connections have been cleared.</source>
</trans-unit>
Expand Down Expand Up @@ -1323,6 +1326,9 @@
<trans-unit id="++CODE++48d53635551c8fd4564251d49f4e6eba58c2774469144e4346310955fbadbf4c">
<source xml:lang="en">Excel</source>
</trans-unit>
<trans-unit id="++CODE++01ae099f23b8fe85d27a9e26613eb2624bd76e11505385e3493f316afde824c2">
<source xml:lang="en">Exclude Object Types</source>
</trans-unit>
<trans-unit id="++CODE++e3a67d9540e9a204f7dc4aa9d44a0ec652856cfa932a21196bf9df23aa0e4cd1">
<source xml:lang="en">Execute</source>
</trans-unit>
Expand Down Expand Up @@ -1723,6 +1729,9 @@
<trans-unit id="++CODE++d8d462ddc91939459ae107d47fee7a34b3601b20fcd01615f98e1941674f14ea">
<source xml:lang="en">I&apos;m sorry, I can only assist with SQL-related questions.</source>
</trans-unit>
<trans-unit id="++CODE++b37cea142b959c4f6c75754d7b3d56bc41d1a2d6667600c748d7a168f10c8818">
<source xml:lang="en">Ignore Options</source>
</trans-unit>
<trans-unit id="++CODE++1d59e3e131d04ce9ba04c0f297dbd4eddb83c0bfe977b2a6bf19bdeb73f2d5c3">
<source xml:lang="en">Ignore Tenant</source>
</trans-unit>
Expand Down
5 changes: 5 additions & 0 deletions src/constants/locConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,11 @@ export class PublishProject {
public static PublishTargetNewAzureServer = l10n.t("New Azure SQL logical server (Preview)");
public static GenerateScript = l10n.t("Generate Script");
public static Publish = l10n.t("Publish");
public static AdvancedOptions = l10n.t("Advanced");
public static AdvancedPublishSettings = l10n.t("Advanced Publish Options");
public static GeneralOptions = l10n.t("General Options");
public static IgnoreOptions = l10n.t("Ignore Options");
public static ExcludeObjectTypes = l10n.t("Exclude Object Types");
public static SqlServerPortNumber = l10n.t("SQL Server port number");
public static SqlServerAdminPassword = l10n.t("SQL Server admin password");
public static SqlServerAdminPasswordConfirm = l10n.t("Confirm SQL Server admin password");
Expand Down
49 changes: 40 additions & 9 deletions src/publishProject/publishProjectWebViewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export class PublishProjectWebViewController extends FormWebviewController<
lastPublishResult: undefined,
hasFormErrors: true,
deploymentOptions: deploymentOptions,
defaultDeploymentOptions: deploymentOptions
? structuredClone(deploymentOptions)
: undefined,
waitingForNewConnection: false,
} as PublishDialogState,
{
Expand All @@ -89,19 +92,16 @@ export class PublishProjectWebViewController extends FormWebviewController<
},
);

// Clear default excludeObjectTypes for publish dialog, no default exclude options should exist
if (deploymentOptions?.excludeObjectTypes !== undefined) {
deploymentOptions.excludeObjectTypes.value = [];
}

// Store the SQL Projects Service and Connection Manager
this._sqlProjectsService = sqlProjectsService;
this._dacFxService = dacFxService;
this._connectionManager = connectionManager;

// Clear default excludeObjectTypes for publish dialog, no default exclude options should exist
if (
this.state.deploymentOptions &&
this.state.deploymentOptions.excludeObjectTypes !== undefined
) {
this.state.deploymentOptions.excludeObjectTypes.value = [];
}

// Register reducers after initialization
this.registerRpcHandlers();

Expand Down Expand Up @@ -216,6 +216,25 @@ export class PublishProjectWebViewController extends FormWebviewController<
return state;
});

this.registerReducer(
"updateDeploymentOptions",
async (
state: PublishDialogState,
payload: { deploymentOptions: mssql.DeploymentOptions },
) => {
// Update deployment options and regenerate grouped options for UI
const newState = {
...state,
deploymentOptions: payload.deploymentOptions,
};

// Update UI to reflect the changes
this.updateState(newState);

return newState;
},
);

this.registerReducer("selectPublishProfile", async (state: PublishDialogState) => {
// Derive project folder path from the project file path
const projectFolderPath = state.projectFilePath
Expand All @@ -238,6 +257,13 @@ export class PublishProjectWebViewController extends FormWebviewController<
const selectedPath = fileUris[0].fsPath;

try {
// Check if DacFx service is available for loading deployment options
if (!this._dacFxService) {
void vscode.window.showWarningMessage(
`${Loc.DacFxServiceNotAvailable}. Profile loaded without deployment options.`,
);
}

// Parse the profile XML to extract all values, including deployment options from DacFx service
const parsedProfile = await parsePublishProfileXml(
selectedPath,
Expand All @@ -251,7 +277,7 @@ export class PublishProjectWebViewController extends FormWebviewController<
);

// Update state with all parsed values - UI components will consume when available
return {
const newState = {
...state,
formState: {
...state.formState,
Expand All @@ -265,6 +291,11 @@ export class PublishProjectWebViewController extends FormWebviewController<
deploymentOptions:
parsedProfile.deploymentOptions || state.deploymentOptions,
};

// Update UI to reflect the changes
this.updateState(newState);

return newState;
} catch (error) {
void vscode.window.showErrorMessage(
`${Loc.PublishProfileLoadFailed}: ${error}`,
Expand Down
5 changes: 5 additions & 0 deletions src/reactviews/common/locConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,11 @@ export class LocConstants {
SaveAs: l10n.t("Save As..."),
generateScript: l10n.t("Generate Script"),
publish: l10n.t("Publish"),
advancedOptions: l10n.t("Advanced"),
advancedPublishSettings: l10n.t("Advanced Publish Options"),
generalOptions: l10n.t("General Options"),
ignoreOptions: l10n.t("Ignore Options"),
excludeObjectTypes: l10n.t("Exclude Object Types"),
};
}

Expand Down
Loading