From c443f244a08d05f282139ac093d5260fca20ac1c Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:26:01 +0100 Subject: [PATCH] A11y/Dashboard: Fix misc. fastpass issues (#40296) * A11y/Dashboard: Fix misc. fastpass issues See #39429 --- e2e/shared/smokeTestScenario.ts | 2 +- e2e/suite1/specs/explore.spec.ts | 2 +- e2e/suite1/specs/panelEdit_queries.spec.ts | 2 +- .../src/field/overrides/processors.ts | 1 + .../standardFieldConfigEditorRegistry.ts | 1 + .../src/components/Button/ToolbarButton.tsx | 9 ++++++--- .../src/components/OptionsUI/fieldColor.tsx | 15 +++++++++++++-- .../src/components/OptionsUI/slider.tsx | 1 + .../src/components/OptionsUI/stats.tsx | 2 ++ .../src/components/Slider/Slider.tsx | 2 ++ .../grafana-ui/src/components/Slider/types.ts | 1 + .../components/StatsPicker/StatsPicker.tsx | 4 +++- .../ThresholdsEditorNew/ThresholdsEditor.tsx | 3 +++ .../AddPanelWidget/AddPanelWidget.tsx | 2 +- .../PanelEditor/OptionsPaneCategory.tsx | 8 +++++--- .../PanelEditor/getPanelFrameOptions.tsx | 2 ++ .../PanelEditor/getVizualizationOptions.tsx | 3 ++- .../RepeatRowSelect/RepeatRowSelect.tsx | 5 +++-- .../components/ShareModal/ShareLink.tsx | 1 + .../VizTypePicker/PanelTypeCard.tsx | 2 +- .../features/query/components/QueryGroup.tsx | 4 +++- .../datasource/testdata/QueryEditor.tsx | 1 + .../app/plugins/panel/graph/tab_display.html | 19 ++++++++++++------- .../timeseries/ThresholdsStyleEditor.tsx | 6 ++++-- public/app/plugins/panel/timeseries/config.ts | 3 +++ 25 files changed, 74 insertions(+), 27 deletions(-) diff --git a/e2e/shared/smokeTestScenario.ts b/e2e/shared/smokeTestScenario.ts index 686dd9269e1..eb838b36dc2 100644 --- a/e2e/shared/smokeTestScenario.ts +++ b/e2e/shared/smokeTestScenario.ts @@ -14,7 +14,7 @@ export const smokeTestScenario = { e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer() .should('be.visible') .within(() => { - e2e.components.Select.input().should('be.visible').click(); + e2e().get('input[id*="scenario-input-"]').should('be.visible').click(); }); cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click(); diff --git a/e2e/suite1/specs/explore.spec.ts b/e2e/suite1/specs/explore.spec.ts index b4d424a6d80..c815e092be0 100644 --- a/e2e/suite1/specs/explore.spec.ts +++ b/e2e/suite1/specs/explore.spec.ts @@ -14,7 +14,7 @@ e2e.scenario({ e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer() .should('be.visible') .within(() => { - e2e.components.Select.input().should('be.visible').click(); + e2e().get('input[id*="scenario-input-"]').should('be.visible').click(); }); cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click(); diff --git a/e2e/suite1/specs/panelEdit_queries.spec.ts b/e2e/suite1/specs/panelEdit_queries.spec.ts index 67f38e592ac..7f1fa883632 100644 --- a/e2e/suite1/specs/panelEdit_queries.spec.ts +++ b/e2e/suite1/specs/panelEdit_queries.spec.ts @@ -50,7 +50,7 @@ e2e.scenario({ e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer() .should('be.visible') .within(() => { - e2e.components.Select.input().eq(0).should('be.visible').click(); + e2e().get('input[id*="scenario-input-"]').eq(0).should('be.visible').click(); }); cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').eq(0).click(); diff --git a/packages/grafana-data/src/field/overrides/processors.ts b/packages/grafana-data/src/field/overrides/processors.ts index 84cb4d2a7fb..4d12da0b87d 100644 --- a/packages/grafana-data/src/field/overrides/processors.ts +++ b/packages/grafana-data/src/field/overrides/processors.ts @@ -39,6 +39,7 @@ export interface SliderFieldConfigSettings { min: number; max: number; step?: number; + ariaLabelForHandle?: string; } export interface DataLinksFieldConfigSettings {} diff --git a/packages/grafana-data/src/field/standardFieldConfigEditorRegistry.ts b/packages/grafana-data/src/field/standardFieldConfigEditorRegistry.ts index ca66a5523c1..9bc019c5fcb 100644 --- a/packages/grafana-data/src/field/standardFieldConfigEditorRegistry.ts +++ b/packages/grafana-data/src/field/standardFieldConfigEditorRegistry.ts @@ -19,6 +19,7 @@ export interface StandardEditorProps void; item: StandardEditorsRegistryItem; context: StandardEditorContext; + id?: string; } export interface StandardEditorsRegistryItem extends RegistryItem { editor: ComponentType>; diff --git a/packages/grafana-ui/src/components/Button/ToolbarButton.tsx b/packages/grafana-ui/src/components/Button/ToolbarButton.tsx index 9ecec261c08..44c2536800a 100644 --- a/packages/grafana-ui/src/components/Button/ToolbarButton.tsx +++ b/packages/grafana-ui/src/components/Button/ToolbarButton.tsx @@ -17,6 +17,8 @@ export interface Props extends ButtonHTMLAttributes { tooltip?: string; /** For image icons */ imgSrc?: string; + /** Alt text for imgSrc */ + imgAlt?: string; /** if true or false will show angle-down/up */ isOpen?: boolean; /** Controls flex-grow: 1 */ @@ -39,6 +41,7 @@ export const ToolbarButton = forwardRef( className, children, imgSrc, + imgAlt, fullWidth, isOpen, narrow, @@ -72,12 +75,12 @@ export const ToolbarButton = forwardRef(