From 6b6c4689155f61b8113ef6d54a58044bf159ed20 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 20 Sep 2023 16:50:44 +0100 Subject: [PATCH 1/3] Install git in Docker to allow git repos in Gemfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f3c56e1615..446f71ac32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update \ curl \ default-jre-headless \ file \ + git-core \ gpg-agent \ libarchive-dev \ libffi-dev \ From 41f13ac73a740b16bce708b23db8b2cdb6d24d1f Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 20 Sep 2023 15:26:58 +0100 Subject: [PATCH 2/3] Switch from sassc-rails to dartsass-sprockets sassc-rails, and its underlying libsass, is deprecated. dartsass-sprockets allows us to use the currently maintained dartsass implementation, without having to change any of our toolchain. The version of sass-embedded is pinned to avoid warnings in bootstrap. When we upgrade bootstrap versions, we can upgrade sass-embedded to match. --- Gemfile | 6 ++++-- Gemfile.lock | 40 +++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index f60a219e7b..ea5fc3e9d3 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,9 @@ gem "json" gem "pg" # Use SCSS for stylesheets -gem "sassc-rails" +gem "dartsass-sprockets" +# Pin the dependentent sass-embedded to avoid deprecation warnings in bootstrap +gem "sass-embedded", "~> 1.55.0" # Use Terser as compressor for JavaScript assets gem "terser" @@ -43,7 +45,7 @@ gem "sprockets-exporters_pack" gem "actionpack-page_caching", ">= 1.2.0" gem "activerecord-import" gem "active_record_union" -gem "bootstrap", "~> 5.1.0" +gem "bootstrap", :github => "gravitystorm/bootstrap-rubygem", :branch => "dartsass_5_1_3" gem "bootstrap_form", "~> 5.0" gem "cancancan" gem "composite_primary_keys", "~> 14.0.0" diff --git a/Gemfile.lock b/Gemfile.lock index d224d95eec..0d2e61366d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: https://github.com/gravitystorm/bootstrap-rubygem.git + revision: 8c48a63412e0ef1a280b95ef5344667be92d374a + branch: dartsass_5_1_3 + specs: + bootstrap (5.1.3) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 2.9.3, < 3) + GEM remote: https://rubygems.org/ specs: @@ -117,10 +126,6 @@ GEM debug_inspector (>= 0.0.1) bootsnap (1.16.0) msgpack (~> 1.2) - bootstrap (5.1.3) - autoprefixer-rails (>= 9.1.0) - popper_js (>= 2.9.3, < 3) - sassc-rails (>= 2.0.0) bootstrap_form (5.3.2) actionpack (>= 6.1) activemodel (>= 6.1) @@ -153,6 +158,14 @@ GEM rexml crass (1.0.6) dalli (3.2.6) + dartsass-ruby (3.0.1) + sass-embedded (~> 1.54) + dartsass-sprockets (3.0.0) + dartsass-ruby (~> 3.0) + railties (>= 4.0.0) + sprockets (> 3.0) + sprockets-rails + tilt date (3.3.3) debug_inspector (1.1.0) deep_merge (1.2.2) @@ -231,6 +244,7 @@ GEM ffi (>= 1.0.0) globalid (1.2.1) activesupport (>= 6.1) + google-protobuf (3.24.3) hashdiff (1.0.1) hashie (5.0.0) highline (2.1.0) @@ -474,14 +488,9 @@ GEM sanitize (6.1.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - sassc (2.4.0) - ffi (~> 1.9) - sassc-rails (2.1.2) - railties (>= 4.0.0) - sassc (>= 2.0) - sprockets (> 3.0) - sprockets-rails - tilt + sass-embedded (1.55.0) + google-protobuf (~> 3.19) + rake (>= 10.0.0) secure_headers (6.5.0) selenium-webdriver (4.13.1) rexml (~> 3.2, >= 3.2.5) @@ -551,7 +560,7 @@ DEPENDENCIES better_errors binding_of_caller bootsnap (>= 1.4.2) - bootstrap (~> 5.1.0) + bootstrap! bootstrap_form (~> 5.0) brakeman browser @@ -563,6 +572,7 @@ DEPENDENCIES config connection_pool dalli + dartsass-sprockets debug_inspector delayed_job_active_record doorkeeper @@ -619,7 +629,7 @@ DEPENDENCIES rubocop-rails rubocop-rake sanitize - sassc-rails + sass-embedded (~> 1.55.0) secure_headers selenium-webdriver simplecov @@ -632,4 +642,4 @@ DEPENDENCIES webmock BUNDLED WITH - 2.3.26 + 2.4.19 From c975bae5074e4211a86458856030f0d17eaef917 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 27 Sep 2023 09:23:26 +0100 Subject: [PATCH 3/3] Workaround for dartsass vs bootstrap 5.1 bug --- app/assets/stylesheets/parameters.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/assets/stylesheets/parameters.scss b/app/assets/stylesheets/parameters.scss index e0082a26aa..4f93273a89 100644 --- a/app/assets/stylesheets/parameters.scss +++ b/app/assets/stylesheets/parameters.scss @@ -24,3 +24,13 @@ $link-hover-decoration: underline; $table-striped-bg: $offwhite; $enable-negative-margins: true; + +// Workaround for a dartsass bug with bootstrap 5.1 +// This can be removed after upgrading to bootstrap 5.2 +// This copies definitions straight from bootstrap, but uses the sass-native +// version of the subtract function. +$border-width: 2px; +$border-radius: .35rem; +$card-border-radius: $border-radius; +$card-border-width: $border-width; +$card-inner-border-radius: subtract($card-border-radius, $card-border-width);