From f6bce23a946ceab7c711a6dc2c922848546ee9eb Mon Sep 17 00:00:00 2001 From: npeter83 Date: Mon, 12 Oct 2026 20:06:30 +0200 Subject: [PATCH] =?UTF-8?q?fix(files):=20the=20Storage=20tab=20drops=20its?= =?UTF-8?q?=20user=20picker=20=E2=80=94=20every=20user=20already=20has=20a?= =?UTF-8?q?=20row=20and=20a=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The list holds every user, files or not, so the picker above it only repeated a row's Edit quota. The empty text names what the list holds: users. --- frontend/src/components/downloadAdmin.tsx | 27 +-------------------- frontend/src/i18n/locales/en/downloads.json | 3 +-- frontend/src/i18n/locales/hu/downloads.json | 3 +-- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/frontend/src/components/downloadAdmin.tsx b/frontend/src/components/downloadAdmin.tsx index 55e13286..fe9d4fc4 100644 --- a/frontend/src/components/downloadAdmin.tsx +++ b/frontend/src/components/downloadAdmin.tsx @@ -24,7 +24,6 @@ import { Input } from "./ui/Input"; import { CheckRow } from "./ui/NativeControls"; import { LoadingState, StateMessage } from "./ui/QueryState"; import { SURFACE } from "./ui/surfaces"; -import UserPicker from "./UserPicker"; // The admin Users page's "Storage" tab: the disk in three numbers, every user's footprint against // their own limit (the quota editor), and every user's downloads. Both lists are tables with aligned @@ -163,26 +162,6 @@ export function QuotaModal({ ); } -// Pick ANY user to set a download quota for — even one who hasn't downloaded anything yet (the -// footprint list below only shows users who already have files). -function QuotaUserPicker({ onPick }: { onPick: (u: { id: number; email: string }) => void }) { - const { t } = useTranslation(); - const users = useQuery({ queryKey: qk.adminUsers(), queryFn: api.adminUsers }); - const list = users.data ?? []; - return ( -
- void users.refetch()} - onPick={(u) => onPick({ id: u.id, email: u.email })} - label={t("downloads.admin.quotaPickPlaceholder")} - placeholder={t("downloads.admin.quotaPickPlaceholder")} - /> -
- ); -} export function StorageTab() { const { t, i18n } = useTranslation(); const lang = i18n.language; @@ -395,10 +374,6 @@ export function StorageTab() { )}
- {/* Set a quota for any user, regardless of whether they've downloaded anything. */} -
- -
{storage.isError && !s ? ( void storage.refetch()}> {t("common.loadError")} @@ -415,7 +390,7 @@ export function StorageTab() { keyboardNav fixedLayout rowProps={(u) => userMenu.triggerProps(u)} - emptyText={t("downloads.admin.noFootprint")} + emptyText={t("downloads.admin.noUsers")} /> )} diff --git a/frontend/src/i18n/locales/en/downloads.json b/frontend/src/i18n/locales/en/downloads.json index 2bd0e537..99476c47 100644 --- a/frontend/src/i18n/locales/en/downloads.json +++ b/frontend/src/i18n/locales/en/downloads.json @@ -188,8 +188,7 @@ "unlimited": "Unlimited (bypass storage limit)", "reset": "Reset to default", "save": "Save", - "quotaPickPlaceholder": "Set a user's quota…", - "noFootprint": "No downloads yet.", + "noUsers": "No users yet.", "allDownloads": "Every download", "columns": { "user": "User", diff --git a/frontend/src/i18n/locales/hu/downloads.json b/frontend/src/i18n/locales/hu/downloads.json index 85da3a2c..0ecd6fd1 100644 --- a/frontend/src/i18n/locales/hu/downloads.json +++ b/frontend/src/i18n/locales/hu/downloads.json @@ -188,8 +188,7 @@ "unlimited": "Korlátlan (tárhelykorlát kikapcsolása)", "reset": "Visszaállítás alapértékre", "save": "Mentés", - "quotaPickPlaceholder": "Kvóta beállítása egy felhasználónak…", - "noFootprint": "Még nincs letöltés.", + "noUsers": "Még nincs felhasználó.", "allDownloads": "Minden letöltés", "columns": { "user": "Felhasználó",