Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,18 @@ const StyledDashboardContent = styled.div<{
`}
`;

const SrOnlyH2 = styled.h2`
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
`;

const ELEMENT_ON_SCREEN_OPTIONS = {
threshold: [1],
};
Expand Down Expand Up @@ -509,10 +521,13 @@ const DashboardBuilder = () => {
{!hideDashboardHeader && <DashboardHeader />}
{showFilterBar &&
filterBarOrientation === FilterBarOrientation.Horizontal && (
<FilterBar
orientation={FilterBarOrientation.Horizontal}
hidden={isReport}
/>
<>
<SrOnlyH2>{t('Filters')}</SrOnlyH2>
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
<FilterBar
orientation={FilterBarOrientation.Horizontal}
hidden={isReport}
/>
</>
)}
</>
),
Expand Down Expand Up @@ -581,6 +596,7 @@ const DashboardBuilder = () => {
hidden={isReport}
data-test="dashboard-filters-panel"
>
<SrOnlyH2>{t('Filters')}</SrOnlyH2>
<StickyPanel ref={containerRef} width={filterBarWidth}>
<ErrorBoundary>
<FilterBar
Expand Down Expand Up @@ -616,6 +632,8 @@ const DashboardBuilder = () => {
return (
<DashboardWrapper>
{isVerticalFilterBarVisible && (
<>
<SrOnlyH2>{t('Filters')}</SrOnlyH2>
<ResizableSidebar
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
id={`dashboard:${dashboardId}`}
enable={dashboardFiltersOpen}
Expand All @@ -625,6 +643,7 @@ const DashboardBuilder = () => {
>
{renderChild}
</ResizableSidebar>
</>
)}
<StyledHeader
data-test="dashboard-header-wrapper"
Expand All @@ -649,6 +668,7 @@ const DashboardBuilder = () => {
{renderDraggableContent}
</Droppable>
</StyledHeader>
<SrOnlyH2>{t('Dashboard content')}</SrOnlyH2>
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
<StyledContent fullSizeChartId={fullSizeChartId}>
{!editMode &&
!topLevelTabs &&
Expand Down
13 changes: 13 additions & 0 deletions superset-frontend/src/dashboard/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ const actionButtonsStyle = (theme: SupersetTheme) => css`
}
`;

const SrOnlyH1 = styled.h1`
position: absolute;
width: 1px;
height: 1px;
padding: 0;
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
`;

const StyledUndoRedoButton = styled(Button)`
// TODO: check if we need this
padding: 0;
Expand Down Expand Up @@ -827,6 +839,7 @@ const Header = (): JSX.Element => {
data-test-id={dashboardInfo.id}
className="dashboard-header-container"
>
<SrOnlyH1>{dashboardTitle || t('Dashboard')}</SrOnlyH1>
<PageHeaderWithActions
editableTitleProps={editableTitleProps}
certificatiedBadgeProps={certifiedBadgeProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
MatrixifyFormData,
} from '@superset-ui/core';
import { logging } from '@apache-superset/core/utils';
import { css, SupersetTheme } from '@apache-superset/core/theme';
import { css, styled, SupersetTheme } from '@apache-superset/core/theme';
import { t } from '@apache-superset/core/translation';
import { Icons } from '@superset-ui/core/components/Icons';
import PropertiesModal from 'src/explore/components/PropertiesModal';
Expand Down Expand Up @@ -84,6 +84,18 @@ export interface ExploreChartHeaderProps {
isSaveModalVisible?: boolean;
}

const SrOnlyH1 = styled.h1`
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
`;

const saveButtonStyles = (theme: SupersetTheme) => css`
color: ${theme.colorPrimaryText};
& > span[role='img'] {
Expand Down Expand Up @@ -272,6 +284,7 @@ export const ExploreChartHeader: FC<ExploreChartHeaderProps> = ({

return (
<>
<SrOnlyH1>{sliceName || t('Explore chart')}</SrOnlyH1>
<PageHeaderWithActions
editableTitleProps={{
title: sliceName ?? '',
Expand Down
17 changes: 15 additions & 2 deletions superset-frontend/src/pages/ChartCreation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const StyledContainer = styled.div`
padding-right: ${theme.padding}px;
padding-bottom: ${theme.padding}px;

h3 {
h2 {
padding-bottom: ${theme.paddingSM}px;
}

Expand Down Expand Up @@ -158,6 +158,18 @@ const StyledContainer = styled.div`
`}
`;

const SrOnlyH1 = styled.h1`
position: absolute;
width: 1px;
height: 1px;
padding: 0;
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
`;

const StyledStepTitle = styled.span`
${({ theme: { fontSize, fontWeightStrong } }) => `
font-size: ${fontSize}px;
Expand Down Expand Up @@ -329,7 +341,8 @@ export class ChartCreation extends PureComponent<

return (
<StyledContainer>
<h3>{t('Create a new chart')}</h3>
<SrOnlyH1>{t('Create a new chart')}</SrOnlyH1>
<h2 aria-hidden="true">{t('Create a new chart')}</h2>
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
<Steps direction="vertical" size="small">
<Steps.Step
title={<StyledStepTitle>{t('Choose a dataset')}</StyledStepTitle>}
Expand Down
13 changes: 13 additions & 0 deletions superset-frontend/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ interface LoadingProps {

const DEFAULT_TAB_ARR = ['dashboards', 'charts'];

const SrOnlyH1 = styled.h1`
position: absolute;
width: 1px;
height: 1px;
padding: 0;
Comment thread
Aitema-gmbh marked this conversation as resolved.
Resolved
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
`;

const WelcomeContainer = styled.div`
background: ${({ theme }) => theme.colorBgLayout};
.ant-row.menu {
Expand Down Expand Up @@ -350,6 +362,7 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
<SubMenu {...menuData} />
)}
<WelcomeContainer>
<SrOnlyH1>{t('Home')}</SrOnlyH1>
{WelcomeMessageExtension && <WelcomeMessageExtension />}
{WelcomeTopExtension && <WelcomeTopExtension />}
{WelcomeMainExtension && <WelcomeMainExtension />}
Expand Down
Loading