Make transparency_exclusions use tuples in admin-fe
authorIlja <domainepublic@spectraltheorem.be>
Sat, 26 Dec 2020 10:35:05 +0000 (11:35 +0100)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Fri, 6 Aug 2021 05:59:53 +0000 (07:59 +0200)
* Make it use tuples
* I also changed the keys for key_placeholder and value_placeholder to use snake_case instead of camelCase

lib/pleroma/web/activity_pub/mrf.ex
lib/pleroma/web/activity_pub/mrf/keyword_policy.ex

index 5ac4f9f207b4bf12d4dbcc9ab14f5ab14c7c55ab..23ea039c34b24af5903c5a14d4338930887ab39c 100644 (file)
@@ -33,9 +33,11 @@ defmodule Pleroma.Web.ActivityPub.MRF do
         %{
           key: :transparency_exclusions,
           label: "MRF transparency exclusions",
-          type: {:list, :string},
+          type: {:list, :tuple},
+          key_placeholder: "instance",
+          value_placeholder: "reason",
           description:
-            "Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.",
+            "Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value. You can also provide a reason for excluding these instance names. The instances and reasons won't be publicly disclosed.",
           suggestions: [
             "exclusion.com"
           ]
index aebf78b4673a80a189bef2c3bcb1e50c5e002ff8..1383fa757365836c2d102212f2c0c9868cb9ff62 100644 (file)
@@ -159,8 +159,8 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do
         %{
           key: :replace,
           type: {:list, :tuple},
-          keyPlaceholder: "pattern",
-          valuePlaceholder: "replacement",
+          key_placeholder: "instance",
+          value_placeholder: "reason",
           description: """
             **Pattern**: a string or [Regex](https://hexdocs.pm/elixir/Regex.html) in the format of `~r/PATTERN/`.