From b1844323314dd1f0832f1fcdb765a7f67ca01dbc Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 4 Apr 2025 18:29:22 +0200 Subject: [feature] Allow editing domain blocks/allows, fix comment import (#3967) * start implementing editing of existing domain permissions * [feature] Allow editing domain blocks/allows, fix comment import * [bugfix] Use "comment" via /api/v1/instance * fix the stuff --- .../moderation/domain-permissions/process.tsx | 103 ++++++++++----------- 1 file changed, 49 insertions(+), 54 deletions(-) (limited to 'web/source/settings/views/moderation/domain-permissions/process.tsx') diff --git a/web/source/settings/views/moderation/domain-permissions/process.tsx b/web/source/settings/views/moderation/domain-permissions/process.tsx index d54d7399c..7338e4424 100644 --- a/web/source/settings/views/moderation/domain-permissions/process.tsx +++ b/web/source/settings/views/moderation/domain-permissions/process.tsx @@ -24,14 +24,12 @@ import { isValidDomainPermission, hasBetterScope } from "../../../lib/util/domai import { useTextInput, useBoolInput, - useRadioInput, useCheckListInput, } from "../../../lib/form"; import { Select, TextArea, - RadioGroup, Checkbox, TextInput, } from "../../../components/form/inputs"; @@ -113,84 +111,81 @@ function ImportList({ list, data: domainPerms, permType }: ImportListProps) { privateComment: useTextInput("private_comment", { defaultValue: `Imported on ${new Date().toLocaleString()}` }), - privateCommentBehavior: useRadioInput("private_comment_behavior", { - defaultValue: "append", - options: { - append: "Append to", - replace: "Replace" - } - }), + replacePrivateComment: useBoolInput("replace_private_comment", { defaultValue: false }), publicComment: useTextInput("public_comment"), - publicCommentBehavior: useRadioInput("public_comment_behavior", { - defaultValue: "append", - options: { - append: "Append to", - replace: "Replace" - } - }), + replacePublicComment: useBoolInput("replace_public_comment", { defaultValue: false }), permType: permType, }; - const [importDomains, importResult] = useFormSubmit(form, useImportDomainPermsMutation(), { changedOnly: false }); + const [importDomains, importResult] = useFormSubmit( + form, + useImportDomainPermsMutation(), + { changedOnly: false }, + ); return ( - <> -
- > +