From 83716ad3a2686504989d57805fe4ac05ff15b4d3 Mon Sep 17 00:00:00 2001 From: FinnIckler Date: Mon, 28 Oct 2024 15:48:27 +0100 Subject: [PATCH] set V2_REGISTRATIONS_POLL_URL as optional in local --- app/webpacker/lib/requests/routes.js.erb | 4 ++-- env_config.rb | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/webpacker/lib/requests/routes.js.erb b/app/webpacker/lib/requests/routes.js.erb index aa261a7b5bf..5d805292832 100644 --- a/app/webpacker/lib/requests/routes.js.erb +++ b/app/webpacker/lib/requests/routes.js.erb @@ -237,8 +237,8 @@ export const panelUrls = { export const userPreferencesRoute = `<%= CGI.unescape(Rails.application.routes.url_helpers.profile_edit_path)%>?section=preferences`; export const pollingRoute = (userId, competitionId) => ({ - v2: `<%= CGI.unescape(EnvConfig.V2_REGISTRATIONS_POLL_URL)%>?attendee_id=${competitionId}-${userId}`, - v3: `<%= CGI.unescape(EnvConfig.V3_REGISTRATIONS_POLL_URL)%>?competition_id=${competitionId}&user_id=${userId}` + v2: `<%= EnvConfig.V2_REGISTRATIONS_POLL_URL %>?attendee_id=${competitionId}-${userId}`, + v3: `<%= EnvConfig.V3_REGISTRATIONS_POLL_URL %>?competition_id=${competitionId}&user_id=${userId}` }); export const wcaRegistrationUrl = `<%= CGI.unescape(EnvConfig.WCA_REGISTRATIONS_URL)%>`; diff --git a/env_config.rb b/env_config.rb index 3a24df9a370..d1f7efeb7c3 100644 --- a/env_config.rb +++ b/env_config.rb @@ -32,6 +32,11 @@ mandatory :WCA_REGISTRATIONS_URL, :string mandatory :ASSET_HOST, :string mandatory :CDN_ASSETS_DISTRIBUTION_ID, :string + + if is_compiling_assets + mandatory :V2_REGISTRATIONS_POLL_URL, :string + mandatory :V3_REGISTRATIONS_POLL_URL, :string + end else optional :READ_REPLICA_HOST, :string, '' optional :CACHE_REDIS_URL, :string, '' @@ -52,6 +57,8 @@ optional :WCA_REGISTRATIONS_POLL_URL, :string, '' optional :PAYPAL_BASE_URL, :string, '' optional :WRC_WEBHOOK_URL, :string, '' + optional :V2_REGISTRATIONS_POLL_URL, '' + optional :V3_REGISTRATIONS_POLL_URL, '' # Local-specific stuff optional :DISABLE_BULLET, :bool, false @@ -60,11 +67,6 @@ mandatory :WCA_REGISTRATIONS_BACKEND_URL, :string end - if is_compiling_assets - mandatory :V2_REGISTRATIONS_POLL_URL, :string - mandatory :V3_REGISTRATIONS_POLL_URL, :string - end - if Rails.env.test? optional :DISABLE_WEBMOCK, :bool, false optional :DISABLE_NET_CONNECT_IN_TESTS, :bool, false