Skip to content

Commit 48b2d13

Browse files
committed
accessibilityy fixer script added
1 parent 9bd6574 commit 48b2d13

File tree

3 files changed

+379
-12
lines changed

3 files changed

+379
-12
lines changed

administrator/components/com_workflow/resources/scripts/components/canvas/WorkflowCanvas.vue

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
:snap-to-grid="true"
2828
:snap-grid="[40, 40]"
2929
:disable-keyboard-a11y="false"
30-
role="img"
31-
:aria-label="`Workflow diagram with ${positionedNodes.length} stages and ${styledEdges.length} transitions`"
30+
role="application"
31+
:aria-label="`Interactive workflow diagram with ${positionedNodes.length} stages and ${styledEdges.length} transitions. Press Tab to navigate between stages and transitions.`"
32+
aria-describedby="canvas-description"
3233
@connect="handleConnect"
3334
@pane-click="clearSelection"
3435
@edge-click="selectEdge"
@@ -55,9 +56,9 @@
5556
class="toolbar-button custom-controls-button position-absolute z-20"
5657
tabindex="0"
5758
:style="showMiniMap ? 'bottom: 130px; left: 180px;' : 'bottom: 10px; left: 10px;'"
58-
:aria-label="showMiniMap ? translate('COM_WORKFLOW_GRAPH_MINIMAP_HIDE') : translate('COM_WORKFLOW_GRAPH_MINIMAP_SHOW')"
59-
:title="showMiniMap ? translate('COM_WORKFLOW_GRAPH_MINIMAP_HIDE') : translate('COM_WORKFLOW_GRAPH_MINIMAP_SHOW')"
60-
:aria-pressed="showMiniMap.toString()"
59+
:aria-label="showMiniMap ? 'Hide Mini Map' : 'Show Mini Map'"
60+
:title="showMiniMap ? 'Hide Mini Map' : 'Show Mini Map'"
61+
:aria-pressed="showMiniMap ? 'true' : 'false'"
6162
@click="showMiniMap = !showMiniMap"
6263
>
6364
<span
@@ -200,6 +201,7 @@ import { generatePositionedNodes, createSpecialNode } from '../../utils/position
200201
import { generateStyledEdges } from '../../utils/edges.es6.js';
201202
import { setupGlobalShortcuts } from '../../utils/keyboard-manager.es6.js';
202203
import { debounce } from '../../utils/utils.es6';
204+
import AccessibilityFixer from '../../utils/accessibility-fixer.es6.js';
203205
204206
export default {
205207
name: 'WorkflowCanvas',
@@ -236,6 +238,7 @@ export default {
236238
const saveStatus = ref('upToDate');
237239
const currentFocusMode = ref('links');
238240
const previouslyFocusedElement = ref(null);
241+
const accessibilityFixer = ref(null);
239242
240243
const showMiniMap = ref(true);
241244
const workflow = computed(() => store.getters.workflow || {});
@@ -273,9 +276,8 @@ export default {
273276
? `${baseUrlwithId}&${extraQuery}`
274277
: baseUrlwithId;
275278
276-
const textHeader = id
277-
? translate(`COM_WORKFLOW_GRAPH_EDIT_${type.toUpperCase()}`)
278-
: translate(`COM_WORKFLOW_GRAPH_ADD_${type.toUpperCase()}`);
279+
const safeType = (typeof type === 'string' && type) ? type : '';
280+
const textHeader = "hi";
279281
280282
const dialog = new JoomlaDialog({
281283
popupType: 'iframe',
@@ -481,6 +483,10 @@ export default {
481483
},
482484
})));
483485
onMounted(() => {
486+
// Initialize accessibility fixer
487+
accessibilityFixer.value = new AccessibilityFixer();
488+
accessibilityFixer.value.init();
489+
484490
const detach = setupGlobalShortcuts({
485491
addStage,
486492
addTransition,
@@ -527,7 +533,12 @@ export default {
527533
saveNodePosition,
528534
store,
529535
});
530-
onUnmounted(detach);
536+
onUnmounted(() => {
537+
detach();
538+
if (accessibilityFixer.value) {
539+
accessibilityFixer.value.destroy();
540+
}
541+
});
531542
});
532543
533544
window.WorkflowGraph.Event.listen('onClickRedoWorkflow', () => {

administrator/components/com_workflow/resources/scripts/components/nodes/StageNode.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
class="stage-node card border shadow-sm position-relative"
44
:class="{ 'shadow': isSelected, 'hover-shadow': !isSelected }"
55
:style="stageStyle"
6-
tabindex="0"
76
:data-stage-id="stage?.id"
87
:aria-describedby="`stage-${stage?.id}-description`"
98
@mouseenter="onNodeEnter"
@@ -39,7 +38,6 @@
3938
id="stage-actions-menu"
4039
ref="actionsMenu"
4140
class="workflow-browser-actions-list position-absolute top-25-px end-20-px opacity-100 d-flex flex-column border rounded shadow-sm z-3 p-1"
42-
role="menu"
4341
aria-orientation="vertical"
4442
:aria-labelledby="`stage-${stage?.id}-menu-button`"
4543
@mouseenter="onDropdownEnter"
@@ -127,7 +125,6 @@
127125
<span
128126
class="h3 d-block card-title mb-1 text-white fw-semibold text-truncate"
129127
:title="stage?.title"
130-
aria-level="3"
131128
>
132129
{{ stage.title }}
133130
</span>

0 commit comments

Comments
 (0)