diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index 6e825fb1a..1256b22c1 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -51,6 +51,7 @@ > </b-navbar-item> <b-navbar-item + v-if="config && config.features.koenaConnect" class="koena" tag="a" href="https://mediation.koena.net/framasoft/mobilizon/" diff --git a/js/src/graphql/config.ts b/js/src/graphql/config.ts index 17402aa23..ba02ad920 100644 --- a/js/src/graphql/config.ts +++ b/js/src/graphql/config.ts @@ -67,6 +67,7 @@ export const CONFIG = gql` features { groups eventCreation + koenaConnect } auth { ldap diff --git a/js/src/types/config.model.ts b/js/src/types/config.model.ts index 6194115f8..86147207e 100644 --- a/js/src/types/config.model.ts +++ b/js/src/types/config.model.ts @@ -82,6 +82,7 @@ export interface IConfig { features: { eventCreation: boolean; groups: boolean; + koenaConnect: boolean; }; federating: boolean; version: string; diff --git a/js/tests/unit/specs/mocks/config.ts b/js/tests/unit/specs/mocks/config.ts index 1cfd467a0..8c581e6cf 100644 --- a/js/tests/unit/specs/mocks/config.ts +++ b/js/tests/unit/specs/mocks/config.ts @@ -54,6 +54,7 @@ export const configMock = { __typename: "Features", eventCreation: true, groups: true, + koenaConnect: false, }, geocoding: { __typename: "Geocoding", diff --git a/lib/graphql/resolvers/config.ex b/lib/graphql/resolvers/config.ex index a56a7d655..ad25b8bbd 100644 --- a/lib/graphql/resolvers/config.ex +++ b/lib/graphql/resolvers/config.ex @@ -126,7 +126,8 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do timezones: Tzdata.zone_list(), features: %{ groups: Config.instance_group_feature_enabled?(), - event_creation: Config.instance_event_creation_enabled?() + event_creation: Config.instance_event_creation_enabled?(), + koena_connect: Config.get([:instance, :koena_connect_link], false) }, rules: Config.instance_rules(), version: Config.instance_version(), diff --git a/lib/graphql/schema/config.ex b/lib/graphql/schema/config.ex index ac2353e47..d33cca9f0 100644 --- a/lib/graphql/schema/config.ex +++ b/lib/graphql/schema/config.ex @@ -268,6 +268,8 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do field(:event_creation, :boolean, description: "Whether event creation is allowed on this instance" ) + + field(:koena_connect, :boolean, description: "Activate link to Koena Connect") end @desc """