-
Notifications
You must be signed in to change notification settings - Fork 226
Fix button accessibility #2719
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
Merged
Merged
Fix button accessibility #2719
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
493c9cb
Add story for compare table
koesie10 b066366
Use button instead of a for compare table queries
koesie10 3dd8583
Use button instead of a for clickable location links
koesie10 90a39ec
Use button instead of a for raw results link
koesie10 a5c675b
Add story for ResultTablesHeader
koesie10 2888fdd
Move all ResultTablesHeader styles to styled-components
koesie10 1d2ef80
Merge remote-tracking branch 'origin/main' into koesie10/fix-button-a…
koesie10 d90fb69
Merge branch 'main' into koesie10/fix-button-accessibility
robertbrignull File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
extensions/ql-vscode/src/stories/compare/CompareTable.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import * as React from "react"; | ||
|
|
||
| import { Meta, StoryFn } from "@storybook/react"; | ||
|
|
||
| import CompareTableComponent from "../../view/compare/CompareTable"; | ||
|
|
||
| import "../../view/results/resultsView.css"; | ||
|
|
||
| export default { | ||
| title: "Compare/Compare Table", | ||
| component: CompareTableComponent, | ||
| } as Meta<typeof CompareTableComponent>; | ||
|
|
||
| const Template: StoryFn<typeof CompareTableComponent> = (args) => ( | ||
| <CompareTableComponent {...args} /> | ||
| ); | ||
|
|
||
| export const CompareTable = Template.bind({}); | ||
| CompareTable.args = { | ||
| comparison: { | ||
| t: "setComparisons", | ||
| stats: { | ||
| fromQuery: { | ||
| name: "Query built from user-controlled sources", | ||
| status: "finished in 0 seconds", | ||
| time: "8/16/2023, 3:08:37 PM", | ||
| }, | ||
| toQuery: { | ||
| name: "Query built from user-controlled sources", | ||
| status: "finished in 2 seconds", | ||
| time: "8/16/2023, 3:07:21 PM", | ||
| }, | ||
| }, | ||
| columns: [ | ||
| { name: "a", kind: "e" }, | ||
| { name: "b", kind: "e" }, | ||
| ], | ||
| commonResultSetNames: ["edges", "nodes", "subpaths", "#select"], | ||
| currentResultSetName: "edges", | ||
| rows: { | ||
| from: [], | ||
| to: [ | ||
| [ | ||
| { | ||
| label: "url : String", | ||
| url: { | ||
| uri: "file:/home/runner/work/sql2o-example/sql2o-example/src/main/java/org/example/HelloController.java", | ||
| startLine: 22, | ||
| startColumn: 27, | ||
| endLine: 22, | ||
| endColumn: 57, | ||
| }, | ||
| }, | ||
| { | ||
| label: "url", | ||
| url: { | ||
| uri: "file:/home/runner/work/sql2o-example/sql2o-example/src/main/java/org/example/HelloController.java", | ||
| startLine: 23, | ||
| startColumn: 33, | ||
| endLine: 23, | ||
| endColumn: 35, | ||
| }, | ||
| }, | ||
| ], | ||
| ], | ||
| }, | ||
| message: undefined, | ||
| databaseUri: "file:///java", | ||
| }, | ||
| }; |
54 changes: 54 additions & 0 deletions
54
extensions/ql-vscode/src/stories/results/ResultTablesHeader.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import * as React from "react"; | ||
|
|
||
| import { Meta, StoryFn } from "@storybook/react"; | ||
|
|
||
| import { ResultTablesHeader as ResultTablesHeaderComponent } from "../../view/results/ResultTablesHeader"; | ||
|
|
||
| import "../../view/results/resultsView.css"; | ||
|
|
||
| export default { | ||
| title: "Results/Result Tables Header", | ||
| component: ResultTablesHeaderComponent, | ||
| } as Meta<typeof ResultTablesHeaderComponent>; | ||
|
|
||
| const Template: StoryFn<typeof ResultTablesHeaderComponent> = (args) => ( | ||
| <ResultTablesHeaderComponent {...args} /> | ||
| ); | ||
|
|
||
| export const ResultTablesHeader = Template.bind({}); | ||
| ResultTablesHeader.args = { | ||
| queryName: "test query", | ||
| queryPath: "/a/b/c/query.ql", | ||
| selectedTable: "#select", | ||
| parsedResultSets: { | ||
| pageNumber: 1, | ||
| pageSize: 10, | ||
| numPages: 2, | ||
| numInterpretedPages: 2, | ||
| resultSetNames: ["#select", "alerts"], | ||
| resultSet: { | ||
| t: "InterpretedResultSet", | ||
| schema: { | ||
| name: "#select", | ||
| rows: 15, | ||
| columns: [ | ||
| { | ||
| name: "x", | ||
| kind: "s", | ||
| }, | ||
| ], | ||
| }, | ||
| name: "#select", | ||
| interpretation: { | ||
| sourceLocationPrefix: "/home/bulk-builder/bulk-builder", | ||
| numTruncatedResults: 0, | ||
| numTotalResults: 15, | ||
| data: { | ||
| t: "SarifInterpretationData", | ||
| version: "2.1.0", | ||
| runs: [], | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }; |
28 changes: 28 additions & 0 deletions
28
extensions/ql-vscode/src/stories/results/locations/ClickableLocation.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import * as React from "react"; | ||
|
|
||
| import { Meta, StoryFn } from "@storybook/react"; | ||
|
|
||
| import { ClickableLocation as ClickableLocationComponent } from "../../../view/results/locations/ClickableLocation"; | ||
|
|
||
| import "../../../view/results/resultsView.css"; | ||
|
|
||
| export default { | ||
| title: "Results/Clickable Location", | ||
| component: ClickableLocationComponent, | ||
| } as Meta<typeof ClickableLocationComponent>; | ||
|
|
||
| const Template: StoryFn<typeof ClickableLocationComponent> = (args) => ( | ||
| <ClickableLocationComponent {...args} /> | ||
| ); | ||
|
|
||
| export const ClickableLocation = Template.bind({}); | ||
| ClickableLocation.args = { | ||
| loc: { | ||
| uri: "file:/home/runner/work/sql2o-example/sql2o-example/src/main/java/org/example/HelloController.java", | ||
| startLine: 22, | ||
| startColumn: 27, | ||
| endLine: 22, | ||
| endColumn: 57, | ||
| }, | ||
| label: "url : String", | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.