From 89e0cfd8741b6763ca04e90558bccf4c3c380cfa Mon Sep 17 00:00:00 2001
From: tobi <31960611+tsmethurst@users.noreply.github.com>
Date: Sat, 13 Apr 2024 13:25:10 +0200
Subject: [feature] Admin accounts endpoints; approve/reject sign-ups (#2826)

* update settings panels, add pending overview + approve/deny functions

* add admin accounts get, approve, reject

* send approved/rejected emails

* use signup URL

* docs!

* email

* swagger

* web linting

* fix email tests

* wee lil fixerinos

* use new paging logic for GetAccounts() series of admin endpoints, small changes to query building

* shuffle useAccountIDIn check *before* adding to query

* fix parse from toot react error

* use `netip.Addr`

* put valid slices in globals

* optimistic updates for account state

---------

Co-authored-by: kim <grufwub@gmail.com>
---
 web/source/settings/admin/domain-permissions/form.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'web/source/settings/admin/domain-permissions/form.tsx')

diff --git a/web/source/settings/admin/domain-permissions/form.tsx b/web/source/settings/admin/domain-permissions/form.tsx
index fb639202d..57502d6d9 100644
--- a/web/source/settings/admin/domain-permissions/form.tsx
+++ b/web/source/settings/admin/domain-permissions/form.tsx
@@ -100,9 +100,9 @@ export default function ImportExportForm({ form, submitParse, parseResult }: Imp
 						onClick={() => submitParse()}
 						result={parseResult}
 						showError={false}
-						disabled={false}
+						disabled={form.permType.value === undefined || form.permType.value.length === 0}
 					/>
-					<label className="button with-icon">
+					<label className={`button with-icon${form.permType.value === undefined || form.permType.value.length === 0 ? " disabled" : ""}`}>
 						<i className="fa fa-fw " aria-hidden="true" />
 						Import file
 						<input
@@ -110,6 +110,7 @@ export default function ImportExportForm({ form, submitParse, parseResult }: Imp
 							className="hidden"
 							onChange={fileChanged}
 							accept="application/json,text/plain,text/csv"
+							disabled={form.permType.value === undefined || form.permType.value.length === 0}
 						/>
 					</label>
 					<b /> {/* grid filler */}
@@ -118,7 +119,7 @@ export default function ImportExportForm({ form, submitParse, parseResult }: Imp
 						type="button"
 						onClick={() => submitExport("export")}
 						result={exportResult} showError={false}
-						disabled={false}
+						disabled={form.permType.value === undefined || form.permType.value.length === 0}
 					/>
 					<MutationButton
 						label="Export to file"
@@ -127,7 +128,7 @@ export default function ImportExportForm({ form, submitParse, parseResult }: Imp
 						onClick={() => submitExport("export-file")}
 						result={exportResult}
 						showError={false}
-						disabled={false}
+						disabled={form.permType.value === undefined || form.permType.value.length === 0}
 					/>
 					<div className="export-file">
 						<span>
-- 
cgit v1.2.3

