From 4fa78d7cd262e83e643153fbed012c1d0e4e9f32 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 22 Mar 2019 13:58:19 +0100 Subject: [PATCH] Get config and display/hide register button --- config/config.exs | 2 +- config/test.exs | 4 ++ js/src/components/NavBar.vue | 10 ++++- js/src/graphql/config.ts | 38 ++----------------- js/src/types/config.model.ts | 8 ++-- js/src/views/User/Login.vue | 13 ++++++- lib/mobilizon/common-config.ex | 17 ++++++++- lib/mobilizon_web/resolvers/config.ex | 2 +- .../resolvers/config_resolver_test.exs | 2 +- 9 files changed, 48 insertions(+), 48 deletions(-) diff --git a/config/config.exs b/config/config.exs index 97bf5c466..22e512fe4 100644 --- a/config/config.exs +++ b/config/config.exs @@ -12,7 +12,7 @@ config :mobilizon, config :mobilizon, :instance, name: System.get_env("MOBILIZON_INSTANCE_NAME") || "Localhost", version: "1.0.0-dev", - registrations_open: System.get_env("MOBILIZON_INSTANCE_REGISTRATIONS_OPEN") || true + registrations_open: System.get_env("MOBILIZON_INSTANCE_REGISTRATIONS_OPEN") || false config :mime, :types, %{ "application/activity+json" => ["activity-json"], diff --git a/config/test.exs b/config/test.exs index 3339f23a3..1ace33015 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,5 +1,9 @@ use Mix.Config +config :mobilizon, :instance, + name: "Test instance", + registrations_open: true + # We don't run a server during test. If one is required, # you can enable the server option below. config :mobilizon, MobilizonWeb.Endpoint, diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index 4eac95233..855ea2eea 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -18,7 +18,7 @@