Skip to content

Commit

Permalink
Merge pull request #11217 from craftcms/a11y/dashboard-updates
Browse files Browse the repository at this point in the history
Dashboard a11y updates
  • Loading branch information
brandonkelly authored Jun 8, 2022
2 parents 7a848d5 + fe84351 commit fadbc1f
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
### Changed
- Improved pagination UI accessibility. ([#11126](https://github.com/craftcms/cms/pull/11126))
- Improved element index accessibility. ([#11169](https://github.com/craftcms/cms/pull/11169), [#11200](https://github.com/craftcms/cms/pull/11200))
- Improved Dashboard accessibility. ([#11217](https://github.com/craftcms/cms/pull/11217))
- It’s now possible to remove all selected elements from relational fields by pressing <kbd>Backspace</kbd> or <kbd>Delete</kbd> while one of them is focussed.
- Live Preview now always shows a “Refresh” button, regardless of whether the preview target has auto-refresh enabled. ([#11160](https://github.com/craftcms/cms/discussions/11160))
- Entry Type condition rules now allow multiple selections. ([#11124](https://github.com/craftcms/cms/pull/11124))
Expand Down
2 changes: 1 addition & 1 deletion src/templates/_components/widgets/Updates/body.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
{% else %}
<p class="centeralign">{{ "Congrats! You’re up to date."|t('app') }}</p>
<p class="centeralign">
<button type="button" class="btn" data-icon="refresh">{{ 'Check again'|t('app') }}</button>
<button type="button" class="btn" data-icon="refresh" aria-label="{{ 'Check again'|t('app') }}">{{ 'Check again'|t('app') }}</button>
</p>
{% endif %}
5 changes: 3 additions & 2 deletions src/templates/dashboard/_index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
{% block main %}
<div id="dashboard-grid" class="grid">
{% for widget in widgets %}
{% set widgetHeadingId = "widget-heading-#{widget.id}" %}
<div class="item" data-colspan="{{ widget.colspan }}">
<div id="widget{{ widget.id }}" class="widget {{ widget.type|lower }}" data-id="{{ widget.id }}" data-type="{{ widget.type }}" data-title="{{ widget.title }}">
<div class="front">
<div class="pane">
<div class="spinner body-loading"></div>
{% if widget.title or widget.subtitle %}
<div class="widget-heading">
<div id="{{ widgetHeadingId }}" class="widget-heading">
{% if widget.title %}
<h2>{{ widget.title }}</h2>
{% endif %}
Expand All @@ -43,10 +44,10 @@
{% endif %}
</div>
{% endif %}
<button role="button" class="settings icon hidden" aria-label="{{ 'Widget settings'|t('app') }}" aria-describedby="{{ widgetHeadingId }}" data-settings-toggle></button>
<div class="body">
{{ widget.bodyHtml|raw }}
</div>
<div class="settings icon hidden"></div>
</div>
</div>
<div class="back hidden">
Expand Down
1 change: 1 addition & 0 deletions src/translations/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,7 @@
'Which template should be loaded when an entry’s URL is requested.' => 'Which template should be loaded when an entry’s URL is requested.',
'Which type of entries do you want to create?' => 'Which type of entries do you want to create?',
'Widget saved.' => 'Widget saved.',
'Widget settings' => 'Widget settings',
'Width' => 'Width',
'Years' => 'Years',
'Yes' => 'Yes',
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/src/css/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2549,7 +2549,7 @@ $elementInnerSpacing: 5px;
padding: 1px 5px;
font-weight: normal;
text-decoration: none !important;
color: var(--light-text-color);
color: var(--medium-text-color);
background: var(--gray-100);
border-radius: var(--large-border-radius);
}
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/dashboard/dist/Dashboard.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/dashboard/dist/Dashboard.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/dashboard/dist/css/Dashboard.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/web/assets/dashboard/dist/css/Dashboard.css.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/web/assets/dashboard/src/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ import './dashboard.scss';
$back: null,
$settingsForm: null,
$settingsContainer: null,
$settingsToggle: null,
$saveBtn: null,
$settingsErrorList: null,

Expand All @@ -288,6 +289,7 @@ import './dashboard.scss';

init: function (container, settingsHtml, initSettingsFn) {
this.$container = $(container);
this.$settingsToggle = this.$container.find('[data-settings-toggle]');
this.$gridItem = this.$container.parent();

// Store a reference to this object on the container element
Expand Down Expand Up @@ -400,6 +402,7 @@ import './dashboard.scss';
complete: this.onShowFront.bind(this),
}
);
this.$settingsToggle.focus();
}, 100);
},

Expand Down
16 changes: 12 additions & 4 deletions src/web/assets/dashboard/src/dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
}

&:hover > .front > .pane > .icon.settings {
opacity: 0.3;
opacity: 0.8;
}

& .front > .pane > .icon.settings:focus {
opacity: 0.8;
}
}

Expand All @@ -53,13 +57,17 @@
& > .front {
& > .pane {
& > .icon.settings {
display: block;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
cursor: pointer;
@include right(24px);
top: 24px;
@include right(12px);
top: 12px;
transition: opacity linear 200ms;
position: absolute;
height: var(--touch-target-size);
width: var(--touch-target-size);
}

& > .spinner.body-loading {
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/updateswidget/dist/UpdatesWidget.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fadbc1f

Please sign in to comment.