diff --git a/lib/graphql/resolvers/config.ex b/lib/graphql/resolvers/config.ex index 0d9d36eb8..62acb57a2 100644 --- a/lib/graphql/resolvers/config.ex +++ b/lib/graphql/resolvers/config.ex @@ -88,7 +88,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do get_in(Application.get_env(:web_push_encryption, :vapid_details), [:public_key]) %{ - external_urls: Config.external_urls(), + external_links: Config.external_links(), name: Config.instance_name(), registrations_open: Config.instance_registrations_open?(), registrations_moderation: Config.instance_registrations_moderation?(), diff --git a/lib/graphql/schema/admin.ex b/lib/graphql/schema/admin.ex index 72a1af32c..702fd3003 100644 --- a/lib/graphql/schema/admin.ex +++ b/lib/graphql/schema/admin.ex @@ -160,19 +160,19 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do field(:instance_languages, list_of(:string), description: "The instance's languages") - field(:external_urls, list_of(:external_url), + field(:external_links, list_of(:external_link), description: "List of URL that will be shown to users" ) end - object :external_url do + object :external_link do meta(:authorize, :all) - field(:label, non_null(:string), description: "A human-readable label for the external URL") - field(:url, non_null(:string), description: "The actual external URL") - field(:enabled, non_null(:boolean), description: "Whether the external URL is enabled") + field(:label, non_null(:string), description: "A human-readable label for the external link") + field(:url, non_null(:string), description: "The external link URL") + field(:enabled, non_null(:boolean), description: "Whether the link URL is enabled") end - input_object :external_url_input do + input_object :external_link_input do meta(:authorize, :administrator) field(:label, non_null(:string)) field(:url, non_null(:string)) @@ -494,8 +494,8 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do arg(:instance_languages, list_of(:string), description: "The instance's languages") - arg(:external_urls, list_of(:external_url_input), - description: "Array of external URLs with label, status, and id" + arg(:external_links, list_of(:external_link_input), + description: "Array of external links with label, status, and id" ) middleware(Rajska.QueryAuthorization, permit: :administrator) diff --git a/lib/graphql/schema/config.ex b/lib/graphql/schema/config.ex index e244f76a7..7c99fa100 100644 --- a/lib/graphql/schema/config.ex +++ b/lib/graphql/schema/config.ex @@ -104,7 +104,7 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do field(:search, :search_settings, description: "The instance's search settings") - field(:external_urls, list_of(:external_url), + field(:external_links, list_of(:external_link), description: "List of URL that will be shown to users" ) end diff --git a/lib/mobilizon/config.ex b/lib/mobilizon/config.ex index d9159f7eb..27622b1f1 100644 --- a/lib/mobilizon/config.ex +++ b/lib/mobilizon/config.ex @@ -59,13 +59,13 @@ defmodule Mobilizon.Config do instance_config()[:name] ) - @spec external_urls :: String.t() - def external_urls do - config_cached_value("instance", "external_urls", []) - |> Enum.map(&transform_external_url/1) + @spec external_links :: String.t() + def external_links do + config_cached_value("instance", "external_links", []) + |> Enum.map(&transform_external_link/1) end - def transform_external_url(map) do + def transform_external_link(map) do %{ enabled: Map.fetch!(map, "enabled"), label: Map.fetch!(map, "label"), @@ -490,7 +490,7 @@ defmodule Mobilizon.Config do instance_privacy_policy_url: instance_privacy_url(), instance_rules: instance_rules(), instance_languages: instance_languages(), - external_urls: external_urls() + external_links: external_links() } end diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index b16c29ade..adaff0a41 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -68,7 +68,7 @@ >{{ t("Register") }} -