From d2568d9065f1e5e6ada0527ab7745177a4412598 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Fri, 28 Feb 2025 20:53:12 +0100 Subject: [PATCH 1/3] Add customizable source URL --- app/views/shared/_links.html.haml | 2 +- config/justask.yml.example | 3 +++ lib/retrospring/version.rb | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_links.html.haml b/app/views/shared/_links.html.haml index c330142b..dc536b59 100644 --- a/app/views/shared/_links.html.haml +++ b/app/views/shared/_links.html.haml @@ -5,7 +5,7 @@ · = link_to t(".about"), about_path · - = link_to t(".source"), "https://github.com/Retrospring/retrospring" + = link_to t(".source"), Retrospring::Version.source_url · = link_to t(".terms"), terms_path · diff --git a/config/justask.yml.example b/config/justask.yml.example index 6369428d..cb4f1eee 100644 --- a/config/justask.yml.example +++ b/config/justask.yml.example @@ -108,3 +108,6 @@ sentry_dsn: '' # sso: "CANNY_SSO_TOKEN_HERE" # feature_board: "CANNY_FEATURE_BOARD_TOKEN" # bug_board: "CANNY_BUGS_BOARD_TOKEN" + +# If you run a fork, please uncomment and adjust this url! +# source_url: "https://github.com/retrospring/retrospring" \ No newline at end of file diff --git a/lib/retrospring/version.rb b/lib/retrospring/version.rb index 0152d9c8..4c2bdc4a 100644 --- a/lib/retrospring/version.rb +++ b/lib/retrospring/version.rb @@ -25,6 +25,8 @@ module Retrospring def minor = [month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join + def source_url = APP_CONFIG.dig(:source_url) || "https://github.com/retrospring/retrospring" + def to_a = [year.to_s, minor, patch.to_s] def to_s = [to_a.join("."), suffix].join From 9f8fadbc9cdbb5dff9d250e46d23d9fcd23dee67 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Fri, 28 Feb 2025 22:05:17 +0100 Subject: [PATCH 2/3] Allow other encountered dig calls in index_advanced spec to pass through --- spec/views/about/index_advanced.html.haml_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/views/about/index_advanced.html.haml_spec.rb b/spec/views/about/index_advanced.html.haml_spec.rb index 000e028d..22308b93 100644 --- a/spec/views/about/index_advanced.html.haml_spec.rb +++ b/spec/views/about/index_advanced.html.haml_spec.rb @@ -13,6 +13,10 @@ describe "about/index_advanced.html.haml", type: :view do subject(:rendered) { render } + before do + allow(APP_CONFIG).to receive(:dig).and_call_original + end + context "registrations are enabled" do before do allow(APP_CONFIG).to receive(:dig).with(:features, :registration, :enabled).and_return(true) From 2601d580da33fa53e1ef8383d2459326ad4d14f8 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Fri, 28 Feb 2025 22:09:47 +0100 Subject: [PATCH 3/3] Fix Rubocop nits --- lib/retrospring/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/retrospring/version.rb b/lib/retrospring/version.rb index 4c2bdc4a..db596aaa 100644 --- a/lib/retrospring/version.rb +++ b/lib/retrospring/version.rb @@ -25,7 +25,7 @@ module Retrospring def minor = [month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join - def source_url = APP_CONFIG.dig(:source_url) || "https://github.com/retrospring/retrospring" + def source_url = APP_CONFIG[:source_url] || "https://github.com/retrospring/retrospring" def to_a = [year.to_s, minor, patch.to_s]