Skip to content

Commit

Permalink
🐛 Fix showing the wrong join page URL in instructions
Browse files Browse the repository at this point in the history
Why:
- The code was hard-coded to show "http://localhost:8080/join"
- The link however pointed to the correct page, because it was relative.
  • Loading branch information
luontola committed Jul 14, 2024
1 parent 5fafc27 commit ad7307f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/territory_bro/ui/settings_page.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[ring.util.response :as response]
[territory-bro.api :as api]
[territory-bro.infra.authentication :as auth]
[territory-bro.infra.config :as config]
[territory-bro.ui.css :as css]
[territory-bro.ui.forms :as forms]
[territory-bro.ui.html :as html]
Expand Down Expand Up @@ -177,7 +178,7 @@
:hx-swap "outerHTML"}
[:h2 (i18n/t "UserManagement.title")]
[:p (-> (i18n/t "UserManagement.addUserInstructions")
(str/replace "{{joinPageUrl}}" "http://localhost:8080/join")
(str/replace "{{joinPageUrl}}" (str (:public-url config/env) "/join"))
(str/replace "<0>" "<a href=\"/join\">")
(str/replace "</0>" "</a>")
(h/raw))]
Expand Down
7 changes: 4 additions & 3 deletions test/territory_bro/ui/settings_page_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,17 @@
Users
To add users to this congregation, ask them to visit http://localhost:8080/join and copy their User ID
To add users to this congregation, ask them to visit https://beta.territorybro.com/join and copy their User ID
from that page and send it to you.
User ID []
Add user
Name Email Login method Actions
Esko Luontola Google Remove user")
(-> (settings-page/view model)
html/visible-text))))
(binding [config/env {:public-url "https://beta.territorybro.com"}]
(-> (settings-page/view model)
html/visible-text)))))

(deftest ^:slow save-congregation-settings!-test
(with-fixtures [db-fixture api-fixture]
Expand Down

0 comments on commit ad7307f

Please sign in to comment.