From 109f2076fbbc81387edea62eccc15e3b70d984e4 Mon Sep 17 00:00:00 2001 From: Massimo Melina Date: Thu, 18 Jan 2024 15:18:38 +0100 Subject: [PATCH] admin/accounts: better field for "redirect" --- admin/src/AccountForm.ts | 4 +++- admin/src/InstalledPlugins.ts | 3 ++- frontend/src/menu.ts | 3 ++- plugins/list-uploader/public/main.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/admin/src/AccountForm.ts b/admin/src/AccountForm.ts index 30d871c17..5f9774eb7 100644 --- a/admin/src/AccountForm.ts +++ b/admin/src/AccountForm.ts @@ -12,6 +12,7 @@ import { createVerifierAndSalt, SRPParameters, SRPRoutines } from 'tssrp6a' import { AutoDelete, Delete } from '@mui/icons-material' import { isMobile } from './misc' import { state, useSnapState } from './state' +import VfsPathField from './VfsPathField' interface FormProps { account: Account, groups: string[], done: (username: string)=>void, reload: ()=>void, addToBar: ReactNode } export default function AccountForm({ account, done, groups, addToBar, reload }: FormProps) { @@ -77,7 +78,8 @@ export default function AccountForm({ account, done, groups, addToBar, reload }: + (!group ? '' : ". A group can inherit from another group") + (belongsOptions.length ? '' : ". Now disabled because there are no groups to select, create one first.") }, - { k: 'redirect', helperText: "If you want this account to be redirected to a specific folder/address at login time" }, + { k: 'redirect', comp: VfsPathField, + helperText: "If you want this account to be redirected to a specific folder/address at login time" }, ], onError: alertDialog, save: { diff --git a/admin/src/InstalledPlugins.ts b/admin/src/InstalledPlugins.ts index 4787a5ee3..22b79966a 100644 --- a/admin/src/InstalledPlugins.ts +++ b/admin/src/InstalledPlugins.ts @@ -68,7 +68,8 @@ export default function InstalledPlugins({ updates }: { updates?: true }) { ] : [ h(IconBtn, row.started ? { icon: StopCircle, - title: h(Box, {}, `Stop ${id}`, h('div', { 'aria-hidden': true }, `Started ` + new Date(row.started as string).toLocaleString())), + title: h(Box, { 'aria-hidden': true }, `Stop ${id}`, h('br'), `Started ` + new Date(row.started as string).toLocaleString()), + 'aria-label': `Stop ${id}`, size, color: 'success', async onClick() { diff --git a/frontend/src/menu.ts b/frontend/src/menu.ts index 054c4b4fc..e7e40cb45 100644 --- a/frontend/src/menu.ts +++ b/frontend/src/menu.ts @@ -159,7 +159,8 @@ interface MenuButtonProps extends ComponentPropsWithoutRef<"button"> { export function Btn({ icon, label, tooltip, toggled, onClick, onClickAnimation, ...rest }: MenuButtonProps) { const [working, setWorking] = useState(false) return h('button', { - title: tooltip || label, + title: label + prefix(' - ', tooltip), + 'aria-label': label, onClick() { if (!onClick) return if (onClickAnimation !== false) diff --git a/plugins/list-uploader/public/main.js b/plugins/list-uploader/public/main.js index 303b28fd3..86535100c 100644 --- a/plugins/list-uploader/public/main.js +++ b/plugins/list-uploader/public/main.js @@ -17,7 +17,7 @@ }, [data]) const iconOnly = display === 'tooltip' return text && HFS.h('span', { className: 'uploader', title: HFS.t`Uploader` + (iconOnly ? ' ' + text : '') }, - HFS.hIcon('upload'), ' ', !iconOnly && text, ' – ') + HFS.hIcon('upload'), ' ', !iconOnly && text, h('span', { 'aria-hidden': true }, ' – ')) } function getDetails(batched) {