Provide analytics on Front-end
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -5,6 +5,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
||||
|
||||
alias Mobilizon.Config
|
||||
alias Mobilizon.Events.Categories
|
||||
alias Mobilizon.Service.FrontEndAnalytics
|
||||
|
||||
@doc """
|
||||
Gets config.
|
||||
@@ -170,7 +171,8 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
||||
public_key:
|
||||
get_in(Application.get_env(:web_push_encryption, :vapid_details), [:public_key])
|
||||
},
|
||||
export_formats: Config.instance_export_formats()
|
||||
export_formats: Config.instance_export_formats(),
|
||||
analytics: FrontEndAnalytics.config()
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -75,6 +75,10 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
|
||||
field(:web_push, :web_push, description: "Web Push settings for the instance")
|
||||
|
||||
field(:export_formats, :export_formats, description: "The instance list of export formats")
|
||||
|
||||
field(:analytics, list_of(:analytics),
|
||||
description: "Configuration for diverse analytics services"
|
||||
)
|
||||
end
|
||||
|
||||
@desc """
|
||||
@@ -330,6 +334,28 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
|
||||
field(:public_key, :string, description: "The server's public WebPush VAPID key")
|
||||
end
|
||||
|
||||
object :analytics do
|
||||
field(:id, :string, description: "ID of the analytics service")
|
||||
field(:enabled, :boolean, description: "Whether the service is activated or not")
|
||||
|
||||
field(:configuration, list_of(:analytics_configuration),
|
||||
description: "A list of key-values configuration"
|
||||
)
|
||||
end
|
||||
|
||||
enum :analytics_configuration_type do
|
||||
value(:string, description: "A string")
|
||||
value(:integer, description: "An integer")
|
||||
value(:boolean, description: "A boolean")
|
||||
value(:float, description: "A float")
|
||||
end
|
||||
|
||||
object :analytics_configuration do
|
||||
field(:key, :string, description: "The key for the analytics configuration element")
|
||||
field(:value, :string, description: "The value for the analytics configuration element")
|
||||
field(:type, :analytics_configuration_type, description: "The analytics configuration type")
|
||||
end
|
||||
|
||||
@desc """
|
||||
Export formats configuration
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user