Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

Hide private links based on capabilities, refactor spans in sidebar t… - #5034

Merged
pascalwengerter merged 3 commits into
a11y-swarmingfrom
27042021_improve-files-sidebar
Apr 28, 2021
Merged

Hide private links based on capabilities, refactor spans in sidebar t…#5034
pascalwengerter merged 3 commits into
a11y-swarmingfrom
27042021_improve-files-sidebar

Conversation

@pascalwengerter

Copy link
Copy Markdown
Contributor

Description

This is a WIP PR, I'll push some more changes and add a changelog item later. Feel free to contribute suitable changes!

@update-docs

update-docs Bot commented Apr 27, 2021

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@pascalwengerter
pascalwengerter requested a review from kulmann April 27, 2021 15:50
v-if="$_editButtonVisible"
:aria-label="$gettext('Edit share')"
:uk-tooltip="$gettext('Edit share')"
:aria-label="$gettext(`Edit share with ${ collaborator.collaborator.displayName }`)"

@kulmann kulmann Apr 28, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately doesn't work like this. For inserting a variable into a translation, you need to use gettextInterpolate. And that's a 2-step-process. Translating the string (having a placeholder in the string) and then injecting the value into the translated string, which replaces the placeholder. See docs: https://github.com/Polyconseil/vue-gettext#interpolation-support-1 - I'd recommend to do this in a computed property.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I recall seeing this somewhere in the codebase, will push an update later today! Thanks ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


computed: {
...mapGetters('Files', ['highlightedFile']),
...mapGetters('Files', ['highlightedFile'], ['capabilities']),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapGetters expects two params: the namespace (can be omitted for root level) and one array or object. Please merge the two getter names into one array. ;-)

@pascalwengerter
pascalwengerter force-pushed the 27042021_improve-files-sidebar branch 2 times, most recently from 1b3d4b9 to 702ea81 Compare April 28, 2021 11:45
v-if="loading"
key="avatar-loading"
:aria-label="$gettext('Loading')"
:aria-label="$gettext('Loading user avatar')"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the aria-label entirely since the wrapper is aria-hidden

@pascalwengerter
pascalwengerter force-pushed the 27042021_improve-files-sidebar branch from 702ea81 to 07ce4b9 Compare April 28, 2021 12:15

@kulmann kulmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🥇

@pascalwengerter
pascalwengerter force-pushed the 27042021_improve-files-sidebar branch from 07ce4b9 to 03bec6f Compare April 28, 2021 12:23
- Gave `role="presentation" to the collaborator avatar
- Refactored `<span>` and `<div>` tags into `<p>` tags and unified translations a bit
- Enhanced hints in the collaborator quick action buttons with collaborator name
- Hide private links if the capability is not enabled

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this is worth its own bugfix changelog

@pascalwengerter
pascalwengerter force-pushed the 27042021_improve-files-sidebar branch from 03bec6f to 319c7dd Compare April 28, 2021 15:49

@kulmann kulmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (again) 👍

@pascalwengerter
pascalwengerter merged commit 4dc1371 into a11y-swarming Apr 28, 2021
@delete-merged-branch
delete-merged-branch Bot deleted the 27042021_improve-files-sidebar branch April 28, 2021 16:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants