From cbfe0c67e9072f18bb40b795032d47f1639decb9 Mon Sep 17 00:00:00 2001
From: Christopher Ng <chrng8@gmail.com>
Date: Fri, 7 Jul 2023 11:31:23 -0700
Subject: enh(a11y): Users table

Signed-off-by: Christopher Ng <chrng8@gmail.com>
---
 .../src/components/Users/UserRowActions.vue        | 48 ++++++++++++++++++----
 1 file changed, 41 insertions(+), 7 deletions(-)

(limited to 'apps/settings/src/components/Users/UserRowActions.vue')

diff --git a/apps/settings/src/components/Users/UserRowActions.vue b/apps/settings/src/components/Users/UserRowActions.vue
index ad89528fda7..4da5fd402fc 100644
--- a/apps/settings/src/components/Users/UserRowActions.vue
+++ b/apps/settings/src/components/Users/UserRowActions.vue
@@ -1,18 +1,44 @@
+<!--
+	- @copyright 2023 Ferdinand Thiessen <opensource@fthiessen.de>
+	-
+	- @author Christopher Ng <chrng8@gmail.com>
+	- @author Ferdinand Thiessen <opensource@fthiessen.de>
+	-
+	- @license AGPL-3.0-or-later
+	-
+	- This program is free software: you can redistribute it and/or modify
+	- it under the terms of the GNU Affero General Public License as
+	- published by the Free Software Foundation, either version 3 of the
+	- License, or (at your option) any later version.
+	-
+	- This program is distributed in the hope that it will be useful,
+	- but WITHOUT ANY WARRANTY; without even the implied warranty of
+	- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+	- GNU Affero General Public License for more details.
+	-
+	- You should have received a copy of the GNU Affero General Public License
+	- along with this program. If not, see <http://www.gnu.org/licenses/>.
+	-
+-->
+
 <template>
 	<NcActions :aria-label="t('settings', 'Toggle user actions menu')"
+		:disabled="disabled"
 		:inline="1">
-		<NcActionButton @click="toggleEdit">
+		<NcActionButton :disabled="disabled"
+			@click="toggleEdit">
 			{{ edit ? t('settings', 'Done') : t('settings', 'Edit') }}
 			<template #icon>
-				<NcIconSvgWrapper :svg="editSvg" aria-hidden="true" />
+				<NcIconSvgWrapper :key="editSvg" :svg="editSvg" aria-hidden="true" />
 			</template>
 		</NcActionButton>
-		<NcActionButton v-for="(action, index) in actions"
+		<NcActionButton v-for="({ action, icon, text }, index) in actions"
 			:key="index"
-			:aria-label="action.text"
-			:icon="action.icon"
-			@click="action.action">
-			{{ action.text }}
+			:disabled="disabled"
+			:aria-label="text"
+			:icon="icon"
+			@click="action">
+			{{ text }}
 		</NcActionButton>
 	</NcActions>
 </template>
@@ -48,6 +74,14 @@ export default defineComponent({
 			required: true,
 		},
 
+		/**
+		 * The state whether the row is currently disabled
+		 */
+		disabled: {
+			type: Boolean,
+			required: true,
+		},
+
 		/**
 		 * The state whether the row is currently edited
 		 */
-- 
cgit v1.2.3

