WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ada7c6a

Browse files
[Port] Adding fabric warning for dacpac dialog and small fix to styles (#20604)
* Follow up fixes after PR merge (#20519) - Added when clause to DacPac commands in command palette to respect mssql.experimentalFeaturesEnabled flag #20512 - Renamed DacPac commands to grouped naming convention (mssql.dacpacDialog.*) #20513 - Added OS-specific localization for "Reveal in Explorer" button (Windows/macOS/Linux) #20511 - Extracted Data-tier Applications documentation URL to constants - Updated application version validation to accept 2-part versions (e.g., 1.0) #20514 - Changed validation state to display warnings * Adding fabric warning for dacpac dialog and small fix to styles (#20599) * adding fabric warning for dacpac dialog and small fix to styles * lint fixes * localization changes
1 parent 038e0ef commit ada7c6a

File tree

11 files changed

+163
-38
lines changed

11 files changed

+163
-38
lines changed

mssql/localization/l10n/bundle.l10n.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,8 @@
854854
"A database with this name already exists on the server": "A database with this name already exists on the server",
855855
"Application version must be in format n.n.n or n.n.n.n where n is a number (e.g., 1.0.0.0)": "Application version must be in format n.n.n or n.n.n.n where n is a number (e.g., 1.0.0.0)",
856856
"Learn More": "Learn More",
857+
"Fabric targets are currently not supported in this preview, and we are working to improve the experience.": "Fabric targets are currently not supported in this preview, and we are working to improve the experience.",
858+
"Learn more about this issue.": "Learn more about this issue.",
857859
"Save Changes": "Save Changes",
858860
"Add Row": "Add Row",
859861
"Show Script": "Show Script",

mssql/localization/xliff/vscode-mssql.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,9 @@
15701570
<note>{0} is the error code
15711571
{1} is the error message</note>
15721572
</trans-unit>
1573+
<trans-unit id="++CODE++c85fb96bbfbe33bde4a67a8e9223c63dc3a3f817428e22ff8357a1ae30f6f4eb">
1574+
<source xml:lang="en">Fabric targets are currently not supported in this preview, and we are working to improve the experience.</source>
1575+
</trans-unit>
15731576
<trans-unit id="++CODE++031a8f0f659df890dfd53c92e45295b0f14c997185bae46e168831e403b273f7">
15741577
<source xml:lang="en">Failed</source>
15751578
</trans-unit>
@@ -2129,6 +2132,9 @@
21292132
<trans-unit id="++CODE++51da53a813a79b97741fb115a94a72fe1629a0b0e9018767157ca28d863c53e3">
21302133
<source xml:lang="en">Learn more about SQL Server 2025 features</source>
21312134
</trans-unit>
2135+
<trans-unit id="++CODE++11c56d1016670369a74f4b7d2d2ec8959e8098b44e778fd4e3a3548bd846826b">
2136+
<source xml:lang="en">Learn more about this issue.</source>
2137+
</trans-unit>
21322138
<trans-unit id="++CODE++adc95605a1b30c73959fbaf21e60f9723efe855c482fa336a957924d4ea0a08b">
21332139
<source xml:lang="en">Length</source>
21342140
</trans-unit>

mssql/src/controllers/dacpacDialogWebviewController.ts

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import * as dacpacDialog from "../sharedInterfaces/dacpacDialog";
2121
import { TaskExecutionMode } from "../sharedInterfaces/schemaCompare";
2222
import { ListDatabasesRequest } from "../models/contracts/connection";
2323
import { IConnectionDialogProfile } from "../sharedInterfaces/connectionDialog";
24-
import { getConnectionDisplayName } from "../models/connectionInfo";
24+
import { getConnectionDisplayName, getServerTypes, ServerType } from "../models/connectionInfo";
2525
import {
2626
validateDatabaseNameFormat,
2727
DatabaseNameValidationError,
@@ -715,6 +715,19 @@ export class DacpacDialogWebviewController extends ReactWebviewPanelController<
715715
}
716716
}
717717

718+
/**
719+
* Checks if a connection profile is connected to a Fabric server
720+
*/
721+
private isFabricConnection(profile: IConnectionDialogProfile): boolean {
722+
try {
723+
const serverTypes = getServerTypes(profile as vscodeMssql.IConnectionInfo);
724+
return serverTypes.includes(ServerType.Fabric);
725+
} catch (error) {
726+
this.logger.error(`Failed to determine server type: ${error}`);
727+
return false;
728+
}
729+
}
730+
718731
/**
719732
* Initializes connection based on initial state from Object Explorer or previous session
720733
* Handles auto-matching and auto-connecting to provide seamless user experience
@@ -730,6 +743,7 @@ export class DacpacDialogWebviewController extends ReactWebviewPanelController<
730743
ownerUri?: string;
731744
autoConnected: boolean;
732745
errorMessage?: string;
746+
isFabric?: boolean;
733747
}> {
734748
try {
735749
// Get all connections
@@ -755,18 +769,21 @@ export class DacpacDialogWebviewController extends ReactWebviewPanelController<
755769
};
756770
}
757771

772+
// Check if this is a Fabric connection
773+
const isFabric = this.isFabricConnection(matchingConnection.profile);
774+
758775
// Handle existing connection from Object Explorer
759776
if (params.initialOwnerUri) {
760777
const existingConnResult = this.useExistingConnection(
761778
matchingConnection.profile,
762779
params.initialOwnerUri,
763780
);
764-
return { ...existingConnResult, connections };
781+
return { ...existingConnResult, connections, isFabric };
765782
}
766783

767784
// Attempt to connect to the matched profile
768785
const connectResult = await this.connectToMatchedProfile(matchingConnection.profile);
769-
return { ...connectResult, connections };
786+
return { ...connectResult, connections, isFabric };
770787
} catch (error) {
771788
this.logger.error(`Failed to initialize connection: ${error}`);
772789
// Fallback: return empty state
@@ -842,9 +859,12 @@ export class DacpacDialogWebviewController extends ReactWebviewPanelController<
842859
/**
843860
* Connects to a server using the specified profile ID
844861
*/
845-
private async connectToServer(
846-
profileId: string,
847-
): Promise<{ ownerUri: string; isConnected: boolean; errorMessage?: string }> {
862+
private async connectToServer(profileId: string): Promise<{
863+
ownerUri: string;
864+
isConnected: boolean;
865+
errorMessage?: string;
866+
isFabric?: boolean;
867+
}> {
848868
try {
849869
// Find the profile in saved connections
850870
const savedConnections =
@@ -863,13 +883,17 @@ export class DacpacDialogWebviewController extends ReactWebviewPanelController<
863883
};
864884
}
865885

886+
// Check if this is a Fabric connection
887+
const isFabric = this.isFabricConnection(profile as IConnectionDialogProfile);
888+
866889
// Check if already connected and the connection is valid
867890
let ownerUri = this.connectionManager.getUriForConnection(profile);
868891
if (ownerUri && this.connectionManager.isConnected(ownerUri)) {
869892
// Connection is active and valid
870893
return {
871894
ownerUri,
872895
isConnected: true,
896+
isFabric,
873897
};
874898
}
875899

@@ -884,6 +908,7 @@ export class DacpacDialogWebviewController extends ReactWebviewPanelController<
884908
return {
885909
ownerUri,
886910
isConnected: true,
911+
isFabric,
887912
};
888913
} else {
889914
// Check if connection failed due to error or if it was never initiated
@@ -897,6 +922,7 @@ export class DacpacDialogWebviewController extends ReactWebviewPanelController<
897922
ownerUri: "",
898923
isConnected: false,
899924
errorMessage,
925+
isFabric,
900926
};
901927
}
902928
} catch (error) {

mssql/src/reactviews/common/locConstants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,10 @@ export class LocConstants {
12761276
"Application version must be in format n.n.n or n.n.n.n where n is a number (e.g., 1.0.0.0)",
12771277
),
12781278
learnMore: l10n.t("Learn More"),
1279+
fabricWarning: l10n.t(
1280+
"Fabric targets are currently not supported in this preview, and we are working to improve the experience.",
1281+
),
1282+
fabricWarningLearnMore: l10n.t("Learn more about this issue."),
12791283
};
12801284
}
12811285

mssql/src/reactviews/pages/DacpacDialog/ServerSelectionSection.tsx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { Dropdown, Field, makeStyles, Option, Spinner } from "@fluentui/react-components";
6+
import { Dropdown, Field, Link, makeStyles, Option, Spinner } from "@fluentui/react-components";
77
import { IConnectionDialogProfile } from "../../../sharedInterfaces/connectionDialog";
88
import { locConstants } from "../../common/locConstants";
99

@@ -22,6 +22,7 @@ interface ServerSelectionSectionProps {
2222
isOperationInProgress: boolean;
2323
validationMessages: Record<string, ValidationMessage>;
2424
onServerChange: (profileId: string) => void;
25+
isFabric?: boolean;
2526
}
2627

2728
const useStyles = makeStyles({
@@ -30,6 +31,11 @@ const useStyles = makeStyles({
3031
flexDirection: "column",
3132
gap: "12px",
3233
},
34+
fabricWarning: {
35+
marginTop: "4px",
36+
fontSize: "12px",
37+
color: "var(--vscode-descriptionForeground)",
38+
},
3339
});
3440

3541
export const ServerSelectionSection = ({
@@ -39,6 +45,7 @@ export const ServerSelectionSection = ({
3945
isOperationInProgress,
4046
validationMessages,
4147
onServerChange,
48+
isFabric = false,
4249
}: ServerSelectionSectionProps) => {
4350
const classes = useStyles();
4451

@@ -47,9 +54,11 @@ export const ServerSelectionSection = ({
4754
<Field
4855
label={locConstants.dacpacDialog.serverLabel}
4956
required
50-
validationMessage={validationMessages.connection?.message}
57+
validationMessage={isFabric ? undefined : validationMessages.connection?.message}
5158
validationState={
52-
validationMessages.connection?.severity === "error" ? "error" : "none"
59+
!isFabric && validationMessages.connection?.severity === "error"
60+
? "error"
61+
: "none"
5362
}>
5463
{isConnecting ? (
5564
<Spinner size="tiny" label={locConstants.dacpacDialog.connectingToServer} />
@@ -89,6 +98,16 @@ export const ServerSelectionSection = ({
8998
</Dropdown>
9099
)}
91100
</Field>
101+
{isFabric && (
102+
<div className={classes.fabricWarning}>
103+
{locConstants.dacpacDialog.fabricWarning}{" "}
104+
<Link
105+
href="https://github.com/microsoft/vscode-mssql/issues/20568"
106+
target="_blank">
107+
{locConstants.dacpacDialog.fabricWarningLearnMore}
108+
</Link>
109+
</div>
110+
)}
92111
</div>
93112
);
94113
};

mssql/src/reactviews/pages/DacpacDialog/SourceDatabaseSection.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface SourceDatabaseSectionProps {
2323
validationMessages: Record<string, ValidationMessage>;
2424
showDatabaseSource: boolean;
2525
showNewDatabase: boolean;
26+
isFabric?: boolean;
2627
}
2728

2829
const useStyles = makeStyles({
@@ -42,6 +43,7 @@ export const SourceDatabaseSection = ({
4243
validationMessages,
4344
showDatabaseSource,
4445
showNewDatabase,
46+
isFabric = false,
4547
}: SourceDatabaseSectionProps) => {
4648
const classes = useStyles();
4749

@@ -66,7 +68,7 @@ export const SourceDatabaseSection = ({
6668
value={databaseName}
6769
selectedOptions={[databaseName]}
6870
onOptionSelect={(_, data) => setDatabaseName(data.optionText || "")}
69-
disabled={isOperationInProgress || !ownerUri}
71+
disabled={isOperationInProgress || !ownerUri || isFabric}
7072
aria-label={locConstants.dacpacDialog.sourceDatabaseLabel}>
7173
{availableDatabases.map((db) => (
7274
<Option key={db} value={db}>
@@ -88,7 +90,7 @@ export const SourceDatabaseSection = ({
8890
value={databaseName}
8991
onChange={(_, data) => setDatabaseName(data.value)}
9092
placeholder={locConstants.dacpacDialog.enterDatabaseName}
91-
disabled={isOperationInProgress}
93+
disabled={isOperationInProgress || isFabric}
9294
aria-label={locConstants.dacpacDialog.databaseNameLabel}
9395
/>
9496
</Field>

mssql/src/reactviews/pages/DacpacDialog/TargetDatabaseSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface TargetDatabaseSectionProps {
3232
isOperationInProgress: boolean;
3333
ownerUri: string;
3434
validationMessages: Record<string, ValidationMessage>;
35+
isFabric?: boolean;
3536
}
3637

3738
const useStyles = makeStyles({
@@ -56,6 +57,7 @@ export const TargetDatabaseSection = ({
5657
isOperationInProgress,
5758
ownerUri,
5859
validationMessages,
60+
isFabric = false,
5961
}: TargetDatabaseSectionProps) => {
6062
const classes = useStyles();
6163

@@ -70,7 +72,7 @@ export const TargetDatabaseSection = ({
7072
<Radio
7173
value="new"
7274
label={locConstants.dacpacDialog.newDatabase}
73-
disabled={isOperationInProgress}
75+
disabled={isOperationInProgress || isFabric}
7476
aria-label={locConstants.dacpacDialog.newDatabase}
7577
/>
7678
<Radio

0 commit comments

Comments
 (0)