From 9e96784d9e31ba5f405b77fa6261af848fea4e69 Mon Sep 17 00:00:00 2001 From: Kirill Platonov Date: Sun, 3 Dec 2023 07:16:23 +0100 Subject: [PATCH 1/4] Load rack-timeout only on production --- config/initializers/rack_timeout.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/initializers/rack_timeout.rb b/config/initializers/rack_timeout.rb index 36d1f6c..7c6de8b 100644 --- a/config/initializers/rack_timeout.rb +++ b/config/initializers/rack_timeout.rb @@ -1 +1,3 @@ -Rails.application.config.middleware.insert_before Rack::Runtime, Rack::Timeout, service_timeout: 27 +if Rails.env.production? + Rails.application.config.middleware.insert_before Rack::Runtime, Rack::Timeout, service_timeout: 27 +end From 08dc61d401230e4479ce8fd2930c2036a351c863 Mon Sep 17 00:00:00 2001 From: Kirill Platonov Date: Sun, 3 Dec 2023 07:16:30 +0100 Subject: [PATCH 2/4] Update PVC --- Gemfile.lock | 2 +- package.json | 2 +- yarn.lock | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9da1f70..fa3010d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -202,7 +202,7 @@ GEM ast (~> 2.4.1) racc pg (1.5.3) - polaris_view_components (1.1.0) + polaris_view_components (1.4.0) rails (>= 5.0.0) view_component (>= 3.0.0, < 4.0.0) prophet-rb (0.5.0) diff --git a/package.json b/package.json index d9e6e77..465b953 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "debounce": "^1.2.1", "esbuild": "^0.19.2", "globe.gl": "^2.29.2", - "polaris-view-components": "^1.1.0" + "polaris-view-components": "^1.3.0" }, "scripts": { "build": "esbuild app/javascript/*.* --bundle --minify --outdir=app/assets/builds --public-path=/assets" diff --git a/yarn.lock b/yarn.lock index 31f89ee..722c01c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -126,7 +126,7 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.2.tgz#1205014625790c7ff0e471644a878a65d1e34ab0" integrity sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw== -"@hotwired/stimulus@^3.2.1": +"@hotwired/stimulus@^3.2.1", "@hotwired/stimulus@^3.2.2": version "3.2.2" resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== @@ -403,12 +403,12 @@ lodash-es@4: resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== -polaris-view-components@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/polaris-view-components/-/polaris-view-components-1.1.0.tgz#92d35287aa75fe80715d6ffee7eb214232f13d29" - integrity sha512-pjHxPrYV9w42Cj86gVOKLzzUCteoSe5wsdIDyKDEtoUQ7GX3yTbQGCDXwhFKy4plHiGzQdJU44ABI2q0JEBTDw== +polaris-view-components@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/polaris-view-components/-/polaris-view-components-1.3.0.tgz#babba153a056b71fdebc8118a4be26ecb8ba2dd1" + integrity sha512-x07MPuNhA3fmP4UsufhsVMAFjot0ynmEj4d6pHvvgomhv4b6k/w3rteCnYE8fswAs+PurWjTtkY7YHgIIQdQMQ== dependencies: - "@hotwired/stimulus" "^3.2.1" + "@hotwired/stimulus" "^3.2.2" "@rails/request.js" "^0.0.8" polished@4: From 832b22689973ac5ec88bf0e9b1855cd78b3b6f2c Mon Sep 17 00:00:00 2001 From: Kirill Platonov Date: Sun, 3 Dec 2023 07:16:59 +0100 Subject: [PATCH 3/4] Hide empty rows in monthly summary --- app/models/summary/monthly.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/summary/monthly.rb b/app/models/summary/monthly.rb index a13926e..96b8fb2 100644 --- a/app/models/summary/monthly.rb +++ b/app/models/summary/monthly.rb @@ -26,7 +26,9 @@ def summarize summary[month][:user_churn] = churn end - summary + summary.keep_if do |month, data| + data[:payments] > 0 + end end private From 8238c63227839725755aa4065b712407c1c969e6 Mon Sep 17 00:00:00 2001 From: Kirill Platonov Date: Sun, 3 Dec 2023 07:17:16 +0100 Subject: [PATCH 4/4] Fix index table styles --- app/views/imports/index.html.erb | 4 +++- app/views/summarys/index.html.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/imports/index.html.erb b/app/views/imports/index.html.erb index 414e001..b955f60 100644 --- a/app/views/imports/index.html.erb +++ b/app/views/imports/index.html.erb @@ -37,7 +37,9 @@ <%= render "api_credentials_banner" %> <% end %> - <%= render "table", imports: @imports %> + <%= polaris_card(sectioned: false) do %> + <%= render "table", imports: @imports %> + <% end %> <% end %> diff --git a/app/views/summarys/index.html.erb b/app/views/summarys/index.html.erb index 6b6c4bc..80075f7 100644 --- a/app/views/summarys/index.html.erb +++ b/app/views/summarys/index.html.erb @@ -11,7 +11,7 @@ <%= render "app_filter", selected_app: @selected_app, app_titles: @app_titles %> - <%= polaris_card do %> + <%= polaris_card(sectioned: false) do %> <%= render controller_name, rows: @summaries %> <% end %>