Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some a11y fixes #9113

Merged
merged 6 commits into from
Jun 23, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>
<div class="info-drop-content">
<div v-if="title" class="oc-flex oc-flex-between info-header oc-border-b oc-pb-s">
<span class="oc-m-rm info-title" v-text="$gettext(title)" />
<h4 class="oc-m-rm info-title" v-text="$gettext(title)" />
<oc-button appearance="raw">
<oc-icon name="close" fill-type="line" size="medium" variation="inherit" />
</oc-button>
Expand Down
19 changes: 13 additions & 6 deletions packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ import {
useFileActionsMove,
useFileActionsRestore
} from 'web-app-files/src/composables/actions'
import { useStore } from 'web-pkg/src'
import { useRouteMeta, useStore } from 'web-pkg/src'
import { BreadcrumbItem } from 'design-system/src/components/OcBreadcrumb/types'
import { useActiveLocation } from 'web-app-files/src/composables'
import { useGettext } from 'vue3-gettext'

export default defineComponent({
components: {
Expand Down Expand Up @@ -129,6 +130,7 @@ export default defineComponent({
},
setup(props) {
const store = useStore()
const { $gettext } = useGettext()

const { actions: acceptShareActions } = useFileActionsAcceptShare({ store })
const { actions: clearSelectionActions } = useFileActionsClearSelection({ store })
Expand Down Expand Up @@ -182,10 +184,19 @@ export default defineComponent({
return props.breadcrumbs.length <= 1
})

const routeMetaTitle = useRouteMeta('title')
const pageTitle = computed(() => {
if (unref(routeMetaTitle)) {
return $gettext(unref(routeMetaTitle))
}
return props.space?.name || ''
})

return {
batchActions,
showBreadcrumb,
showMobileNav
showMobileNav,
pageTitle
}
},
data: function () {
Expand All @@ -198,10 +209,6 @@ export default defineComponent({
...mapGetters('Files', ['files', 'selectedFiles']),
...mapState('Files', ['areHiddenFilesShown', 'areFileExtensionsShown']),

pageTitle() {
const title = this.$route.meta.title || ''
return this.$gettext(title)
},
showContextActions() {
return last<BreadcrumbItem>(this.breadcrumbs).allowContextActions
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
>
<label for="tiles-size-slider" v-text="$gettext('Tile size')" />
<input
id="tiles-size-slider"
v-model="viewSizeCurrent"
type="range"
min="1"
max="6"
name="tiles-size-slider"
class="oc-range"
data-testid="files-tiles-size-slider"
@input="setTilesViewSize"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="space-header-infos">
<div class="oc-flex oc-mb-s oc-flex-middle oc-flex-between">
<div class="oc-flex oc-flex-middle space-header-infos-heading">
<h1 class="space-header-name">{{ space.name }}</h1>
<h2 class="space-header-name">{{ space.name }}</h2>
<oc-button
:id="`space-context-btn`"
v-oc-tooltip="$gettext('Show context menu')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`SpaceMembers filter toggles the filter on click 1`] = `
<div class="oc-card oc-card-body oc-background-secondary oc-p-m">
<div class="info-drop-content">
<div class="oc-flex oc-flex-between info-header oc-border-b oc-pb-s">
<span class="oc-m-rm info-title">Add members to this Space</span>
<h4 class="oc-m-rm info-title">Add members to this Space</h4>
<button class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw" type="button">
<!-- @slot Content of the button -->
<oc-icon-stub accessiblelabel="" color="" filltype="line" name="close" size="medium" type="span" variation="inherit"></oc-icon-stub>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`SpaceHeader should add the "squashed"-class when the sidebar is opened
<div class="space-header-infos">
<div class="oc-flex oc-mb-s oc-flex-middle oc-flex-between">
<div class="oc-flex oc-flex-middle space-header-infos-heading">
<h1 class="space-header-name"></h1>
<h2 class="space-header-name"></h2>
<button aria-label="Show context menu" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-ml-s" id="space-context-btn" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-m oc-icon-passive">
Expand Down Expand Up @@ -49,7 +49,7 @@ exports[`SpaceHeader space image should show the default image if no other image
<div class="space-header-infos">
<div class="oc-flex oc-mb-s oc-flex-middle oc-flex-between">
<div class="oc-flex oc-flex-middle space-header-infos-heading">
<h1 class="space-header-name"></h1>
<h2 class="space-header-name"></h2>
<button aria-label="Show context menu" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-ml-s" id="space-context-btn" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-m oc-icon-passive">
Expand Down Expand Up @@ -82,7 +82,7 @@ exports[`SpaceHeader space image should show the set image 1`] = `
<div class="space-header-infos">
<div class="oc-flex oc-mb-s oc-flex-middle oc-flex-between">
<div class="oc-flex oc-flex-middle space-header-infos-heading">
<h1 class="space-header-name"></h1>
<h2 class="space-header-name"></h2>
<button aria-label="Show context menu" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-ml-s" id="space-context-btn" type="button">
<!-- @slot Content of the button -->
<span class="oc-icon oc-icon-m oc-icon-passive">
Expand Down
13 changes: 7 additions & 6 deletions packages/web-runtime/src/components/SidebarNav/SidebarNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
class="oc-sidebar-nav oc-mb-m oc-mt-s oc-px-xs"
:aria-label="$gettext('Sidebar navigation menu')"
>
<div
v-show="isAnyNavItemActive"
id="nav-highlighter"
class="oc-ml-s oc-background-primary-gradient"
v-bind="highlighterAttrs"
:aria-hidden="true"
/>
<oc-list>
<div
v-show="isAnyNavItemActive"
id="nav-highlighter"
class="oc-ml-s oc-background-primary-gradient"
v-bind="highlighterAttrs"
/>
<sidebar-nav-item
v-for="(link, index) in navItems"
:ref="(el: ComponentPublicInstance) => (navItemRefs[index] = el)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ exports[`OcSidebarNav renders navItems into a list 1`] = `
</span>
</button>
<nav aria-label="Sidebar navigation menu" class="oc-sidebar-nav oc-mb-m oc-mt-s oc-px-xs">
<div aria-hidden="true" class="oc-ml-s oc-background-primary-gradient" id="nav-highlighter"></div>
<ul class="oc-list oc-my-rm oc-mx-rm">
<div class="oc-ml-s oc-background-primary-gradient" id="nav-highlighter"></div>
<sidebar-nav-item-stub active="true" collapsed="false" filltype="fill" icon="folder" index="00000000000000000000000000000000" name="Personal" target="[object Object]"></sidebar-nav-item-stub>
<sidebar-nav-item-stub active="false" collapsed="false" filltype="fill" icon="share-forward" index="00000000000000000000000000000000" name="Shares" target="[object Object]"></sidebar-nav-item-stub>
<sidebar-nav-item-stub active="false" collapsed="false" filltype="fill" icon="delete" index="00000000000000000000000000000000" name="Deleted files" target="[object Object]"></sidebar-nav-item-stub>
Expand Down