From 9ccd01352290759575cd65b521eeba149c5cb3b7 Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Sun, 12 Nov 2023 10:38:13 +0000 Subject: [PATCH 1/5] Merge branch 'tusooa/fix-admin-crash-when-no-primary-fe-set' into 'develop' fix admin crash when no primary fe set See merge request pleroma/pleroma-fe!1867 (cherry picked from commit faef2767cd7ba5961445e9c38e8ebf52d3610259) 661d5b6d Fix frontend admin tab crashing when no primary frontend is set b2c5520d Add changelog for frontend tab crash fix --- changelog.d/fix-admin-crash-when-no-primary-fe-set.fix | 1 + src/components/settings_modal/admin_tabs/frontends_tab.vue | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/fix-admin-crash-when-no-primary-fe-set.fix diff --git a/changelog.d/fix-admin-crash-when-no-primary-fe-set.fix b/changelog.d/fix-admin-crash-when-no-primary-fe-set.fix new file mode 100644 index 0000000000..78eae3be97 --- /dev/null +++ b/changelog.d/fix-admin-crash-when-no-primary-fe-set.fix @@ -0,0 +1 @@ +Fix frontend admin tab crashing when no primary frontend is set diff --git a/src/components/settings_modal/admin_tabs/frontends_tab.vue b/src/components/settings_modal/admin_tabs/frontends_tab.vue index 13b8fa6b6f..25b08eb701 100644 --- a/src/components/settings_modal/admin_tabs/frontends_tab.vue +++ b/src/components/settings_modal/admin_tabs/frontends_tab.vue @@ -33,9 +33,9 @@ > {{ frontend.name }} {{ ' ' }} - + Date: Sun, 12 Nov 2023 23:06:14 +0000 Subject: [PATCH 2/5] Merge branch 'tusooa/react-more-actions-fix' into 'develop' Accessibility for react & extra buttons See merge request pleroma/pleroma-fe!1869 (cherry picked from commit 18c0cf1845a95db2d0e894d2455cdd4dc545aaf7) 0026b35f Add alt text for react and extra-buttons popup 82063f34 Add aria-controls to extra-buttons trigger 5ff14837 Add changelog --- changelog.d/react-more-actions-fix.fix | 1 + src/components/emoji_input/emoji_input.js | 3 ++- src/components/emoji_picker/emoji_picker.vue | 2 +- src/components/extra_buttons/extra_buttons.js | 13 ++++++++++++- .../extra_buttons/extra_buttons.vue | 19 ++++++++++++++++++- src/components/poll/poll.js | 3 ++- .../post_status_form/post_status_form.js | 3 ++- src/components/react_button/react_button.vue | 2 ++ src/i18n/en.json | 3 ++- .../random_seed/random_seed.service.js | 3 +++ 10 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 changelog.d/react-more-actions-fix.fix create mode 100644 src/services/random_seed/random_seed.service.js diff --git a/changelog.d/react-more-actions-fix.fix b/changelog.d/react-more-actions-fix.fix new file mode 100644 index 0000000000..9ab41de239 --- /dev/null +++ b/changelog.d/react-more-actions-fix.fix @@ -0,0 +1 @@ +Add aria attributes to react and extra buttons diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js index 68654f6932..9baf63f226 100644 --- a/src/components/emoji_input/emoji_input.js +++ b/src/components/emoji_input/emoji_input.js @@ -1,4 +1,5 @@ import Completion from '../../services/completion/completion.js' +import genRandomSeed from '../../services/random_seed/random_seed.service.js' import EmojiPicker from '../emoji_picker/emoji_picker.vue' import Popover from 'src/components/popover/popover.vue' import ScreenReaderNotice from 'src/components/screen_reader_notice/screen_reader_notice.vue' @@ -110,7 +111,7 @@ const EmojiInput = { }, data () { return { - randomSeed: `${Math.random()}`.replace('.', '-'), + randomSeed: genRandomSeed(), input: undefined, caretEl: undefined, highlighted: -1, diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index b8d3330977..0788f34ca8 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -3,7 +3,7 @@ ref="popover" trigger="click" popover-class="emoji-picker popover-default" - :trigger-attrs="{ 'aria-hidden': true }" + :trigger-attrs="{ 'aria-hidden': true, tabindex: -1 }" @show="onPopoverShown" @close="onPopoverClosed" > diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 48b960b2b7..e2c88cebbe 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -1,4 +1,5 @@ import Popover from '../popover/popover.vue' +import genRandomSeed from '../../services/random_seed/random_seed.service.js' import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -40,7 +41,8 @@ const ExtraButtons = { data () { return { expanded: false, - showingDeleteDialog: false + showingDeleteDialog: false, + randomSeed: genRandomSeed() } }, methods: { @@ -152,6 +154,15 @@ const ExtraButtons = { editingAvailable () { return this.$store.state.instance.editingAvailable }, shouldConfirmDelete () { return this.$store.getters.mergedConfig.modalOnDelete + }, + triggerAttrs () { + return { + title: this.$t('status.more_actions'), + id: `popup-trigger-${this.randomSeed}`, + 'aria-controls': `popup-menu-${this.randomSeed}`, + 'aria-expanded': this.expanded, + 'aria-haspopup': 'menu' + } } } } diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index c1c15c0fb5..b7d3b1d3ab 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -2,6 +2,7 @@