Skip to content

Commit 2c4529c

Browse files
authored
Code analysis Dialog UI improvements (#21451)
* Updated checks and removed focus to output channel * adding missing preview to the tag * loc * remove the preview tag * adding role as per copilot suggestion
1 parent c91df3c commit 2c4529c

7 files changed

Lines changed: 35 additions & 10 deletions

File tree

extensions/mssql/l10n/bundle.l10n.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@
244244
"message": "{0} of {1} rules",
245245
"comment": ["{0} is the filtered count, {1} is the total count"]
246246
},
247+
"Rule enabled": "Rule enabled",
248+
"Rule disabled": "Rule disabled",
247249
"Create new firewall rule for {0}/{0} is the server name that the firewall rule will be created for": {
248250
"message": "Create new firewall rule for {0}",
249251
"comment": ["{0} is the server name that the firewall rule will be created for"]

extensions/mssql/src/codeAnalysis/codeAnalysisWebViewController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ export class CodeAnalysisWebViewController extends ReactWebviewPanelController<
169169
}
170170
if (payload.closeAfterSave) {
171171
this.vscodeWrapper.logToOutputChannel(Loc.rulesSaved);
172-
this.vscodeWrapper.outputChannel.show();
173172
this.panel.dispose();
174173
}
175174
// Update the baseline rules so the component's useEffect resets isDirty

extensions/mssql/src/reactviews/common/locConstants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ export class LocConstants {
265265
args: [filtered, total],
266266
comment: ["{0} is the filtered count, {1} is the total count"],
267267
}),
268+
ruleEnabled: l10n.t("Rule enabled"),
269+
ruleDisabled: l10n.t("Rule disabled"),
268270
};
269271
}
270272

extensions/mssql/src/reactviews/pages/CodeAnalysis/codeAnalysis.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
ChevronDown20Regular,
3333
ChevronRight20Regular,
3434
Search20Regular,
35+
Checkmark20Regular,
3536
} from "@fluentui/react-icons";
3637
import { DialogHeader } from "../../common/dialogHeader.component";
3738
import { DialogMessage } from "../../common/dialogMessage";
@@ -115,6 +116,14 @@ const useStyles = makeStyles({
115116
gap: "8px",
116117
paddingLeft: "56px",
117118
},
119+
checkmarkContainer: {
120+
width: "20px",
121+
height: "20px",
122+
display: "flex",
123+
alignItems: "center",
124+
justifyContent: "center",
125+
flexShrink: 0,
126+
},
118127

119128
// --- States ---
120129
spinnerContainer: {
@@ -487,13 +496,20 @@ export const CodeAnalysisDialog = () => {
487496
<TableRow key={rule.ruleId}>
488497
<TableCell className={styles.tableCell}>
489498
<div className={styles.childRuleContent}>
490-
<Checkbox
491-
aria-hidden={true}
492-
checked={rule.enabled}
493-
disabled={!rule.enabled}
494-
style={{ pointerEvents: "none" }}
495-
tabIndex={-1}
496-
/>
499+
<div
500+
className={
501+
styles.checkmarkContainer
502+
}
503+
role="img"
504+
aria-label={
505+
rule.enabled
506+
? loc.ruleEnabled
507+
: loc.ruleDisabled
508+
}>
509+
{rule.enabled && (
510+
<Checkmark20Regular aria-hidden="true" />
511+
)}
512+
</div>
497513
<Text>
498514
{rule.shortRuleId}:{" "}
499515
{rule.displayName}

extensions/sql-database-projects/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"sqlDatabaseProjects.publish": "Publish",
1212
"sqlDatabaseProjects.createProjectFromDatabase": "Create Project From Database",
1313
"sqlDatabaseProjects.updateProjectFromDatabase": "Update Project From Database",
14-
"sqlDatabaseProjects.configureCodeAnalysisSettings": "Code Analysis Settings (Preview)",
14+
"sqlDatabaseProjects.configureCodeAnalysisSettings": "Code Analysis Settings",
1515
"sqlDatabaseProjects.properties": "Properties",
1616
"sqlDatabaseProjects.schemaCompare": "Schema Compare",
1717
"sqlDatabaseProjects.delete": "Delete",

localization/xliff/sql-database-projects.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@
994994
<source xml:lang="en">Close Database Project</source>
995995
</trans-unit>
996996
<trans-unit id="sqlDatabaseProjects.configureCodeAnalysisSettings">
997-
<source xml:lang="en">Code Analysis Settings (Preview)</source>
997+
<source xml:lang="en">Code Analysis Settings</source>
998998
</trans-unit>
999999
<trans-unit id="sqlDatabaseProjects.convertToSdkStyleProject">
10001000
<source xml:lang="en">Convert to SDK-style project</source>

localization/xliff/vscode-mssql.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4974,6 +4974,12 @@
49744974
<trans-unit id="++CODE++141b69f95916694982e525599db8205af7ecd6ced92d36c8aec6c5a9daa1e90e">
49754975
<source xml:lang="en">Rows per page</source>
49764976
</trans-unit>
4977+
<trans-unit id="++CODE++24601cef1cab3c7af34a853118337c5ac35833d0713571295bdfc7b9b37b994c">
4978+
<source xml:lang="en">Rule disabled</source>
4979+
</trans-unit>
4980+
<trans-unit id="++CODE++57993e10706c49eb54a633479451efd91636bee3f329ca3345632046c4b8060c">
4981+
<source xml:lang="en">Rule enabled</source>
4982+
</trans-unit>
49774983
<trans-unit id="++CODE++7c9de4e8e989511f39c9c515352856dbfe290c6de0e123d12cc60972e8fa8bf3">
49784984
<source xml:lang="en">Rule name</source>
49794985
</trans-unit>

0 commit comments

Comments
 (0)