Skip to content

Improve accessibility (CFM-491) #384

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions app/resources/locales/en_US/information.po
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ msgstr "API Users created in the COmanage CO are given full privileges to all Re
msgid "api.key"
msgstr "This newly generated API Key cannot be recovered. If it is lost a new key must be generated."

msgid "aria.label.actions"
msgstr "Actions menu"

msgid "aria.label.lightbox"
msgstr "Registry lightbox"

msgid "aria.label.lightbox.main"
msgstr "Registry lightbox content"

msgid "aria.label.search"
msgstr "Search and user menu"

msgid "aria.label.subnavigation"
msgstr "Subnavigation"

msgid "aria.label.subnavigation.links"
msgstr "Subnavigation secondary links"

msgid "changelog"
msgstr "Changelog"

Expand Down
1 change: 1 addition & 0 deletions app/src/View/Helper/VueHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class VueHelper extends Helper {
'unverified',
],
'information' => [
'aria.label.lightbox',
'global.attributes.none',
'global.value.none',
'global.visit.link',
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Dashboards/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

<div id="search-results">
<?php if($resultsCount): ?>
<nav id="cm-searchresults-subnav-tabs" class="cm-subnav-tabs">
<nav id="cm-searchresults-subnav-tabs" class="cm-subnav-tabs" aria-label="<?= __d('information','aria.label.subnavigation') ?>">
<ul class="nav nav-tabs" role="tablist">
<?php $isFirstTab = true; ?>
<?php foreach(['People', 'Groups'] as $i=>$pm): ?>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/element/bulk/checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
id="<?= $id ?>"
<?php if(!empty($entity)):?>
data-entity="<?= htmlspecialchars(json_encode($entity), ENT_QUOTES, 'UTF-8') ?>"
data-entity-id="<?= $entity->id ?>">
<?php endif ?>
data-entity-id="<?= $entity->id ?>"
<?php endif ?>>
<label class="form-check-label" for="<?= $id ?>">
<?= $label ?>
</label>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/element/menuAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class="<?= $actionsMenuClass; ?>">
'data-bs-toggle' => 'dropdown',
'aria-haspopup' => 'true',
'aria-expanded' => 'false',
'title' => __d('field', 'action')
'aria-label' => __d('information', 'aria.label.actions')
);
print $this->Html->link(
'<span class="' . $actionsIconClass . '" aria-hidden="true">' . $actionsIcon . '</span> ' . $actionsTitle,
Expand Down
2 changes: 1 addition & 1 deletion app/templates/element/mveaModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
template: `
<Modal id="mvea":title="this.modal.title">
<template v-slot:body="body">
<iframe :src="this.modal.url"/>
<iframe :src="this.modal.url" :aria-label="this.txt['information.aria.label.lightbox']"/>
</template>
</Modal>
`
Expand Down
1 change: 0 additions & 1 deletion app/templates/element/peopleAutocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
'value' => '',
'type' => 'text',
'class' => 'visually-hidden',
'label' => false,
]
);
?>
Expand Down
5 changes: 3 additions & 2 deletions app/templates/element/searchGlobal.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<span class="visually-hidden"><?= __d('operation','search') ?></span>
</button>

<div id="global-search" class="dropdown-menu">
<div id="global-search" class="dropdown-menu" role="search">
<?php
print $this->Form->create(null, $options);
print $this->Form->hidden('co_id', ['default' => $vv_cur_co->id]);
Expand All @@ -60,7 +60,8 @@
[
'id' => 'q',
'class' => $globalSearchInputClass,
'placeholder' => __d('field','search.placeholder')
'placeholder' => __d('field','search.placeholder'),
'type' => 'search'
]
);
print $this->Form->button(
Expand Down
6 changes: 4 additions & 2 deletions app/templates/element/subnavigation/navBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
</div>

<!-- Top-Level Subnavigation Tabs -->
<nav id="cm-<?= $fullModelsName ?>-subnav-tabs" class="cm-subnav-tabs">
<nav id="cm-<?= $fullModelsName ?>-subnav-tabs" class="cm-subnav-tabs"
aria-label="<?= __d('information','aria.label.subnavigation') ?>">
<ul class="nav nav-tabs">
<?= $this->element('subnavigation/tabList')?>
</ul>
Expand All @@ -68,7 +69,8 @@
// Check the nested elements if they allow navigation for this action
&& in_array($vv_action, $subNavAttributes['nested']['action'][$fullModelsName] ?? [], true)
): ?>
<nav id="cm-<?= $fullModelsName ?>-subnav-links" class="cm-subnav-links">
<nav id="cm-<?= $fullModelsName ?>-subnav-links" class="cm-subnav-links"
aria-label="<?= __d('information','aria.label.subnavigation.links') ?>">
<ul class="list-inline">
<?= $this->element('subnavigation/inlineList')?>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/layout/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
</header>

<?php if(!$isActivePetition): ?>
<div id="top-bar">
<div id="top-bar" role="region" aria-label="<?= __d('information','aria.label.search') ?>">
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView): ?>
<div id="top-controls">
<div id="co-hamburger"><em class="material-symbols">menu</em></div>
Expand Down Expand Up @@ -217,7 +217,7 @@
<?= $this->element('menuMain') ?>
<?php endif ?>

<main id="main">
<main id="main" aria-label="main content">
<div id="content">
<div id="content-inner">
<?php if(!$isActivePetition): ?>
Expand All @@ -242,7 +242,7 @@
</div>

<!-- loading animation -->
<div id="co-loading"><span></span><span></span><span></span></div>
<div id="co-loading" aria-hidden="true"><span></span><span></span><span></span></div>

<!-- modal dialog boxes -->
<?= $this->element('dialog') // used for confirmations ?>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/layout/iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<body class="<?= $bodyClasses ?>" onload="jsOnLoadCallHooks()">
<!-- Iframe layout -->
<div id="comanage-iframe-wrapper">
<main id="main">
<main id="main" aria-label="<?= __d('information','aria.label.lightbox.main') ?>'">
<div id="content">
<!-- insert the page internal content -->
<?= $this->fetch('content') ?>
Expand All @@ -123,7 +123,7 @@
</div>

<!-- loading animation -->
<div id="co-loading"><span></span><span></span><span></span></div>
<div id="co-loading" aria-hidden="true"><span></span><span></span><span></span></div>

<!-- modal dialog box -->
<?= $this->element('dialog') ?>
Expand Down
16 changes: 14 additions & 2 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,7 @@ body.bulk-mode #bulk-actions {
background-color: var(--cmg-color-bg-003);
border: 1px solid var(--cmg-color-bg-005);
}
body.bulk-mode #bulk-actions legend {
width: auto;
body.bulk-mode #bulk-actions label {
font-size: 1.2em;
}
#bulk-action-select {
Expand Down Expand Up @@ -1983,6 +1982,19 @@ li[data-pc-section="emptymessage"] {
margin-right: 0.5em;
font-size: 1.4em;
}
#cm-people-picker .input.text label,
.fields-people-autocomplete .field-info .input.text label {
/* This is to hide the field label - same as .visually-hidden in bootstrap */
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* Vue transitions */
.v-enter-active,
.v-leave-active {
Expand Down
2 changes: 1 addition & 1 deletion app/webroot/js/comanage/components/bulk/bulk-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default {
}
},
template: `
<legend>{{ this.legend }}</legend>
<label for="bulk-action-select">{{ this.legend }}</label>
<select id="bulk-action-select" v-model="selected">
<template v-if="bulkactions.length > 0">
<option value="" disabled selected>{{ selectprompt }}</option>
Expand Down