From 85dd90f689ce8831dff645d14f03a60a67181e4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Jul 2021 20:49:50 +0200 Subject: [PATCH 01/34] build(deps): bump addressable from 2.7.0 to 2.8.0 (#649) Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0. - [Release notes](https://github.com/sporkmonger/addressable/releases) - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0) --- updated-dependencies: - dependency-name: addressable dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f3797bd5..88bfe976 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,7 +69,7 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) airbrussh (1.4.0) sshkit (>= 1.6.1, != 1.7.0) From 9aa0c5f05a531795dcbe5dd96ff5124b46747757 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Dec 2021 13:42:44 +0100 Subject: [PATCH 02/34] build(deps): bump sidekiq from 6.1.3 to 6.2.1 (#651) Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.1.3 to 6.2.1. - [Release notes](https://github.com/mperham/sidekiq/releases) - [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md) - [Commits](https://github.com/mperham/sidekiq/compare/v6.1.3...v6.2.1) --- updated-dependencies: - dependency-name: sidekiq dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index a1cf2a6b..c2964b19 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ gem 'prawn', '~> 2.4.0' gem 'prawn-table', '~> 0.2.2' gem 'pg_search', '~> 2.3.5' gem 'skylight', '~> 5.0' -gem 'sidekiq', '~> 6.1.2' +gem 'sidekiq', '~> 6.2.1' gem 'sidekiq-cron', '~> 1.2.0' gem 'aws-sdk-s3', '~> 1.94', require: false gem 'image_processing', '~> 1.2' diff --git a/Gemfile.lock b/Gemfile.lock index 88bfe976..8c192111 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -300,7 +300,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rdiscount (2.2.0.2) - redis (4.2.5) + redis (4.4.0) regexp_parser (2.1.1) responders (3.0.1) actionpack (>= 5.0) @@ -363,7 +363,7 @@ GEM rubyzip (>= 1.2.2) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) - sidekiq (6.1.3) + sidekiq (6.2.1) connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) @@ -468,7 +468,7 @@ DEPENDENCIES select2-rails (~> 4.0.13) selenium-webdriver (~> 3.142) shoulda-matchers (~> 4.4) - sidekiq (~> 6.1.2) + sidekiq (~> 6.2.1) sidekiq-cron (~> 1.2.0) simple_form (~> 5.0.2) simplecov (~> 0.17) From 9343a7fe2536d506966124a5cb2b6300934761a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Dec 2021 13:42:54 +0100 Subject: [PATCH 03/34] build(deps): bump nokogiri from 1.11.4 to 1.12.5 (#650) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.4 to 1.12.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.4...v1.12.5) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8c192111..e81a30b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,7 +223,7 @@ GEM mime-types-data (3.2021.0225) mini_magick (4.11.0) mini_mime (1.0.3) - mini_portile2 (2.5.1) + mini_portile2 (2.6.1) minitest (5.14.4) msgpack (1.4.2) net-scp (3.0.0) @@ -231,8 +231,8 @@ GEM net-ssh (6.1.0) netrc (0.11.0) nio4r (2.5.7) - nokogiri (1.11.4) - mini_portile2 (~> 2.5.0) + nokogiri (1.12.5) + mini_portile2 (~> 2.6.1) racc (~> 1.4) orm_adapter (0.5.0) parallel (1.20.1) From 22b3f8de78bb0c405d014f49eb2450a6c34183c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:38:02 +0200 Subject: [PATCH 04/34] build(deps): bump jmespath from 1.4.0 to 1.6.1 (#659) Bumps [jmespath](https://github.com/trevorrowe/jmespath.rb) from 1.4.0 to 1.6.1. - [Release notes](https://github.com/trevorrowe/jmespath.rb/releases) - [Changelog](https://github.com/jmespath/jmespath.rb/blob/main/CHANGELOG.md) - [Commits](https://github.com/trevorrowe/jmespath.rb/compare/v1.4.0...v1.6.1) --- updated-dependencies: - dependency-name: jmespath dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e81a30b2..00989200 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -178,7 +178,7 @@ GEM has_scope (~> 0.6) railties (>= 5.2, < 6.2) responders (>= 2, < 4) - jmespath (1.4.0) + jmespath (1.6.1) jquery-rails (4.3.5) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) From 8852d95a2ae6d058765f123379b33e70244ba72a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:38:13 +0200 Subject: [PATCH 05/34] build(deps): bump rack from 2.2.3 to 2.2.3.1 (#658) Bumps [rack](https://github.com/rack/rack) from 2.2.3 to 2.2.3.1. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/2.2.3...2.2.3.1) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 00989200..3862dfe8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -253,7 +253,7 @@ GEM activesupport (>= 3.0.0) raabro (1.4.0) racc (1.5.2) - rack (2.2.3) + rack (2.2.3.1) rack-test (1.1.0) rack (>= 1.0, < 3) rails (6.1.3.1) From d335ce42538da48c2944f09f6a75c84ba6641adf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:39:22 +0200 Subject: [PATCH 06/34] build(deps): bump nokogiri from 1.12.5 to 1.13.6 (#657) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.12.5 to 1.13.6. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.12.5...v1.13.6) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marc Anguera --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3862dfe8..a3d9a7db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,7 +223,7 @@ GEM mime-types-data (3.2021.0225) mini_magick (4.11.0) mini_mime (1.0.3) - mini_portile2 (2.6.1) + mini_portile2 (2.8.0) minitest (5.14.4) msgpack (1.4.2) net-scp (3.0.0) @@ -231,8 +231,8 @@ GEM net-ssh (6.1.0) netrc (0.11.0) nio4r (2.5.7) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.6) + mini_portile2 (~> 2.8.0) racc (~> 1.4) orm_adapter (0.5.0) parallel (1.20.1) @@ -252,7 +252,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3.1) rack-test (1.1.0) rack (>= 1.0, < 3) From c0f038e457537444a5d529bf13999fa25a50ae25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:39:32 +0200 Subject: [PATCH 07/34] build(deps): bump image_processing from 1.12.1 to 1.12.2 (#654) Bumps [image_processing](https://github.com/janko/image_processing) from 1.12.1 to 1.12.2. - [Release notes](https://github.com/janko/image_processing/releases) - [Changelog](https://github.com/janko/image_processing/blob/master/CHANGELOG.md) - [Commits](https://github.com/janko/image_processing/compare/v1.12.1...v1.12.2) --- updated-dependencies: - dependency-name: image_processing dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index c2964b19..201ca7f1 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ gem 'skylight', '~> 5.0' gem 'sidekiq', '~> 6.2.1' gem 'sidekiq-cron', '~> 1.2.0' gem 'aws-sdk-s3', '~> 1.94', require: false -gem 'image_processing', '~> 1.2' +gem 'image_processing', '~> 1.12' # Assets gem 'jquery-rails', '~> 4.3.5' diff --git a/Gemfile.lock b/Gemfile.lock index a3d9a7db..535580f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,7 +151,7 @@ GEM fabrication (2.22.0) faker (2.17.0) i18n (>= 1.6, < 2) - ffi (1.15.0) + ffi (1.15.5) formtastic (4.0.0) actionpack (>= 5.2.0) formtastic_i18n (0.6.0) @@ -170,7 +170,7 @@ GEM http_accept_language (2.1.1) i18n (1.8.10) concurrent-ruby (~> 1.0) - image_processing (1.12.1) + image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) inherited_resources (1.12.0) @@ -345,7 +345,7 @@ GEM rack (>= 1.1) rubocop (>= 0.90.0, < 2.0) ruby-progressbar (1.11.0) - ruby-vips (2.1.0) + ruby-vips (2.1.4) ffi (~> 1.12) ruby2_keywords (0.0.4) rubyzip (2.3.0) @@ -443,7 +443,7 @@ DEPENDENCIES faker (~> 2.15) has_scope (~> 0.7.2) http_accept_language (~> 2.1.1) - image_processing (~> 1.2) + image_processing (~> 1.12) jquery-rails (~> 4.3.5) json_translate (~> 4.0.0) kaminari (~> 1.2.1) From ef58e4d6c5d683fa455ccccb192cb70c4a60bf6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:39:59 +0200 Subject: [PATCH 08/34] build(deps): bump sidekiq from 6.2.1 to 6.4.0 (#652) Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.2.1 to 6.4.0. - [Release notes](https://github.com/mperham/sidekiq/releases) - [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md) - [Commits](https://github.com/mperham/sidekiq/compare/v6.2.1...v6.4.0) --- updated-dependencies: - dependency-name: sidekiq dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 201ca7f1..a54eb300 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ gem 'prawn', '~> 2.4.0' gem 'prawn-table', '~> 0.2.2' gem 'pg_search', '~> 2.3.5' gem 'skylight', '~> 5.0' -gem 'sidekiq', '~> 6.2.1' +gem 'sidekiq', '~> 6.4.0' gem 'sidekiq-cron', '~> 1.2.0' gem 'aws-sdk-s3', '~> 1.94', require: false gem 'image_processing', '~> 1.12' diff --git a/Gemfile.lock b/Gemfile.lock index 535580f6..35305866 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -300,7 +300,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rdiscount (2.2.0.2) - redis (4.4.0) + redis (4.5.1) regexp_parser (2.1.1) responders (3.0.1) actionpack (>= 5.0) @@ -363,7 +363,7 @@ GEM rubyzip (>= 1.2.2) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) - sidekiq (6.2.1) + sidekiq (6.4.0) connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) @@ -468,7 +468,7 @@ DEPENDENCIES select2-rails (~> 4.0.13) selenium-webdriver (~> 3.142) shoulda-matchers (~> 4.4) - sidekiq (~> 6.2.1) + sidekiq (~> 6.4.0) sidekiq-cron (~> 1.2.0) simple_form (~> 5.0.2) simplecov (~> 0.17) From a63987572907d16fe0031cdab79c6cb3f58c9a52 Mon Sep 17 00:00:00 2001 From: Marc Anguera Date: Thu, 30 Jun 2022 21:44:03 +0200 Subject: [PATCH 09/34] update Rails to latest patch version (6.1.3 -> 6.1.6) + other minor upgrades (#660) --- Gemfile | 2 +- Gemfile.lock | 160 +++++++++--------- .../application/bootstrap-custom.scss | 18 -- app/views/tags/_grouped_index.html.erb | 2 +- spec/controllers/transfers_controller_spec.rb | 10 +- 5 files changed, 87 insertions(+), 105 deletions(-) diff --git a/Gemfile b/Gemfile index a54eb300..e5c4a91f 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem 'rails-i18n', '~> 6.0.0' gem 'rdiscount', '~> 2.2.0.1' gem 'rubyzip', '~> 2.3.0' gem 'activeadmin', '~> 2.9.0' -gem 'bootsnap', '~> 1.7.3', require: false +gem 'bootsnap', '~> 1.12.0', require: false gem 'has_scope', '~> 0.7.2' gem 'pundit', '~> 2.1.0' gem 'pg', '~> 1.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index 35305866..15244705 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,40 +1,40 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.3.1) - actionpack (= 6.1.3.1) - activesupport (= 6.1.3.1) + actioncable (6.1.6) + actionpack (= 6.1.6) + activesupport (= 6.1.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.3.1) - actionpack (= 6.1.3.1) - activejob (= 6.1.3.1) - activerecord (= 6.1.3.1) - activestorage (= 6.1.3.1) - activesupport (= 6.1.3.1) + actionmailbox (6.1.6) + actionpack (= 6.1.6) + activejob (= 6.1.6) + activerecord (= 6.1.6) + activestorage (= 6.1.6) + activesupport (= 6.1.6) mail (>= 2.7.1) - actionmailer (6.1.3.1) - actionpack (= 6.1.3.1) - actionview (= 6.1.3.1) - activejob (= 6.1.3.1) - activesupport (= 6.1.3.1) + actionmailer (6.1.6) + actionpack (= 6.1.6) + actionview (= 6.1.6) + activejob (= 6.1.6) + activesupport (= 6.1.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.3.1) - actionview (= 6.1.3.1) - activesupport (= 6.1.3.1) + actionpack (6.1.6) + actionview (= 6.1.6) + activesupport (= 6.1.6) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.3.1) - actionpack (= 6.1.3.1) - activerecord (= 6.1.3.1) - activestorage (= 6.1.3.1) - activesupport (= 6.1.3.1) + actiontext (6.1.6) + actionpack (= 6.1.6) + activerecord (= 6.1.6) + activestorage (= 6.1.6) + activesupport (= 6.1.6) nokogiri (>= 1.8.5) - actionview (6.1.3.1) - activesupport (= 6.1.3.1) + actionview (6.1.6) + activesupport (= 6.1.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -48,22 +48,22 @@ GEM kaminari (~> 1.0, >= 1.2.1) railties (>= 5.2, < 6.2) ransack (~> 2.1, >= 2.1.1) - activejob (6.1.3.1) - activesupport (= 6.1.3.1) + activejob (6.1.6) + activesupport (= 6.1.6) globalid (>= 0.3.6) - activemodel (6.1.3.1) - activesupport (= 6.1.3.1) - activerecord (6.1.3.1) - activemodel (= 6.1.3.1) - activesupport (= 6.1.3.1) - activestorage (6.1.3.1) - actionpack (= 6.1.3.1) - activejob (= 6.1.3.1) - activerecord (= 6.1.3.1) - activesupport (= 6.1.3.1) - marcel (~> 1.0.0) - mini_mime (~> 1.0.2) - activesupport (6.1.3.1) + activemodel (6.1.6) + activesupport (= 6.1.6) + activerecord (6.1.6) + activemodel (= 6.1.6) + activesupport (= 6.1.6) + activestorage (6.1.6) + actionpack (= 6.1.6) + activejob (= 6.1.6) + activerecord (= 6.1.6) + activesupport (= 6.1.6) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -97,8 +97,8 @@ GEM aws-eventstream (~> 1, >= 1.0.2) bcrypt (3.1.16) bindex (0.8.1) - bootsnap (1.7.4) - msgpack (~> 1.0) + bootsnap (1.12.0) + msgpack (~> 1.2) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) @@ -126,7 +126,7 @@ GEM regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) childprocess (3.0.0) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.10) connection_pool (2.2.5) crass (1.0.6) database_cleaner (1.8.5) @@ -159,8 +159,8 @@ GEM et-orbi (~> 1.1, >= 1.1.8) raabro (~> 1.4) gli (2.20.0) - globalid (0.4.2) - activesupport (>= 4.2.0) + globalid (1.0.0) + activesupport (>= 5.0) has_scope (0.7.2) actionpack (>= 4.1) activesupport (>= 4.1) @@ -168,7 +168,7 @@ GEM http-cookie (1.0.3) domain_name (~> 0.5) http_accept_language (2.1.1) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) @@ -211,26 +211,26 @@ GEM i18n (>= 0.7, < 2) json (>= 1.7.7) rest-client (>= 1.8.0) - loofah (2.9.1) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + marcel (1.0.2) method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2021.0225) mini_magick (4.11.0) - mini_mime (1.0.3) + mini_mime (1.1.2) mini_portile2 (2.8.0) - minitest (5.14.4) - msgpack (1.4.2) + minitest (5.16.1) + msgpack (1.5.2) net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.1.0) netrc (0.11.0) - nio4r (2.5.7) + nio4r (2.5.8) nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) @@ -254,22 +254,22 @@ GEM raabro (1.4.0) racc (1.6.0) rack (2.2.3.1) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (6.1.3.1) - actioncable (= 6.1.3.1) - actionmailbox (= 6.1.3.1) - actionmailer (= 6.1.3.1) - actionpack (= 6.1.3.1) - actiontext (= 6.1.3.1) - actionview (= 6.1.3.1) - activejob (= 6.1.3.1) - activemodel (= 6.1.3.1) - activerecord (= 6.1.3.1) - activestorage (= 6.1.3.1) - activesupport (= 6.1.3.1) + rack-test (2.0.2) + rack (>= 1.3) + rails (6.1.6) + actioncable (= 6.1.6) + actionmailbox (= 6.1.6) + actionmailer (= 6.1.6) + actionpack (= 6.1.6) + actiontext (= 6.1.6) + actionview (= 6.1.6) + activejob (= 6.1.6) + activemodel (= 6.1.6) + activerecord (= 6.1.6) + activestorage (= 6.1.6) + activesupport (= 6.1.6) bundler (>= 1.15.0) - railties (= 6.1.3.1) + railties (= 6.1.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -278,20 +278,20 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.3) loofah (~> 2.3) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) - railties (6.1.3.1) - actionpack (= 6.1.3.1) - activesupport (= 6.1.3.1) + railties (6.1.6) + actionpack (= 6.1.6) + activesupport (= 6.1.6) method_source - rake (>= 0.8.7) + rake (>= 12.2) thor (~> 1.0) rainbow (3.0.0) raindrops (0.19.1) - rake (13.0.3) + rake (13.0.6) ransack (2.4.2) activerecord (>= 5.2.4) activesupport (>= 5.2.4) @@ -381,17 +381,17 @@ GEM simplecov_json_formatter (0.1.3) skylight (5.0.1) activesupport (>= 5.2.0) - sprockets (4.0.2) + sprockets (4.1.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - thor (1.1.0) + thor (1.2.1) tilt (2.0.10) ttfunk (1.7.0) tzinfo (2.0.4) @@ -416,12 +416,12 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (>= 3.0, < 4.0) - websocket-driver (0.7.3) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.4.2) + zeitwerk (2.6.0) PLATFORMS ruby @@ -429,7 +429,7 @@ PLATFORMS DEPENDENCIES activeadmin (~> 2.9.0) aws-sdk-s3 (~> 1.94) - bootsnap (~> 1.7.3) + bootsnap (~> 1.12.0) bootstrap-sass (~> 3.4) byebug (~> 11.0) capistrano (~> 3.1) diff --git a/app/assets/stylesheets/application/bootstrap-custom.scss b/app/assets/stylesheets/application/bootstrap-custom.scss index 4d9e6df4..8b57fc34 100644 --- a/app/assets/stylesheets/application/bootstrap-custom.scss +++ b/app/assets/stylesheets/application/bootstrap-custom.scss @@ -1,12 +1,3 @@ -/*! - * Bootstrap v3.3.7 (http://getbootstrap.com) - * Copyright 2011-2016 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * - * This file lists all the available Bootstrap modules, uncomment - * the modules you want to import - */ - // Core variables and mixins @import "bootstrap-overrides"; @import "bootstrap/variables"; @@ -33,27 +24,18 @@ @import "bootstrap/input-groups"; @import "bootstrap/navs"; @import "bootstrap/navbar"; -// @import "bootstrap/breadcrumbs"; @import "bootstrap/pagination"; @import "bootstrap/pager"; @import "bootstrap/labels"; @import "bootstrap/badges"; -// @import "bootstrap/jumbotron"; -// @import "bootstrap/thumbnails"; @import "bootstrap/alerts"; -// @import "bootstrap/progress-bars"; @import "bootstrap/media"; @import "bootstrap/list-group"; @import "bootstrap/panels"; @import "bootstrap/responsive-embed"; -// @import "bootstrap/wells"; @import "bootstrap/close"; - -// Components w/ JavaScript @import "bootstrap/modals"; @import "bootstrap/tooltip"; -// @import "bootstrap/popovers"; -// @import "bootstrap/carousel"; // Utility classes @import "bootstrap/utilities"; diff --git a/app/views/tags/_grouped_index.html.erb b/app/views/tags/_grouped_index.html.erb index a3be369b..f876c0e1 100644 --- a/app/views/tags/_grouped_index.html.erb +++ b/app/views/tags/_grouped_index.html.erb @@ -11,7 +11,7 @@
<%= count %>
- <%= link_to [post_type.pluralize, tag: tag] do %> + <%= link_to [post_type.pluralize.to_sym, tag: tag] do %> <%= glyph count == 1 ? :tag : :tags %> <%= tag %> <% end %> diff --git a/spec/controllers/transfers_controller_spec.rb b/spec/controllers/transfers_controller_spec.rb index f7b896cc..a034f778 100644 --- a/spec/controllers/transfers_controller_spec.rb +++ b/spec/controllers/transfers_controller_spec.rb @@ -28,13 +28,13 @@ it 'finds the destination account' do get :new, params: params - expect(response.body).to include("") + expect(response.body).to include("") end it 'builds a transfer with the id of the destination' do get :new, params: params expect(response.body) - .to include("") + .to include("") end context 'when the offer is specified' do @@ -47,7 +47,7 @@ it 'builds a transfer with the offer as post' do get :new, params: params.merge(offer: offer.id) - expect(response.body).to include("") + expect(response.body).to include("") end end @@ -94,13 +94,13 @@ it 'finds the destination account' do get :new, params: params - expect(response.body).to include("") + expect(response.body).to include("") end it 'builds a transfer with the id of the destination' do get :new, params: params expect(response.body) - .to include("") + .to include("") end context 'when the user is the admin of the current organization' do From 60fbd674bb740e5631ca8618edb6f065e014cadc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:21:40 +0200 Subject: [PATCH 10/34] build(deps): bump nokogiri from 1.13.6 to 1.13.9 (#662) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.6 to 1.13.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.6...v1.13.9) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 15244705..80ad7882 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -231,7 +231,7 @@ GEM net-ssh (6.1.0) netrc (0.11.0) nio4r (2.5.8) - nokogiri (1.13.6) + nokogiri (1.13.9) mini_portile2 (~> 2.8.0) racc (~> 1.4) orm_adapter (0.5.0) From d91a32b50df462af21b4cad476477495269c155b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Perej=C3=B3n=20Barrios?= <70280187+franpb14@users.noreply.github.com> Date: Wed, 2 Nov 2022 22:28:27 +0100 Subject: [PATCH 11/34] [Feat] Signup users (#661) --- app/controllers/petitions_controller.rb | 38 +++++++++ app/controllers/terms_controller.rb | 2 +- app/controllers/users_controller.rb | 38 ++++++--- app/models/organization.rb | 1 + app/models/petition.rb | 6 ++ app/models/user.rb | 1 + app/policies/user_policy.rb | 2 +- .../_organization_listings_menu.html.erb | 6 ++ app/views/devise/sessions/new.html.erb | 8 ++ app/views/organizations/index.html.erb | 10 +++ app/views/petitions/manage.html.erb | 82 +++++++++++++++++++ app/views/users/_form.html.erb | 13 ++- app/views/users/edit.html.erb | 2 +- app/views/users/new.html.erb | 2 +- app/views/users/signup.html.erb | 1 + config/routes.rb | 7 ++ db/migrate/20221016192111_create_petitions.rb | 11 +++ db/structure.sql | 81 +++++++++++++++++- 18 files changed, 289 insertions(+), 22 deletions(-) create mode 100644 app/controllers/petitions_controller.rb create mode 100644 app/models/petition.rb create mode 100644 app/views/petitions/manage.html.erb create mode 100644 app/views/users/signup.html.erb create mode 100644 db/migrate/20221016192111_create_petitions.rb diff --git a/app/controllers/petitions_controller.rb b/app/controllers/petitions_controller.rb new file mode 100644 index 00000000..c19ccea5 --- /dev/null +++ b/app/controllers/petitions_controller.rb @@ -0,0 +1,38 @@ +class PetitionsController < ApplicationController + def create + petition = Petition.new petition_params + + if petition.save + flash[:notice] = 'Application sent' + else + flash[:error] = 'Something went wrong' + end + + redirect_to organizations_path + end + + def update + petition = Petition.find params[:id] + status = params[:status] + + if petition.update(status: status) + User.find(params[:user_id]).add_to_organization(current_organization) if status == 'accepted' + flash[:notice] = "Application #{status}" + else + flash[:error] = 'Something went wrong' + end + + redirect_to manage_petitions_path + end + + def manage + @status = params[:status] || 'pending' + @users = User.joins(:petitions).where(petitions: { organization_id: current_organization.id, status: @status }).page(params[:page]).per(20) + end + + private + + def petition_params + params.permit(%i[organization_id user_id status]) + end +end diff --git a/app/controllers/terms_controller.rb b/app/controllers/terms_controller.rb index ecf1ce81..456c919f 100644 --- a/app/controllers/terms_controller.rb +++ b/app/controllers/terms_controller.rb @@ -8,6 +8,6 @@ def show def accept current_user.touch :terms_accepted_at - redirect_to root_path + redirect_to(current_user.organizations.empty? ? organizations_path : root_path) end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 79e48b80..46d4b507 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,5 +1,5 @@ class UsersController < ApplicationController - before_action :authenticate_user!, :member_should_be_active + before_action :authenticate_user!, :member_should_be_active, except: [:signup, :create] has_scope :tagged_with, as: :tag @@ -41,8 +41,10 @@ def create @user.setup_and_save_user if @user.persisted? - @user.tune_after_persisted(current_organization) - @user.add_tags(current_organization, params[:tag_list] || []) + unless request.referer.include?(signup_users_path) + @user.tune_after_persisted(current_organization) + @user.add_tags(current_organization, params[:tag_list] || []) + end redirect_to_after_create else @@ -65,6 +67,10 @@ def update end end + def signup + @user = User.new + end + def update_avatar operation = AvatarGenerator.new(current_user, params) @@ -102,6 +108,7 @@ def user_params fields_to_permit += %w"admin registration_number registration_date" if admin? fields_to_permit += %w"organization_id superadmin" if superadmin? + fields_to_permit += %w"password" if request.referer.include?(signup_users_path) params.require(:user).permit *fields_to_permit end @@ -115,17 +122,22 @@ def find_user end def redirect_to_after_create - id = @user.member(current_organization).member_uid - if params[:more] - redirect_to new_user_path, - notice: I18n.t("users.new.user_created_add", - uid: id, - name: @user.username) + if request.referer.include?(signup_users_path) + sign_in(@user) + redirect_to terms_path else - redirect_to users_path, - notice: I18n.t("users.index.user_created", - uid: id, - name: @user.username) + id = @user.member(current_organization).member_uid + if params[:more] + redirect_to new_user_path, + notice: I18n.t("users.new.user_created_add", + uid: id, + name: @user.username) + else + redirect_to users_path, + notice: I18n.t("users.index.user_created", + uid: id, + name: @user.username) + end end end end diff --git a/app/models/organization.rb b/app/models/organization.rb index dfc7a4b0..2b6cef8a 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -21,6 +21,7 @@ class Organization < ApplicationRecord has_many :offers has_many :inquiries has_many :documents, as: :documentable, dependent: :destroy + has_many :petitions, dependent: :delete_all validates :name, presence: true, uniqueness: true diff --git a/app/models/petition.rb b/app/models/petition.rb new file mode 100644 index 00000000..24ad2837 --- /dev/null +++ b/app/models/petition.rb @@ -0,0 +1,6 @@ +class Petition < ApplicationRecord + enum status: %i[pending accepted declined] + + belongs_to :user + belongs_to :organization +end diff --git a/app/models/user.rb b/app/models/user.rb index 4f3e006c..d1470032 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -27,6 +27,7 @@ class User < ApplicationRecord has_many :offers has_many :inquiries has_many :device_tokens + has_many :petitions, dependent: :delete_all accepts_nested_attributes_for :members diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index 43682895..d65f899f 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -1,6 +1,6 @@ class UserPolicy < ApplicationPolicy def create? - user.admins?(organization) + !user || user.admins?(organization) end def update? diff --git a/app/views/application/menus/_organization_listings_menu.html.erb b/app/views/application/menus/_organization_listings_menu.html.erb index 83c90dcc..57b3ccde 100644 --- a/app/views/application/menus/_organization_listings_menu.html.erb +++ b/app/views/application/menus/_organization_listings_menu.html.erb @@ -11,6 +11,12 @@ <%= t "application.navbar.users" %> <% end %> +
  • + <%= link_to manage_petitions_path do %> + <%= glyph 'list-alt' %> + <%= 'Manage Applications' %> + <% end %> +
  • <%= link_to offers_path(org: current_organization) do %> <%= glyph :link %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 2c8d1320..2ecaac46 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -43,6 +43,14 @@ + OR +
    +
    +
    + <%= link_to 'Sign up', signup_users_path, class: "btn btn-primary btn-lg col-xs-12" %> +
    +
    +
    <% end %>
  • +
  • + <%= link_to organizations_path do %> + <%= glyph :list %> + Manage memberships + <% end %> +
  • + <% current_user.members.where(manager: true).each do |m| %>
  • <%= link_to m.organization do %> diff --git a/app/views/organizations/_organizations_row.html.erb b/app/views/organizations/_organizations_row.html.erb new file mode 100644 index 00000000..232eb231 --- /dev/null +++ b/app/views/organizations/_organizations_row.html.erb @@ -0,0 +1,24 @@ + + <%= link_to(org.name, org) %> + <%= org.city %> + <%= org.neighborhood %> + <%= link_to(org.web, org.web) if org.web.present? %> + <%= org.members.count %> + + <% if current_user %> + <% petition = current_user.petitions.where(organization_id: org.id).last %> + + <% if member = Member.where(user: current_user, organization: org).first %> + <%= link_to 'Delete membership', + member, + method: :delete, + data: { confirm: "Are you sure you want to delete your membership from #{org.name}?" }, + class: 'btn btn-danger' %> + <% elsif petition && !current_user.was_member?(petition) %> + <%= petition.status %> + <% else %> + <%= link_to 'Apply to join', petitions_path(user_id: current_user.id, organization_id: org.id, status: 'pending'), method: :post %> + <% end %> + <% end %> + + diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb index 0e4a29d6..64082bf5 100644 --- a/app/views/organizations/index.html.erb +++ b/app/views/organizations/index.html.erb @@ -31,24 +31,8 @@ - <% @organizations.each do |org| %> - - <%= link_to(org.name, org) %> - <%= org.city %> - <%= org.neighborhood %> - <%= link_to(org.web, org.web) if org.web.present? %> - <%= org.members.count %> - - <% if current_user %> - <% if petition = current_user.petitions.where(organization_id: org.id).last %> - <%= petition.status %> - <% else %> - <%= link_to 'Apply to join', petitions_path(user_id: current_user.id, organization_id: org.id, status: 'pending'), method: :post %> - <% end %> - <% end %> - - - <% end %> + <%= render partial: 'organizations_row', collection: @user_organizations, as: :org if !params[:page] || params[:page] == '1' %> + <%= render partial: 'organizations_row', collection: @organizations, as: :org %>
    From 106cc0d78e617d434fa6c58560fb8ce0b8b985e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Perej=C3=B3n=20Barrios?= <70280187+franpb14@users.noreply.github.com> Date: Tue, 6 Dec 2022 16:55:38 +0100 Subject: [PATCH 14/34] Tests, show/hide password and signup validations (#666) --- app/assets/stylesheets/application.scss | 13 +++++ app/controllers/petitions_controller.rb | 2 +- app/controllers/users_controller.rb | 10 ++-- app/models/user.rb | 8 ++- app/views/petitions/manage.html.erb | 4 +- app/views/users/_form.html.erb | 13 ++++- .../organizations_controller_spec.rb | 11 +++++ spec/controllers/petitions_controller_spec.rb | 49 +++++++++++++++++++ spec/controllers/users_controller_spec.rb | 13 +++++ 9 files changed, 114 insertions(+), 9 deletions(-) create mode 100644 spec/controllers/petitions_controller_spec.rb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index dec301cc..982c4477 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -669,3 +669,16 @@ label[required]::after{ display: inline; margin: 0 !important; } + +.input__password-eye { + display: flex; + align-items: center; + justify-content: right; + + .show-password { + position: absolute; + display: flex; + margin-right: 12px; + cursor: pointer; + } +} diff --git a/app/controllers/petitions_controller.rb b/app/controllers/petitions_controller.rb index 4ddb81cd..292c58af 100644 --- a/app/controllers/petitions_controller.rb +++ b/app/controllers/petitions_controller.rb @@ -16,7 +16,7 @@ def update status = params[:status] if petition.update(status: status) - User.find(params[:user_id]).add_to_organization(current_organization) if status == 'accepted' + petition.user.add_to_organization(petition.organization) if status == 'accepted' flash[:notice] = "Application #{status}" else flash[:error] = 'Something went wrong' diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 46d4b507..d9013a8b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -33,15 +33,17 @@ def edit def create authorize User + from_signup = params[:from_signup].present? email = user_params[:email] @user = User.find_or_initialize_by(email: email) do |u| u.attributes = user_params end empty_email = @user.email.empty? + @user.from_signup = from_signup @user.setup_and_save_user if @user.persisted? - unless request.referer.include?(signup_users_path) + unless from_signup @user.tune_after_persisted(current_organization) @user.add_tags(current_organization, params[:tag_list] || []) end @@ -50,7 +52,7 @@ def create else @user.email = "" if empty_email - render action: "new" + render action: from_signup ? 'signup' : 'new' end end @@ -108,7 +110,7 @@ def user_params fields_to_permit += %w"admin registration_number registration_date" if admin? fields_to_permit += %w"organization_id superadmin" if superadmin? - fields_to_permit += %w"password" if request.referer.include?(signup_users_path) + fields_to_permit += %w"password" if params[:from_signup].present? params.require(:user).permit *fields_to_permit end @@ -122,7 +124,7 @@ def find_user end def redirect_to_after_create - if request.referer.include?(signup_users_path) + if params[:from_signup].present? sign_in(@user) redirect_to terms_path else diff --git a/app/models/user.rb b/app/models/user.rb index fd1ba040..156743fc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -17,6 +17,7 @@ class User < ApplicationRecord ) attr_accessor :empty_email + attr_accessor :from_signup has_one_attached :avatar has_many :members, dependent: :destroy @@ -38,6 +39,7 @@ class User < ApplicationRecord validates :username, presence: true validates :email, presence: true, uniqueness: true + validates :password, presence: true, if: :from_signup? # Allows @domain.com for dummy emails but does not allow pure invalid # emails like 'without email' validates_format_of :email, @@ -99,7 +101,7 @@ def setup_and_save_user # temporary valid email with current time milliseconds # this will be updated to user.id@example.com later on self.empty_email = email.strip.empty? - self.email = "user#{DateTime.now.strftime('%Q')}@example.com" if empty_email + self.email = "user#{DateTime.now.strftime('%Q')}@example.com" if empty_email && !from_signup skip_confirmation! # auto-confirm, not sending confirmation email save end @@ -128,4 +130,8 @@ def email_if_real def was_member?(petition) petition.status == 'accepted' && Member.where(organization: petition.organization, user: self).none? end + + def from_signup? + from_signup + end end diff --git a/app/views/petitions/manage.html.erb b/app/views/petitions/manage.html.erb index 71eb4314..2b0500de 100644 --- a/app/views/petitions/manage.html.erb +++ b/app/views/petitions/manage.html.erb @@ -65,8 +65,8 @@ <%= phone_to user.phone %> <% if current_user.manages?(current_organization) && @status == 'pending' %> - <%= link_to 'Accept', petition_path(id: petition.id, user_id: user.id, status: 'accepted'), class: 'btn btn-primary', method: :put %> - <%= link_to 'Decline', petition_path(id: petition.id, user_id: user.id, status: 'declined'), class: 'btn btn-danger', method: :put %> + <%= link_to 'Accept', petition_path(id: petition.id, status: 'accepted'), class: 'btn btn-primary', method: :put %> + <%= link_to 'Decline', petition_path(id: petition.id, status: 'declined'), class: 'btn btn-danger', method: :put %> <% end %> <% end %> diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 5b9de405..08ff149a 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -12,7 +12,18 @@ <%= f.input :email, readonly: true %> <% end %> - <%= f.input :password, label: t("application.login_form.password"), required: true if short %> + <% if short %> +
    + +
    + + + visibility + +
    +
    + <%= hidden_field_tag 'from_signup', 'true' %> + <% end %> <%= f.input :phone %> <%= f.input :alt_phone %> diff --git a/spec/controllers/organizations_controller_spec.rb b/spec/controllers/organizations_controller_spec.rb index 66df6030..e09b320d 100644 --- a/spec/controllers/organizations_controller_spec.rb +++ b/spec/controllers/organizations_controller_spec.rb @@ -61,6 +61,17 @@ expect(assigns(:organizations)).to eq([second_organization]) end end + + context 'a user is logged' do + before { login(member.user) } + + it 'populates an array of user organizations' do + get :index + + expect(assigns(:user_organizations)).to include(member.organization) + expect(assigns(:organizations)).to eq([second_organization]) + end + end end describe 'GET #show' do diff --git a/spec/controllers/petitions_controller_spec.rb b/spec/controllers/petitions_controller_spec.rb new file mode 100644 index 00000000..b3612fca --- /dev/null +++ b/spec/controllers/petitions_controller_spec.rb @@ -0,0 +1,49 @@ +RSpec.describe PetitionsController do + let!(:organization) { Fabricate(:organization) } + let(:user) { Fabricate(:user) } + let(:admin) { Fabricate(:member, organization: organization, manager: true) } + + describe 'POST #create' do + before { login(user) } + + it 'creates the petition' do + expect do + post :create, params: { user_id: user.id, organization_id: organization.id } + end.to change(Petition, :count).by(1) + end + end + + describe 'PUT #update' do + before { login(admin.user) } + let(:petition) { Petition.create(user: user, organization: organization, status: 'pending') } + + it 'decline the petition' do + put :update, params: { status: 'declined', id: petition.id } + + petition.reload + expect(petition.status).to eq('declined') + end + + it 'accept the petition and add the user to the org' do + put :update, params: { status: 'accepted', id: petition.id } + + petition.reload + expect(user.members.last.organization.id).to eq(organization.id) + expect(petition.status).to eq('accepted') + end + end + + describe 'GET #manage' do + before do + allow(controller).to receive(:current_organization) { organization } + login(admin.user) + end + let!(:petition) { Petition.create(user: user, organization: organization, status: 'pending') } + + it 'populates a list of users with pending petitions' do + get :manage + + expect(assigns(:users)).to include(user) + end + end +end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 16676d9f..f8a3f7a2 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -320,10 +320,23 @@ end end + + context 'with no logged user' do + before { allow_any_instance_of(ActionController::TestRequest).to receive(:referer).and_return(signup_users_path) } + + it 'creates the user' do + expect do + post :create, params: { user: Fabricate.to_params(:user, password: '1234test'), from_signup: 'true' } + end.to change(User, :count).by(1) + expect(subject).to redirect_to(terms_path) + end + end end end describe "PUT #update" do + before { allow_any_instance_of(ActionController::TestRequest).to receive(:referer).and_return('/edit') } + context "with valid params" do context "with a logged" do context "normal user" do From 21e0cc5e4da8888b518a0dcf29c2f20d4a08b823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Perej=C3=B3n=20Barrios?= <70280187+franpb14@users.noreply.github.com> Date: Thu, 8 Dec 2022 16:12:09 +0100 Subject: [PATCH 15/34] [FIX] users now can modify their profile + bug when clicking the logo for non-members (#667) --- app/controllers/application_controller.rb | 6 ++++-- app/controllers/tags_controller.rb | 2 +- app/controllers/users_controller.rb | 11 +++++++---- app/views/users/_form.html.erb | 21 ++++++++++++--------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6b301af1..d3135614 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -121,8 +121,10 @@ def resource_not_found render 'errors/not_found', status: 404 end - def member_should_be_active - if !current_member.active + def member_should_exist_and_be_active + if !current_member + redirect_to organizations_path + elsif !current_member.active flash[:error] = I18n.t('users.index.account_deactivated') redirect_to select_organization_path end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 858e9120..560c548e 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,5 +1,5 @@ class TagsController < ApplicationController - before_action :authenticate_user!, :member_should_be_active + before_action :authenticate_user!, :member_should_exist_and_be_active def index model = params[:model].classify.constantize diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d9013a8b..65e5a2a7 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,5 +1,6 @@ class UsersController < ApplicationController - before_action :authenticate_user!, :member_should_be_active, except: [:signup, :create] + before_action :authenticate_user!, except: %i[signup create] + before_action :member_should_exist_and_be_active, except: %i[signup create edit show update] has_scope :tagged_with, as: :tag @@ -16,6 +17,8 @@ def manage def show @user = find_user + redirect_to edit_user_path(@user) and return if !current_organization + @member = @user.as_member_of(current_organization) @movements = @member.movements.order("created_at DESC").page(params[:page]). per(10) @@ -57,11 +60,11 @@ def create end def update - @user = scoped_users.find(params[:id]) - authorize @user + @user = User.find(params[:id]) + authorize @user unless @user == current_user if @user.update(user_params) - @user.add_tags(current_organization, params[:tag_list] || []) + @user.add_tags(current_organization, params[:tag_list] || []) if current_organization redirect_to @user else diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 08ff149a..3a52b3cd 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -34,15 +34,18 @@ include_blank: :true %> <%= f.input :description, as: "text" %> <%= f.input :postcode %> - <%= label_tag :tag_list, t('activerecord.attributes.post.tag_list') %> -
    - <%= select_tag :tag_list, - options_for_select(member.tags, member.tags), - multiple: true, - data: { placeholder: t("application.tips.entertag"), model: "member" }, - id: "tags-js", - class: "form-control" %> -
    + + <% if current_organization %> + <%= label_tag :tag_list, t('activerecord.attributes.post.tag_list') %> +
    + <%= select_tag :tag_list, + options_for_select(member.tags, member.tags), + multiple: true, + data: { placeholder: t("application.tips.entertag"), model: "member" }, + id: "tags-js", + class: "form-control" %> +
    + <% end %>
    From 2c3987d067b9348d89b67efbaf30caf49bfeb0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Perej=C3=B3n=20Barrios?= <70280187+franpb14@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:06:10 +0100 Subject: [PATCH 16/34] [Feat] Confirmation email and new petitions emails (#668) --- app/controllers/application_controller.rb | 6 +++++ app/controllers/organizations_controller.rb | 1 + app/controllers/petitions_controller.rb | 5 ++++ app/controllers/users_controller.rb | 14 +++++++---- app/mailers/organization_notifier.rb | 23 +++++++++++++++++++ app/models/user.rb | 2 +- .../new_petition.html.erb | 1 + .../petition_sent.html.erb | 1 + app/views/users/please_confirm.html.erb | 2 ++ config/routes.rb | 1 + 10 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 app/views/organization_notifier/new_petition.html.erb create mode 100644 app/views/organization_notifier/petition_sent.html.erb create mode 100644 app/views/users/please_confirm.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d3135614..084d4a3b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -129,4 +129,10 @@ def member_should_exist_and_be_active redirect_to select_organization_path end end + + def user_should_be_confirmed + return if current_user.confirmed? + + redirect_to please_confirm_users_path + end end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 01389658..9c1225dc 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,5 +1,6 @@ class OrganizationsController < ApplicationController before_action :load_resource, only: [:show, :edit, :update, :set_current] + before_action :user_should_be_confirmed def index if current_user diff --git a/app/controllers/petitions_controller.rb b/app/controllers/petitions_controller.rb index 292c58af..1fcbbb2a 100644 --- a/app/controllers/petitions_controller.rb +++ b/app/controllers/petitions_controller.rb @@ -1,8 +1,13 @@ class PetitionsController < ApplicationController + before_action :authenticate_user! + def create petition = Petition.new petition_params if petition.save + OrganizationNotifier.new_petition(petition).deliver_now + OrganizationNotifier.petition_sent(petition).deliver_now + flash[:notice] = 'Application sent' else flash[:error] = 'Something went wrong' diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 65e5a2a7..b701f070 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,7 @@ class UsersController < ApplicationController before_action :authenticate_user!, except: %i[signup create] - before_action :member_should_exist_and_be_active, except: %i[signup create edit show update] + before_action :user_should_be_confirmed, except: %i[signup create please_confirm] + before_action :member_should_exist_and_be_active, except: %i[signup create edit show update please_confirm] has_scope :tagged_with, as: :tag @@ -36,17 +37,16 @@ def edit def create authorize User - from_signup = params[:from_signup].present? email = user_params[:email] @user = User.find_or_initialize_by(email: email) do |u| u.attributes = user_params end empty_email = @user.email.empty? - @user.from_signup = from_signup + @user.from_signup = params[:from_signup].present? @user.setup_and_save_user if @user.persisted? - unless from_signup + unless @user.from_signup @user.tune_after_persisted(current_organization) @user.add_tags(current_organization, params[:tag_list] || []) end @@ -55,7 +55,7 @@ def create else @user.email = "" if empty_email - render action: from_signup ? 'signup' : 'new' + render action: @user.from_signup ? 'signup' : 'new' end end @@ -73,6 +73,8 @@ def update end def signup + redirect_to root_path and return if current_user + @user = User.new end @@ -88,6 +90,8 @@ def update_avatar redirect_to current_user end + def please_confirm; end + private def search_and_load_members(members_scope, default_search_params) diff --git a/app/mailers/organization_notifier.rb b/app/mailers/organization_notifier.rb index 44117b51..d3ed1fcd 100644 --- a/app/mailers/organization_notifier.rb +++ b/app/mailers/organization_notifier.rb @@ -12,4 +12,27 @@ def recent_posts(posts, locale, users) mail(bcc: users.map(&:email)) end end + + def new_petition(petition) + @user = petition.user + organization = petition.organization + + I18n.with_locale(locale) do + mail( + subject: 'New Application', + to: organization.users.joins(:members).where(members: { manager: true }).pluck(:email).uniq + ) + end + end + + def petition_sent(petition) + @organization_name = petition.organization.name + + I18n.with_locale(locale) do + mail( + subject: 'Application sent correctly', + to: petition.user.email + ) + end + end end diff --git a/app/models/user.rb b/app/models/user.rb index 156743fc..e08263dd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -102,7 +102,7 @@ def setup_and_save_user # this will be updated to user.id@example.com later on self.empty_email = email.strip.empty? self.email = "user#{DateTime.now.strftime('%Q')}@example.com" if empty_email && !from_signup - skip_confirmation! # auto-confirm, not sending confirmation email + skip_confirmation! unless from_signup? save end diff --git a/app/views/organization_notifier/new_petition.html.erb b/app/views/organization_notifier/new_petition.html.erb new file mode 100644 index 00000000..43a265cd --- /dev/null +++ b/app/views/organization_notifier/new_petition.html.erb @@ -0,0 +1 @@ +Hello! New petition from user <%= @user.username %>. manage your applications <%= link_to 'here', manage_petitions_url %>. diff --git a/app/views/organization_notifier/petition_sent.html.erb b/app/views/organization_notifier/petition_sent.html.erb new file mode 100644 index 00000000..deb351cb --- /dev/null +++ b/app/views/organization_notifier/petition_sent.html.erb @@ -0,0 +1 @@ +Hello! your application to <%= @organization_name %> has been sent correctly. diff --git a/app/views/users/please_confirm.html.erb b/app/views/users/please_confirm.html.erb new file mode 100644 index 00000000..3a26821c --- /dev/null +++ b/app/views/users/please_confirm.html.erb @@ -0,0 +1,2 @@ +

    Please, confirm the email

    +An email has been sent to <%= current_user.email %>. After confirm you will be able to apply to any organization. diff --git a/config/routes.rb b/config/routes.rb index 4b873dd5..500c4581 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,6 +39,7 @@ collection do get 'signup' get 'manage' + get 'please_confirm' end end put :update_avatar, to: 'users#update_avatar' From eda77e66a0a4979e8523b153204291b0b681a785 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 20:47:55 +0100 Subject: [PATCH 17/34] build(deps): bump loofah from 2.18.0 to 2.19.1 (#670) Bumps [loofah](https://github.com/flavorjones/loofah) from 2.18.0 to 2.19.1. - [Release notes](https://github.com/flavorjones/loofah/releases) - [Changelog](https://github.com/flavorjones/loofah/blob/main/CHANGELOG.md) - [Commits](https://github.com/flavorjones/loofah/compare/v2.18.0...v2.19.1) --- updated-dependencies: - dependency-name: loofah dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 15244705..de8c5816 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -211,7 +211,7 @@ GEM i18n (>= 0.7, < 2) json (>= 1.7.7) rest-client (>= 1.8.0) - loofah (2.18.0) + loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -231,7 +231,7 @@ GEM net-ssh (6.1.0) netrc (0.11.0) nio4r (2.5.8) - nokogiri (1.13.6) + nokogiri (1.13.10) mini_portile2 (~> 2.8.0) racc (~> 1.4) orm_adapter (0.5.0) @@ -252,7 +252,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.6.0) + racc (1.6.1) rack (2.2.3.1) rack-test (2.0.2) rack (>= 1.3) From fbac20c223983ec377b198778592c9a289077d9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 20:49:34 +0100 Subject: [PATCH 18/34] build(deps): bump rails-html-sanitizer from 1.4.3 to 1.4.4 (#671) Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.4.3 to 1.4.4. - [Release notes](https://github.com/rails/rails-html-sanitizer/releases) - [Changelog](https://github.com/rails/rails-html-sanitizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.4.3...v1.4.4) --- updated-dependencies: - dependency-name: rails-html-sanitizer dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index de8c5816..0e5a5c5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -278,8 +278,8 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) + rails-html-sanitizer (1.4.4) + loofah (~> 2.19, >= 2.19.1) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) From 674a4ae64ee89113efd109407beefb1d0e40906e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Perej=C3=B3n=20Barrios?= <70280187+franpb14@users.noreply.github.com> Date: Tue, 13 Dec 2022 20:52:03 +0100 Subject: [PATCH 19/34] translation keys & minor fixes (#669) --- app/controllers/application_controller.rb | 2 +- app/controllers/petitions_controller.rb | 8 +++---- app/helpers/users_helper.rb | 4 ++++ .../_organization_listings_menu.html.erb | 2 +- .../menus/_user_admin_menu_items.html.erb | 2 +- app/views/devise/sessions/new.html.erb | 4 ++-- .../new_petition.html.erb | 2 +- .../petition_sent.html.erb | 2 +- .../organizations/_organizations_row.html.erb | 6 ++--- app/views/petitions/manage.html.erb | 16 ++++++------- app/views/users/_form.html.erb | 2 +- app/views/users/please_confirm.html.erb | 4 ++-- config/locales/en.yml | 24 +++++++++++++++++++ spec/controllers/petitions_controller_spec.rb | 2 +- 14 files changed, 54 insertions(+), 26 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 084d4a3b..1a7f0d1a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -131,7 +131,7 @@ def member_should_exist_and_be_active end def user_should_be_confirmed - return if current_user.confirmed? + return if !current_user || current_user.confirmed? redirect_to please_confirm_users_path end diff --git a/app/controllers/petitions_controller.rb b/app/controllers/petitions_controller.rb index 1fcbbb2a..005c29b0 100644 --- a/app/controllers/petitions_controller.rb +++ b/app/controllers/petitions_controller.rb @@ -8,9 +8,9 @@ def create OrganizationNotifier.new_petition(petition).deliver_now OrganizationNotifier.petition_sent(petition).deliver_now - flash[:notice] = 'Application sent' + flash[:notice] = t('petitions.application_status', status: t("petitions.status.sent")) else - flash[:error] = 'Something went wrong' + flash[:error] = t('errors.internal_server_error.description') end redirect_to organizations_path @@ -22,9 +22,9 @@ def update if petition.update(status: status) petition.user.add_to_organization(petition.organization) if status == 'accepted' - flash[:notice] = "Application #{status}" + flash[:notice] = t('petitions.application_status', status: t("petitions.status.#{status}")) else - flash[:error] = 'Something went wrong' + flash[:error] = t('errors.internal_server_error.description') end redirect_to manage_petitions_path diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 75ac944c..e0562469 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -38,4 +38,8 @@ def toggle_active_member_path(member) def can_toggle_active?(_member) superadmin? || admin? end + + def status_applications(status) + t('petitions.status_applications', status: t("petitions.status.#{status}").humanize) + end end diff --git a/app/views/application/menus/_organization_listings_menu.html.erb b/app/views/application/menus/_organization_listings_menu.html.erb index 57b3ccde..a95177c0 100644 --- a/app/views/application/menus/_organization_listings_menu.html.erb +++ b/app/views/application/menus/_organization_listings_menu.html.erb @@ -14,7 +14,7 @@
  • <%= link_to manage_petitions_path do %> <%= glyph 'list-alt' %> - <%= 'Manage Applications' %> + <%= t('petitions.applications') %> <% end %>
  • diff --git a/app/views/application/menus/_user_admin_menu_items.html.erb b/app/views/application/menus/_user_admin_menu_items.html.erb index f2d10c9b..cfbadd21 100644 --- a/app/views/application/menus/_user_admin_menu_items.html.erb +++ b/app/views/application/menus/_user_admin_menu_items.html.erb @@ -24,7 +24,7 @@
  • <%= link_to organizations_path do %> <%= glyph :list %> - Manage memberships + <%= t('layouts.application.manage_memberships') %> <% end %>
  • diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 2ecaac46..010677f1 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -43,11 +43,11 @@ - OR + <%= t('global.or').upcase %>
    - <%= link_to 'Sign up', signup_users_path, class: "btn btn-primary btn-lg col-xs-12" %> + <%= link_to t('devise.registrations.new.sign_up'), signup_users_path, class: "btn btn-primary btn-lg col-xs-12" %>
    diff --git a/app/views/organization_notifier/new_petition.html.erb b/app/views/organization_notifier/new_petition.html.erb index 43a265cd..783cb9df 100644 --- a/app/views/organization_notifier/new_petition.html.erb +++ b/app/views/organization_notifier/new_petition.html.erb @@ -1 +1 @@ -Hello! New petition from user <%= @user.username %>. manage your applications <%= link_to 'here', manage_petitions_url %>. +<%= t('petitions.new_body', username: @user.username, here_link: link_to(t('global.here'), manage_petitions_url)).html_safe %> diff --git a/app/views/organization_notifier/petition_sent.html.erb b/app/views/organization_notifier/petition_sent.html.erb index deb351cb..e63c3f70 100644 --- a/app/views/organization_notifier/petition_sent.html.erb +++ b/app/views/organization_notifier/petition_sent.html.erb @@ -1 +1 @@ -Hello! your application to <%= @organization_name %> has been sent correctly. +<%= t('petitions.application_sent_body', organization_name: @organization_name) %> diff --git a/app/views/organizations/_organizations_row.html.erb b/app/views/organizations/_organizations_row.html.erb index 232eb231..638204a8 100644 --- a/app/views/organizations/_organizations_row.html.erb +++ b/app/views/organizations/_organizations_row.html.erb @@ -9,15 +9,15 @@ <% petition = current_user.petitions.where(organization_id: org.id).last %> <% if member = Member.where(user: current_user, organization: org).first %> - <%= link_to 'Delete membership', + <%= link_to t('users.user_rows.delete_membership'), member, method: :delete, - data: { confirm: "Are you sure you want to delete your membership from #{org.name}?" }, + data: { confirm: t('users.user_rows.sure_delete', organization_name: org.name) }, class: 'btn btn-danger' %> <% elsif petition && !current_user.was_member?(petition) %> <%= petition.status %> <% else %> - <%= link_to 'Apply to join', petitions_path(user_id: current_user.id, organization_id: org.id, status: 'pending'), method: :post %> + <%= link_to t('petitions.apply'), petitions_path(user_id: current_user.id, organization_id: org.id, status: 'pending'), method: :post %> <% end %> <% end %> diff --git a/app/views/petitions/manage.html.erb b/app/views/petitions/manage.html.erb index 2b0500de..c09a3342 100644 --- a/app/views/petitions/manage.html.erb +++ b/app/views/petitions/manage.html.erb @@ -3,7 +3,7 @@

    <%= link_to current_organization.name, current_organization %> - <%= 'Applications' %> + <%= t('petitions.applications') %>

    @@ -15,19 +15,19 @@
  • "> <%= link_to manage_petitions_path(status: 'pending') do %> <%= glyph :minus %> - <%= 'Pending applications' %> + <%= status_applications('pending') %> <% end %>
  • "> <%= link_to manage_petitions_path(status: 'accepted') do %> <%= glyph :ok %> - <%= 'Accepted applications' %> + <%= status_applications('accepted') %> <% end %>
  • "> <%= link_to manage_petitions_path(status: 'declined') do %> <%= glyph :remove %> - <%= 'Declined applications' %> + <%= status_applications('declined') %> <% end %>
  • @@ -43,13 +43,13 @@ <%= 'ID' %> - <%= 'username' %> + <%= t('activerecord.attributes.user.username') %> <%= User.human_attribute_name(:email) %> <%= User.human_attribute_name(:phone) %> <% if current_user.manages?(current_organization) && @status == 'pending' %> - <%= t(".actions") %> + <%= t("global.table.actions") %> <% end %> @@ -65,8 +65,8 @@ <%= phone_to user.phone %> <% if current_user.manages?(current_organization) && @status == 'pending' %> - <%= link_to 'Accept', petition_path(id: petition.id, status: 'accepted'), class: 'btn btn-primary', method: :put %> - <%= link_to 'Decline', petition_path(id: petition.id, status: 'declined'), class: 'btn btn-danger', method: :put %> + <%= link_to t('terms.accept'), petition_path(id: petition.id, status: 'accepted'), class: 'btn btn-primary', method: :put %> + <%= link_to t('global.decline'), petition_path(id: petition.id, status: 'declined'), class: 'btn btn-danger', method: :put %> <% end %> <% end %> diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 3a52b3cd..52b031a1 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -14,7 +14,7 @@ <% if short %>
    - +
    diff --git a/app/views/users/please_confirm.html.erb b/app/views/users/please_confirm.html.erb index 3a26821c..5660e9f7 100644 --- a/app/views/users/please_confirm.html.erb +++ b/app/views/users/please_confirm.html.erb @@ -1,2 +1,2 @@ -

    Please, confirm the email

    -An email has been sent to <%= current_user.email %>. After confirm you will be able to apply to any organization. +

    <%= t('users.confirm_email.please') %>

    +<%= t('users.confirm_email.email_sent', email: current_user.email) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 96f49810..3ef1bec6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -300,6 +300,9 @@ en: table: actions: Actions to: To + here: here + decline: decline + or: or inquiries: edit: submit: Change inquiry @@ -313,6 +316,7 @@ en: bdtnear: Search Timebank edit_org: Update %{organization} edit_profile: Update my profile + manage_memberships: Manage memberships help: Help login: Login report: @@ -502,6 +506,9 @@ en: new: error_amount: Time must be greater than 0 users: + confirm_email: + please: Please, confirm the email + email_sent: An email has been sent to %{email}. After confirm you will be able to apply to any organization. avatar: change_your_image: Change your image crop_the_image: Crop the image @@ -556,6 +563,8 @@ en: cancel_warning: You are going to delete account from the Time Bank for user %{user} deactivate: Deactivate manage_warning: You are going to change privileges for user %{user} + delete_membership: Delete membership + sure_delete: Are you sure you want to delete your membership from %{organization_name}? views: pagination: first: First @@ -563,3 +572,18 @@ en: next: Next previous: Previous truncate: Truncate + petitions: + status: + pending: pending + accepted: accepted + declined: declined + sent: sent + application_status: Application %{status} + status_applications: "%{status} applications" + application_sent: Application sent correctly + application_sent_body: Hello! your application to %{organization_name} has been sent correctly. + new: New Application + new_body: Hello! New petition from user %{username}. Manage your applications %{here_link}. + apply: Apply to join + applications: Applications + diff --git a/spec/controllers/petitions_controller_spec.rb b/spec/controllers/petitions_controller_spec.rb index b3612fca..be689706 100644 --- a/spec/controllers/petitions_controller_spec.rb +++ b/spec/controllers/petitions_controller_spec.rb @@ -1,7 +1,7 @@ RSpec.describe PetitionsController do let!(:organization) { Fabricate(:organization) } let(:user) { Fabricate(:user) } - let(:admin) { Fabricate(:member, organization: organization, manager: true) } + let!(:admin) { Fabricate(:member, organization: organization, manager: true) } describe 'POST #create' do before { login(user) } From af4e2ab0047e5e6f271b5a909c7266ab005cb25e Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Tue, 13 Dec 2022 21:02:00 +0100 Subject: [PATCH 20/34] update localeapp + pull translations --- Gemfile | 2 +- Gemfile.lock | 16 +++++++------- config/locales/ca.yml | 23 ++++++++++++++++++++ config/locales/en.yml | 45 ++++++++++++++++++++-------------------- config/locales/es.yml | 23 ++++++++++++++++++++ config/locales/eu.yml | 23 ++++++++++++++++++++ config/locales/gl.yml | 23 ++++++++++++++++++++ config/locales/pt-BR.yml | 23 ++++++++++++++++++++ 8 files changed, 146 insertions(+), 32 deletions(-) diff --git a/Gemfile b/Gemfile index e5c4a91f..6489f069 100644 --- a/Gemfile +++ b/Gemfile @@ -36,7 +36,7 @@ gem 'select2-rails', '~> 4.0.13' group :development do gem 'listen', '~> 3.2.0' - gem 'localeapp', '~> 3.1', require: false + gem 'localeapp', '~> 3.3', require: false gem 'letter_opener', '~> 1.7.0' gem 'web-console', '~> 4.1.0' gem 'capistrano', '~> 3.1' diff --git a/Gemfile.lock b/Gemfile.lock index 0e5a5c5c..01965811 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -158,14 +158,14 @@ GEM fugit (1.4.5) et-orbi (~> 1.1, >= 1.1.8) raabro (~> 1.4) - gli (2.20.0) + gli (2.21.0) globalid (1.0.0) activesupport (>= 5.0) has_scope (0.7.2) actionpack (>= 4.1) activesupport (>= 4.1) http-accept (1.7.0) - http-cookie (1.0.3) + http-cookie (1.0.5) domain_name (~> 0.5) http_accept_language (2.1.1) i18n (1.10.0) @@ -183,7 +183,7 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.5.1) + json (2.6.3) json_translate (4.0.1) activerecord (>= 4.2.0) kaminari (1.2.1) @@ -206,7 +206,7 @@ GEM listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - localeapp (3.1.3) + localeapp (3.3.0) gli i18n (>= 0.7, < 2) json (>= 1.7.7) @@ -218,9 +218,9 @@ GEM mini_mime (>= 0.1.1) marcel (1.0.2) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) + mime-types-data (3.2022.0105) mini_magick (4.11.0) mini_mime (1.1.2) mini_portile2 (2.8.0) @@ -400,7 +400,7 @@ GEM execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.7) + unf_ext (0.0.8.2) unicode-display_width (2.0.0) unicorn (5.5.5) kgio (~> 2.6) @@ -449,7 +449,7 @@ DEPENDENCIES kaminari (~> 1.2.1) letter_opener (~> 1.7.0) listen (~> 3.2.0) - localeapp (~> 3.1) + localeapp (~> 3.3) pg (~> 1.2.1) pg_search (~> 2.3.5) prawn (~> 2.4.0) diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 8f67de85..1e774fa6 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -274,6 +274,7 @@ ca: contact_details: Dades de contacte create: Crear date: Data + decline: delete: Esborrar demote: Convertir en usuari normal edit: Modificar @@ -281,6 +282,7 @@ ca: filter: Filtre from: Des de give_time: Transferir temps + here: home: Inici information: Informació locales_header: canviar llengua @@ -288,6 +290,7 @@ ca: more: Veure més movements: Moviments next: Següent + or: promote: Convertir en administrador reason: Raó required_field: "* Camp obligatori" @@ -315,6 +318,7 @@ ca: edit_profile: Modificar perfil help: Ajuda login: Entra + manage_memberships: report: report_title: INFORME locales: @@ -411,6 +415,20 @@ ca: subtitle: TimeOverflow és lliure, gratuït i col·laboratiu title: El software disenyat per i per title2: als Bancs de Temps + petitions: + application_sent: + application_sent_body: + application_status: + applications: + apply: + new: + new_body: + status: + accepted: + declined: + pending: + sent: + status_applications: posts: show: info: Aquesta %{type} pertany a %{organization}. @@ -506,6 +524,9 @@ ca: change_your_image: Canvia la teva imatge crop_the_image: Retalla la imatge max_size_warning: La imatge és massa gran, el màxim permès és de %{size}MB + confirm_email: + email_sent: + please: edit: edit_user: Canviar usuari form: @@ -555,7 +576,9 @@ ca: active_warning: Vas a canviar l'estat del compte de l'usuari %{user} cancel_warning: Vas a eliminar del banc a l'usuari %{user} deactivate: Desactivar + delete_membership: manage_warning: Vas a canviar els privilegis de l'usuari %{user} + sure_delete: views: pagination: first: "« Primera" diff --git a/config/locales/en.yml b/config/locales/en.yml index 3ef1bec6..fcec14fd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -274,6 +274,7 @@ en: contact_details: Contact details create: Create date: Data + decline: decline delete: Delete demote: Demote to normal user edit: Update @@ -281,6 +282,7 @@ en: filter: Filter from: From give_time: Time transfer + here: here home: Home information: Information locales_header: change language @@ -288,6 +290,7 @@ en: more: More movements: Transactions next: Next + or: or promote: Promote to administrator reason: Reason required_field: "* Required field" @@ -300,9 +303,6 @@ en: table: actions: Actions to: To - here: here - decline: decline - or: or inquiries: edit: submit: Change inquiry @@ -316,9 +316,9 @@ en: bdtnear: Search Timebank edit_org: Update %{organization} edit_profile: Update my profile - manage_memberships: Manage memberships help: Help login: Login + manage_memberships: Manage memberships report: report_title: REPORT locales: @@ -415,6 +415,20 @@ en: subtitle: TimeOverflow is open source, free and collaborative title: The software designed by and for title2: Time Banks + petitions: + application_sent: Application sent correctly + application_sent_body: Hello! your application to %{organization_name} has been sent correctly. + application_status: Application %{status} + applications: Applications + apply: Apply to join + new: New Application + new_body: Hello! New petition from user %{username}. Manage your applications %{here_link}. + status: + accepted: accepted + declined: declined + pending: pending + sent: sent + status_applications: "%{status} applications" posts: show: info: This %{type} belongs to %{organization}. @@ -506,13 +520,13 @@ en: new: error_amount: Time must be greater than 0 users: - confirm_email: - please: Please, confirm the email - email_sent: An email has been sent to %{email}. After confirm you will be able to apply to any organization. avatar: change_your_image: Change your image crop_the_image: Crop the image max_size_warning: Image is too big, max allowed is %{size}MB + confirm_email: + email_sent: An email has been sent to %{email}. After confirm you will be able to apply to any organization. + please: Please, confirm the email edit: edit_user: Update user form: @@ -562,8 +576,8 @@ en: active_warning: You are going to change user account status for %{user} cancel_warning: You are going to delete account from the Time Bank for user %{user} deactivate: Deactivate - manage_warning: You are going to change privileges for user %{user} delete_membership: Delete membership + manage_warning: You are going to change privileges for user %{user} sure_delete: Are you sure you want to delete your membership from %{organization_name}? views: pagination: @@ -572,18 +586,3 @@ en: next: Next previous: Previous truncate: Truncate - petitions: - status: - pending: pending - accepted: accepted - declined: declined - sent: sent - application_status: Application %{status} - status_applications: "%{status} applications" - application_sent: Application sent correctly - application_sent_body: Hello! your application to %{organization_name} has been sent correctly. - new: New Application - new_body: Hello! New petition from user %{username}. Manage your applications %{here_link}. - apply: Apply to join - applications: Applications - diff --git a/config/locales/es.yml b/config/locales/es.yml index 30353ba1..6fda18e8 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -274,6 +274,7 @@ es: contact_details: Datos de contacto create: Crear date: Fecha + decline: delete: Borrar demote: Convertir en usuario normal edit: Modificar @@ -281,6 +282,7 @@ es: filter: Filtro from: De give_time: Transferir tiempo + here: home: Inicio information: Información locales_header: cambiar idioma @@ -288,6 +290,7 @@ es: more: Ver más movements: Movimientos next: Siguiente + or: promote: Convertir en administrador reason: Razón required_field: "* Campo obligatorio" @@ -315,6 +318,7 @@ es: edit_profile: Modificar mi perfil help: Ayuda login: Entra + manage_memberships: report: report_title: INFORME locales: @@ -411,6 +415,20 @@ es: subtitle: TimeOverflow es libre, gratuito y colaborativo title: El software diseñado por y para title2: los Bancos de Tiempo + petitions: + application_sent: + application_sent_body: + application_status: + applications: + apply: + new: + new_body: + status: + accepted: + declined: + pending: + sent: + status_applications: posts: show: info: Esta %{type} pertenece a %{organization}. @@ -506,6 +524,9 @@ es: change_your_image: Cambia tu imagen crop_the_image: Recortar la imagen max_size_warning: La imagen es demasiado grande, el máximo permitido es %{size}MB + confirm_email: + email_sent: + please: edit: edit_user: Cambiar usuario form: @@ -555,7 +576,9 @@ es: active_warning: Va a cambiar el estado de la cuenta del usuario %{user} cancel_warning: Va a eliminar del banco al usuario %{user} deactivate: Desactivar + delete_membership: manage_warning: Va a cambiar los privilegios del usuario %{user} + sure_delete: views: pagination: first: "« Primera" diff --git a/config/locales/eu.yml b/config/locales/eu.yml index d5672e39..b0723f2b 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -274,6 +274,7 @@ eu: contact_details: Kontaktuaren datuak create: Sortu date: Datuak + decline: delete: Ezabatu demote: Ohiko erabiltzaile bihurtu edit: Aldaketak egin @@ -281,6 +282,7 @@ eu: filter: Iragazkia from: tik give_time: Denbora eman + here: home: Hasiera information: Informazioa locales_header: Hizkuntza aldatu @@ -288,6 +290,7 @@ eu: more: 'Gehiago ikusi ' movements: Mugimenduak next: Hurrengoa + or: promote: Administratzaile bihurtu reason: Arrazoia required_field: Derrigorrez bete beharrekoa @@ -315,6 +318,7 @@ eu: edit_profile: Nire profila aldatu help: Laguntza login: Sartu + manage_memberships: report: report_title: TXOSTENA locales: @@ -411,6 +415,20 @@ eu: subtitle: TimeOverflow librea dohakoa eta kolaborazio bidezkoa da title: Denbora bankuek diseinaturiko softwarea, title2: Denbora bankuentzat + petitions: + application_sent: + application_sent_body: + application_status: + applications: + apply: + new: + new_body: + status: + accepted: + declined: + pending: + sent: + status_applications: posts: show: info: "%{type} hau %{organization}(e)ri dagokio." @@ -506,6 +524,9 @@ eu: change_your_image: crop_the_image: max_size_warning: + confirm_email: + email_sent: + please: edit: edit_user: Erabiltzailea aldatu form: @@ -555,7 +576,9 @@ eu: active_warning: " %{user} erabiltzailearen kontuaren egoera aldatuko duzu" cancel_warning: " %{user} erabiltzailea D bankutik ezabatuko duzu" deactivate: Desaktibatu + delete_membership: manage_warning: "%{user} erabiltzailearen onurak aldatuko dituzu" + sure_delete: views: pagination: first: Lehenengoa diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 71e4d60b..16661d4e 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -274,6 +274,7 @@ gl: contact_details: Datos de contacto create: Crea date: Datos + decline: delete: Eliminar demote: Degradar a usuario/a normal edit: Actualización @@ -281,6 +282,7 @@ gl: filter: Filtro from: Desde give_time: Transferencia de tempo + here: home: Inicio information: Información locales_header: cambiar o idioma @@ -288,6 +290,7 @@ gl: more: Máis movements: Transaccións next: Próximo + or: promote: Promover á persoa administradora reason: Razón required_field: "* Campo obrigatorio" @@ -315,6 +318,7 @@ gl: edit_profile: Actualiza o meu perfil help: Axuda login: Acceder + manage_memberships: report: report_title: INFORME locales: @@ -411,6 +415,20 @@ gl: subtitle: TimeOverflow é de código aberto, gratuíto e colaborativo title: O software deseñado por e para title2: Bancos de tempo + petitions: + application_sent: + application_sent_body: + application_status: + applications: + apply: + new: + new_body: + status: + accepted: + declined: + pending: + sent: + status_applications: posts: show: info: Este %{type} pertence a %{organization}. @@ -506,6 +524,9 @@ gl: change_your_image: crop_the_image: max_size_warning: + confirm_email: + email_sent: + please: edit: edit_user: Actualizar persoa usuaria form: @@ -555,7 +576,9 @@ gl: active_warning: Vas cambiar o estado da conta de usuario/a para %{user} cancel_warning: Vas borrar a conta do Banco de tempo para o usuario/a %{user} deactivate: Desactivar + delete_membership: manage_warning: Vas cambiar privilexios para o usuario/a %{user} + sure_delete: views: pagination: first: Primeira diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 9a8b9edf..684f7f3a 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -274,6 +274,7 @@ pt-BR: contact_details: Dados de contato create: Criar date: Data + decline: delete: Apagar demote: Converter em usuário normal edit: Modificar @@ -281,6 +282,7 @@ pt-BR: filter: Filtro from: De give_time: Transferir tempo + here: home: Início information: Informação locales_header: Trocar idioma @@ -288,6 +290,7 @@ pt-BR: more: Ver mais movements: Movimentos next: Próximo + or: promote: Converter em administrador reason: Razão required_field: "* Campo obrigatório" @@ -315,6 +318,7 @@ pt-BR: edit_profile: Modificar meu perfil help: Ajuda login: Entre + manage_memberships: report: report_title: INFORME locales: @@ -411,6 +415,20 @@ pt-BR: subtitle: TimeOverflow é livre, gratuito e colaborativo title: O software desenhado por e para title2: os Bancos de Tempo + petitions: + application_sent: + application_sent_body: + application_status: + applications: + apply: + new: + new_body: + status: + accepted: + declined: + pending: + sent: + status_applications: posts: show: info: Este %{type} pertence a %{organization}. @@ -506,6 +524,9 @@ pt-BR: change_your_image: crop_the_image: max_size_warning: + confirm_email: + email_sent: + please: edit: edit_user: Trocar usuário form: @@ -555,7 +576,9 @@ pt-BR: active_warning: Mudará o estado da conta do usuário %{user} cancel_warning: Eliminará o usuário do banco %{user} deactivate: Desativar + delete_membership: manage_warning: Mudará os privilégios do usuário %{user} + sure_delete: views: pagination: first: "« Primeira" From 8b1793606a28395217e703dbaede0710e88eae0a Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Tue, 10 Jan 2023 22:31:24 +0100 Subject: [PATCH 21/34] add Petition model to admin + minor UI tweaks --- app/admin/petition.rb | 14 ++++++++++++++ app/views/devise/sessions/new.html.erb | 2 +- app/views/petitions/manage.html.erb | 7 ++----- app/views/users/_form.html.erb | 6 +++--- config/initializers/active_admin.rb | 1 + 5 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 app/admin/petition.rb diff --git a/app/admin/petition.rb b/app/admin/petition.rb new file mode 100644 index 00000000..f0c88c5b --- /dev/null +++ b/app/admin/petition.rb @@ -0,0 +1,14 @@ +ActiveAdmin.register Petition do + actions :index + + index do + id_column + column :user + column :organization + column :created_at + column :status + end + + filter :status, as: :select, collection: -> { Petition.statuses } + filter :created_at +end diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 010677f1..6fcd5c7c 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -43,7 +43,7 @@
    - <%= t('global.or').upcase %> +
    <%= t('global.or').upcase %>
    diff --git a/app/views/petitions/manage.html.erb b/app/views/petitions/manage.html.erb index c09a3342..ef3890a5 100644 --- a/app/views/petitions/manage.html.erb +++ b/app/views/petitions/manage.html.erb @@ -1,10 +1,7 @@
    -

    - <%= link_to current_organization.name, current_organization %> - <%= t('petitions.applications') %> -

    +

    <%= t('petitions.applications') %>

    @@ -14,7 +11,7 @@ diff --git a/app/views/shared/_posts.html.erb b/app/views/shared/_posts.html.erb index 69fbd1e7..c39015f6 100644 --- a/app/views/shared/_posts.html.erb +++ b/app/views/shared/_posts.html.erb @@ -12,9 +12,9 @@

    <% if post.category %> - <%= glyph :folder_open %> <%= link_to [post.class, cat: post.category] do %> + <%= category_icon(post.category) %> <%= post.category %> <% end %> diff --git a/db/seeds.rb b/db/seeds.rb index 818dbdff..f0aece73 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -128,8 +128,8 @@ unless Category.exists? Category.connection.execute "ALTER SEQUENCE categories_id_seq RESTART;" [ - "Acompañamiento", "Salud", "Tareas domésticas", "Tareas administrativas", - "Clases", "Ocio", "Asesoramiento", "Otro" + "Acompañamiento", "Salud", "Tareas domésticas", "Tareas administrativas", "Estética", "Clases", + "Ocio", "Asesoramiento", "Otros", "Préstamo de herramientas, material, libros, ...", "Tareas domésticas" ].each do |name| unless Category.with_name_translation(name).exists? Category.create { |c| c.name = name } From a70ef9b555fc9dd4a29d6bbb0032770e2d8c39e4 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Mon, 13 Feb 2023 22:14:55 +0100 Subject: [PATCH 25/34] [feat] allow organizations to add custom logo (de-hardcodes Redeira custom logo) --- app/assets/images/redeira.png | Bin 24652 -> 0 bytes app/controllers/organizations_controller.rb | 2 +- app/helpers/application_helper.rb | 11 ++++ app/helpers/brand_logo_helper.rb | 17 ----- app/models/organization.rb | 2 + app/models/user.rb | 1 + app/views/application/_brand_logo.html.erb | 3 - app/views/layouts/application.html.erb | 3 +- app/views/organizations/_form.html.erb | 1 + .../organizations/_organizations_row.html.erb | 7 ++- config/initializers/branded_organization.rb | 7 --- spec/features/brand_logo_spec.rb | 59 ------------------ 12 files changed, 22 insertions(+), 91 deletions(-) delete mode 100644 app/assets/images/redeira.png delete mode 100644 app/helpers/brand_logo_helper.rb delete mode 100644 app/views/application/_brand_logo.html.erb delete mode 100644 config/initializers/branded_organization.rb delete mode 100644 spec/features/brand_logo_spec.rb diff --git a/app/assets/images/redeira.png b/app/assets/images/redeira.png deleted file mode 100644 index 1806f0428636194971097b7388e882e95dbe00ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24652 zcmeFZby!th*EhO0UD6?4Dr_1y-LdK3AdONR*wS4RA`%ixNOuYdNH>BAC?F{y4I(We zDg7M3y%g50DxPnDsTh< zK&HUYMmSjD&k~AuUjQHq^w&4?L|FPTxw^a9q8yP-o_?-KCZsRQ765!_D$*Ph9K@W% zZagR+pe-_`C=lCx_+gQ}N0hW%&|1azo-if<&crAQqY4wO3vYe#re*ovFKB|&YfYt` zcIBY0H!$9Xm|tgSZN)~5hZp>39qPgD3^OlykvtR+2G)mzq^nSF?N{faU-rDNwvU-E zB!+$w9$hWg`1$F8!_+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4LEp{}qO;C^0xV!KkWf#Na&p*wEJI z&@=TwZpn8eBL@?uW?w904u6HO3V6Qty#SCA7nYajgLT9ZfC!E(X?nIY=m9bmrS|>8hh9Q>jwm_nWKuqq1)C} zL(J9}j7pUnued*aZ%Jv)_>R@biTKI>H;u$j^46E9g{`PAv8+-1RK~imf1++_hVQX8 tU+aU$%bnifEj->U{av1K9uo diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 9c1225dc..37daeafc 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -52,6 +52,6 @@ def load_resource def organization_params params[:organization].permit(*%w[name theme email phone web public_opening_times description address - neighborhood city domain]) + neighborhood city domain logo]) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index becad91c..277101bb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -24,6 +24,17 @@ def gravatar_url(user, size = 32) "https://www.gravatar.com/avatar/#{gravatar_id}.png?#{gravatar_options.to_param}" end + def organization_logo + org = @organization || @current_organization + + return unless org && org.logo.attached? + return if "#{controller_name}##{action_name}".in? %w(organizations#index pages#show) + + content_tag(:div, class: "row") do + image_tag(org.logo.variant(resize: "x200^"), class: 'img-responsive center-block') + end + end + def mdash raw "—" end diff --git a/app/helpers/brand_logo_helper.rb b/app/helpers/brand_logo_helper.rb deleted file mode 100644 index bc02bb1e..00000000 --- a/app/helpers/brand_logo_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -module BrandLogoHelper - def render_brand_logo - return unless should_render_logo? - render 'application/brand_logo' - end - - private - - def should_render_logo? - return false unless current_user - current_organization&.id == branded_organization_id - end - - def branded_organization_id - Rails.application.config.branded_organization_id - end -end diff --git a/app/models/organization.rb b/app/models/organization.rb index 2b6cef8a..559f34a8 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -10,6 +10,8 @@ class Organization < ApplicationRecord } } + has_one_attached :logo + has_many :members, dependent: :destroy has_many :users, -> { order "members.created_at DESC" }, through: :members has_many :all_accounts, class_name: "Account", inverse_of: :organization, dependent: :destroy diff --git a/app/models/user.rb b/app/models/user.rb index e08263dd..a625c0d0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -20,6 +20,7 @@ class User < ApplicationRecord attr_accessor :from_signup has_one_attached :avatar + has_many :members, dependent: :destroy has_many :organizations, through: :members has_many :accounts, through: :members diff --git a/app/views/application/_brand_logo.html.erb b/app/views/application/_brand_logo.html.erb deleted file mode 100644 index 4959dfd8..00000000 --- a/app/views/application/_brand_logo.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -

    - <%= image_tag("redeira.png", class: 'organization-brand-logo img-responsive center-block') %> -
    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f428c7cd..d97dea28 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,14 +18,13 @@
    <%= render 'layouts/messages' unless devise_controller? %> <%= yield %> + <%= organization_logo %>
    - - <%= render_brand_logo %> <%= render 'application/footer' %> diff --git a/app/views/organizations/_form.html.erb b/app/views/organizations/_form.html.erb index 56bfbbb1..d87e4188 100644 --- a/app/views/organizations/_form.html.erb +++ b/app/views/organizations/_form.html.erb @@ -9,5 +9,6 @@ <%= f.input :address %> <%= f.input :neighborhood %> <%= f.input :city %> + <%= f.input :logo %> <%= f.button :submit %> <% end %> diff --git a/app/views/organizations/_organizations_row.html.erb b/app/views/organizations/_organizations_row.html.erb index 638204a8..3b589b01 100644 --- a/app/views/organizations/_organizations_row.html.erb +++ b/app/views/organizations/_organizations_row.html.erb @@ -15,9 +15,12 @@ data: { confirm: t('users.user_rows.sure_delete', organization_name: org.name) }, class: 'btn btn-danger' %> <% elsif petition && !current_user.was_member?(petition) %> - <%= petition.status %> + <%= petition.status %> <% else %> - <%= link_to t('petitions.apply'), petitions_path(user_id: current_user.id, organization_id: org.id, status: 'pending'), method: :post %> + <%= link_to t('petitions.apply'), + petitions_path(user_id: current_user.id, organization_id: org.id, status: 'pending'), + method: :post, + class: 'btn btn-default' %> <% end %> <% end %> diff --git a/config/initializers/branded_organization.rb b/config/initializers/branded_organization.rb deleted file mode 100644 index 17bbac2b..00000000 --- a/config/initializers/branded_organization.rb +++ /dev/null @@ -1,7 +0,0 @@ -DEFAULT_BRANDED_ORG_ID = 246 - -Rails.application.config.branded_organization_id = nil - -unless Rails.env.test? - Rails.application.config.branded_organization_id = (Redis.current.get('branded_organization_id') || DEFAULT_BRANDED_ORG_ID).to_i -end diff --git a/spec/features/brand_logo_spec.rb b/spec/features/brand_logo_spec.rb deleted file mode 100644 index 00c91346..00000000 --- a/spec/features/brand_logo_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -RSpec.feature 'sign in' do - let(:user) do - user = Fabricate( - :user, - email: 'user@timeoverflow.org', - password: 'papapa22', - terms_accepted_at: 1.day.from_now - ) - - user.add_to_organization(organization) - - user - end - - let(:organization) { Fabricate(:organization) } - - context 'with a branded org id' do - before do - allow(Rails.application.config).to receive(:branded_organization_id).and_return(organization.id) - sign_in_with(user.email, user.password) - end - - it 'renders the logo' do - expect(page).to have_css('.organization-brand-logo') - end - end - - context 'without a branded org id' do - before do - allow(Rails.application.config).to receive(:branded_organization_id).and_return(1234) - sign_in_with(user.email, user.password) - end - - it 'does not render the logo' do - expect(page).to have_no_css('.organization-brand-logo') - end - end -end - -RSpec.feature 'sign out' do - let!(:user) do - Fabricate( - :user, - email: 'user@timeoverflow.org', - password: 'papapa22', - terms_accepted_at: 1.day.from_now - ) - end - - context 'without a user' do - it 'does not render the logo' do - sign_in_with(user.email, user.password) - click_link user.email - click_link I18n.t('application.navbar.sign_out') - - expect(page).to have_no_css('.organization-brand-logo') - end - end -end From 60d6c3679363e3495c26a1ef4b7b4225b390d694 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Mar 2023 10:31:12 +0100 Subject: [PATCH 26/34] build(deps): bump rack from 2.2.6.2 to 2.2.6.3 (#676) Bumps [rack](https://github.com/rack/rack) from 2.2.6.2 to 2.2.6.3. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v2.2.6.2...v2.2.6.3) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 68ff30f6..687ceac5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -253,7 +253,7 @@ GEM activesupport (>= 3.0.0) raabro (1.4.0) racc (1.6.1) - rack (2.2.6.2) + rack (2.2.6.3) rack-test (2.0.2) rack (>= 1.3) rails (6.1.6) From afafeaf38afb74f5179799d5628e0d0cc2e6662e Mon Sep 17 00:00:00 2001 From: Marc Anguera Date: Tue, 14 Mar 2023 22:10:02 +0100 Subject: [PATCH 27/34] TravisCI -> GH Actions (#648) --- .github/workflows/ci.yml | 35 +++++++++++++++++++ .travis.yml | 21 ----------- Gemfile | 4 +-- Gemfile.lock | 4 +-- README.md | 2 +- config/database.yml | 24 +++++-------- .../20230312231058_migrate_hstore_to_json.rb | 15 ++++++++ db/structure.sql | 29 +++++++-------- spec/spec_helper.rb | 13 +++++-- 9 files changed, 88 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100644 db/migrate/20230312231058_migrate_hstore_to_json.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..78f31d17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:9.4 + ports: ["5432:5432"] + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: timeoverflow_test + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Run tests + env: + RAILS_ENV: test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + run: | + bundle exec rails db:setup + bundle exec rspec + - name: Publish code coverage + uses: paambaati/codeclimate-action@v3.2.0 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + with: + coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d1259e70..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: ruby -dist: bionic -cache: bundler -services: - - postgresql -addons: - postgresql: "9.4" - chrome: stable -bundler_args: '--without development' -env: - global: - - DATABASE_URL=postgres://postgres@localhost/timeoverflow_test - - CC_TEST_REPORTER_ID=025bc15a0fa9afa52d86ee24fea845cf1d363f48a466bcf2cef8ab80c29acb28 -before_script: - - psql -c 'create database timeoverflow_test;' -U postgres - - psql -U postgres -q -d timeoverflow_test -f db/structure.sql - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT diff --git a/Gemfile b/Gemfile index e5c4a91f..a8eb95e5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby File.read('.ruby-version').strip +ruby ">= #{File.read('.ruby-version').strip}" gem 'rails', '~> 6.1.1' gem 'rails-i18n', '~> 6.0.0' @@ -10,7 +10,7 @@ gem 'activeadmin', '~> 2.9.0' gem 'bootsnap', '~> 1.12.0', require: false gem 'has_scope', '~> 0.7.2' gem 'pundit', '~> 2.1.0' -gem 'pg', '~> 1.2.1' +gem 'pg', '~> 1.4' gem 'json_translate', '~> 4.0.0' gem 'devise', '~> 4.7.1' gem 'http_accept_language', '~> 2.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index 687ceac5..a471be09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -239,7 +239,7 @@ GEM parser (3.0.1.1) ast (~> 2.4.1) pdf-core (0.9.0) - pg (1.2.3) + pg (1.4.6) pg_search (2.3.5) activerecord (>= 5.2) activesupport (>= 5.2) @@ -450,7 +450,7 @@ DEPENDENCIES letter_opener (~> 1.7.0) listen (~> 3.2.0) localeapp (~> 3.1) - pg (~> 1.2.1) + pg (~> 1.4) pg_search (~> 2.3.5) prawn (~> 2.4.0) prawn-table (~> 0.2.2) diff --git a/README.md b/README.md index d3a7233c..c08cc6ea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TimeOverflow [![View performance data on Skylight](https://badges.skylight.io/problem/grDTNuzZRnyu.svg)](https://oss.skylight.io/app/applications/grDTNuzZRnyu) -[![Build Status](https://travis-ci.com/coopdevs/timeoverflow.svg?branch=develop)](https://travis-ci.com/coopdevs/timeoverflow) +[![Build Status](https://github.com/coopdevs/timeoverflow/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/coopdevs/timeoverflow/actions) [![Maintainability](https://api.codeclimate.com/v1/badges/f82c6d98a2441c84f2ef/maintainability)](https://codeclimate.com/github/coopdevs/timeoverflow/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/f82c6d98a2441c84f2ef/test_coverage)](https://codeclimate.com/github/coopdevs/timeoverflow/test_coverage) diff --git a/config/database.yml b/config/database.yml index ea70e91a..a840d2a0 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,20 +1,6 @@ -# If you want to change this file, please keep the changes in your working -# copy by using -# -# git update-index --skip-worktree config/database.yml -# -# or just use DATABASE_URL, in which case Rails will happily skip the whole -# file. -# -# See https://github.com/coopdevs/timeoverflow/wiki/Keeping-your-local-files -# for more information -# - defaults: &defaults adapter: postgresql - username: <%= ENV['DATABASE_USER'] %> # default is null - collation: 'es_ES.UTF-8' - ctype: 'es_ES.UTF-8' + username: <%= ENV['DATABASE_USER'] || ENV["POSTGRES_USER"] %> template: 'template0' encoding: 'UTF8' @@ -24,12 +10,18 @@ development: test: <<: *defaults - database: 'timeoverflow_test' + database: timeoverflow_test + host: localhost + password: <%= ENV['DATABASE_PASSWORD'] || ENV["POSTGRES_PASSWORD"] %> staging: <<: *defaults + collation: 'es_ES.UTF-8' + ctype: 'es_ES.UTF-8' database: <%= ENV.fetch('DATABASE_NAME', 'timeoverflow_staging') %> production: <<: *defaults + collation: 'es_ES.UTF-8' + ctype: 'es_ES.UTF-8' database: <%= ENV.fetch('DATABASE_NAME', 'timeoverflow_production') %> diff --git a/db/migrate/20230312231058_migrate_hstore_to_json.rb b/db/migrate/20230312231058_migrate_hstore_to_json.rb new file mode 100644 index 00000000..7ab08b7a --- /dev/null +++ b/db/migrate/20230312231058_migrate_hstore_to_json.rb @@ -0,0 +1,15 @@ +class MigrateHstoreToJson < ActiveRecord::Migration[6.1] + def up + rename_column :categories, :name_translations, :name_translations_hstore + add_column :categories, :name_translations, :jsonb, default: {}, null: false, index: { using: 'gin' } + execute 'UPDATE "categories" SET "name_translations" = json_object(hstore_to_matrix("name_translations_hstore"))::jsonb' + remove_column :categories, :name_translations_hstore + end + + def down + rename_column :categories, :name_translations, :name_translations_jsonb + add_column :categories, :name_translations, :hstore, default: {}, null: false + execute 'UPDATE "categories" SET "name_translations" = (SELECT hstore(key, value) FROM jsonb_each_text("name_translations_jsonb"))' + remove_column :categories, :name_translations_jsonb + end +end diff --git a/db/structure.sql b/db/structure.sql index 8ad16f15..2ce681d0 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -158,7 +158,7 @@ ALTER SEQUENCE public.active_admin_comments_id_seq OWNED BY public.active_admin_ -- --- Name: active_storage_attachments; Type: TABLE; Schema: public; Owner: - +-- Name: active_storage_attachments; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.active_storage_attachments ( @@ -191,7 +191,7 @@ ALTER SEQUENCE public.active_storage_attachments_id_seq OWNED BY public.active_s -- --- Name: active_storage_blobs; Type: TABLE; Schema: public; Owner: - +-- Name: active_storage_blobs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.active_storage_blobs ( @@ -227,7 +227,7 @@ ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage -- --- Name: active_storage_variant_records; Type: TABLE; Schema: public; Owner: - +-- Name: active_storage_variant_records; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.active_storage_variant_records ( @@ -257,7 +257,7 @@ ALTER SEQUENCE public.active_storage_variant_records_id_seq OWNED BY public.acti -- --- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - +-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.ar_internal_metadata ( @@ -276,7 +276,7 @@ CREATE TABLE public.categories ( id integer NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, - name_translations public.hstore + name_translations jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -822,7 +822,7 @@ ALTER TABLE ONLY public.active_admin_comments -- --- Name: active_storage_attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: active_storage_attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_attachments @@ -830,7 +830,7 @@ ALTER TABLE ONLY public.active_storage_attachments -- --- Name: active_storage_blobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: active_storage_blobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_blobs @@ -838,7 +838,7 @@ ALTER TABLE ONLY public.active_storage_blobs -- --- Name: active_storage_variant_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: active_storage_variant_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.active_storage_variant_records @@ -846,7 +846,7 @@ ALTER TABLE ONLY public.active_storage_variant_records -- --- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.ar_internal_metadata @@ -977,28 +977,28 @@ CREATE INDEX index_active_admin_comments_on_resource_type_and_resource_id ON pub -- --- Name: index_active_storage_attachments_on_blob_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_active_storage_attachments_on_blob_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_active_storage_attachments_on_blob_id ON public.active_storage_attachments USING btree (blob_id); -- --- Name: index_active_storage_attachments_uniqueness; Type: INDEX; Schema: public; Owner: - +-- Name: index_active_storage_attachments_uniqueness; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_active_storage_attachments_uniqueness ON public.active_storage_attachments USING btree (record_type, record_id, name, blob_id); -- --- Name: index_active_storage_blobs_on_key; Type: INDEX; Schema: public; Owner: - +-- Name: index_active_storage_blobs_on_key; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_active_storage_blobs_on_key ON public.active_storage_blobs USING btree (key); -- --- Name: index_active_storage_variant_records_uniqueness; Type: INDEX; Schema: public; Owner: - +-- Name: index_active_storage_variant_records_uniqueness; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_active_storage_variant_records_uniqueness ON public.active_storage_variant_records USING btree (blob_id, variation_digest); @@ -1285,6 +1285,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20210423193937'), ('20210424174640'), ('20210502160343'), -('20210503201944'); +('20210503201944'), +('20230312231058'); diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8045aeda..1ab96aa9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,16 @@ -require 'simplecov' -SimpleCov.start 'rails' - ENV["RAILS_ENV"] ||= 'test' ENV["ADMINS"] = "admin@timeoverflow.org" +require 'simplecov' + +SimpleCov.formatter = if ENV["CI"] + require "simplecov_json_formatter" + SimpleCov::Formatter::JSONFormatter +else + SimpleCov::Formatter::HTMLFormatter +end +SimpleCov.start 'rails' + require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'capybara/rails' From 25e32fb0ad0b80ee26b4c13f9f21771422c32942 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Wed, 15 Mar 2023 01:20:12 +0100 Subject: [PATCH 28/34] Refactor categories icons. Now they are editable from the admin section. --- app/admin/category.rb | 8 +++-- app/assets/stylesheets/active_admin.scss | 3 ++ app/helpers/categories_helper.rb | 31 ++----------------- ...30314233504_add_icon_name_to_categories.rb | 22 +++++++++++++ db/structure.sql | 6 ++-- 5 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 db/migrate/20230314233504_add_icon_name_to_categories.rb diff --git a/app/admin/category.rb b/app/admin/category.rb index 51e147d2..ed3b8ca1 100644 --- a/app/admin/category.rb +++ b/app/admin/category.rb @@ -1,13 +1,16 @@ ActiveAdmin.register Category do index do id_column - column :name, sortable: false + column :name do |category| + "#{tag.span(nil, class: "glyphicon glyphicon-#{category.icon_name}")} #{category.name}".html_safe + end actions end form do |f| f.inputs do f.input :name + f.input :icon_name, hint: "See all available icons here".html_safe end f.actions end @@ -16,6 +19,7 @@ attributes_table do row :created_at row :updated_at + row :icon_name row :name_translations do cat.name_translations.map do |locale, translation| tag.strong("#{I18n.t("locales.#{locale}", locale: locale)}: ") + @@ -25,5 +29,5 @@ end end - permit_params :name + permit_params :name, :icon_name end diff --git a/app/assets/stylesheets/active_admin.scss b/app/assets/stylesheets/active_admin.scss index 49d8b810..46fb8521 100644 --- a/app/assets/stylesheets/active_admin.scss +++ b/app/assets/stylesheets/active_admin.scss @@ -5,3 +5,6 @@ $table-stripe-color: #f5f5f5; @import "active_admin/mixins"; @import "active_admin/base"; @import "select2"; +@import "bootstrap-sprockets"; +@import "bootstrap/variables"; +@import "bootstrap/glyphicons"; diff --git a/app/helpers/categories_helper.rb b/app/helpers/categories_helper.rb index 09b7256b..f644257b 100644 --- a/app/helpers/categories_helper.rb +++ b/app/helpers/categories_helper.rb @@ -7,35 +7,8 @@ def categories_for_select all_categories.map { |cat| [cat.name, cat.id] } end - # NOTE This is far from ideal :) It relies on DB data editable via the /admin - # section or the console. Maybe Category should be a read-only model? def category_icon(category) - icon_name = - case category.name - when 'Acompañamiento' - :random - when 'Asesoramiento' - :briefcase - when 'Clases' - :education - when 'Estética' - :scissors - when 'Ocio' - :music - when 'Otros' - :asterisk - when 'Préstamo de herramientas, material, libros, ...' - :wrench - when 'Salud' - :apple - when 'Tareas administrativas' - :list_alt - when 'Tareas domésticas' - :shopping_cart - else - :folder_open - end - - glyph(icon_name) + icon_name = category.icon_name + glyph(icon_name) if icon_name end end diff --git a/db/migrate/20230314233504_add_icon_name_to_categories.rb b/db/migrate/20230314233504_add_icon_name_to_categories.rb new file mode 100644 index 00000000..7376d3a8 --- /dev/null +++ b/db/migrate/20230314233504_add_icon_name_to_categories.rb @@ -0,0 +1,22 @@ +class AddIconNameToCategories < ActiveRecord::Migration[6.1] + def change + add_column :categories, :icon_name, :string + + # Initialize icon names for each category with mapping defined in #673 + icon_mapping = { + 'Acompañamiento' => 'random', + 'Asesoramiento' => 'briefcase', + 'Clases' => 'education', + 'Estética' => 'scissors', + 'Ocio' => 'music', + 'Otros' => 'asterisk', + 'Préstamo de herramientas, material, libros, ...' => 'wrench', + 'Salud' => 'apple', + 'Tareas administrativas' => 'list-alt', + 'Tareas domésticas' => 'shopping-cart' + } + Category.all.each do |category| + category.update(icon_name: icon_mapping[category.name] || 'folder-open') + end + end +end diff --git a/db/structure.sql b/db/structure.sql index d8b60f0c..427b1b36 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -276,7 +276,8 @@ CREATE TABLE public.categories ( id integer NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, - name_translations jsonb DEFAULT '{}'::jsonb NOT NULL + name_translations jsonb DEFAULT '{}'::jsonb NOT NULL, + icon_name character varying ); @@ -1365,6 +1366,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20210502160343'), ('20210503201944'), ('20221016192111'), -('20230312231058'); +('20230312231058'), +('20230314233504'); From ac5486b4bfb3a4e0bb31da690179401d937d7c94 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Wed, 15 Mar 2023 01:59:25 +0100 Subject: [PATCH 29/34] [deps] upgrade Rails to latest 6.1 patch --- Gemfile.lock | 154 ++++++++++++++++++++++++++++----------------------- 1 file changed, 84 insertions(+), 70 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 44f32d84..2e0919b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,40 +1,40 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.6) - actionpack (= 6.1.6) - activesupport (= 6.1.6) + actioncable (6.1.7.3) + actionpack (= 6.1.7.3) + activesupport (= 6.1.7.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.6) - actionpack (= 6.1.6) - activejob (= 6.1.6) - activerecord (= 6.1.6) - activestorage (= 6.1.6) - activesupport (= 6.1.6) + actionmailbox (6.1.7.3) + actionpack (= 6.1.7.3) + activejob (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) mail (>= 2.7.1) - actionmailer (6.1.6) - actionpack (= 6.1.6) - actionview (= 6.1.6) - activejob (= 6.1.6) - activesupport (= 6.1.6) + actionmailer (6.1.7.3) + actionpack (= 6.1.7.3) + actionview (= 6.1.7.3) + activejob (= 6.1.7.3) + activesupport (= 6.1.7.3) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.6) - actionview (= 6.1.6) - activesupport (= 6.1.6) + actionpack (6.1.7.3) + actionview (= 6.1.7.3) + activesupport (= 6.1.7.3) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.6) - actionpack (= 6.1.6) - activerecord (= 6.1.6) - activestorage (= 6.1.6) - activesupport (= 6.1.6) + actiontext (6.1.7.3) + actionpack (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) nokogiri (>= 1.8.5) - actionview (6.1.6) - activesupport (= 6.1.6) + actionview (6.1.7.3) + activesupport (= 6.1.7.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -48,22 +48,22 @@ GEM kaminari (~> 1.0, >= 1.2.1) railties (>= 5.2, < 6.2) ransack (~> 2.1, >= 2.1.1) - activejob (6.1.6) - activesupport (= 6.1.6) + activejob (6.1.7.3) + activesupport (= 6.1.7.3) globalid (>= 0.3.6) - activemodel (6.1.6) - activesupport (= 6.1.6) - activerecord (6.1.6) - activemodel (= 6.1.6) - activesupport (= 6.1.6) - activestorage (6.1.6) - actionpack (= 6.1.6) - activejob (= 6.1.6) - activerecord (= 6.1.6) - activesupport (= 6.1.6) + activemodel (6.1.7.3) + activesupport (= 6.1.7.3) + activerecord (6.1.7.3) + activemodel (= 6.1.7.3) + activesupport (= 6.1.7.3) + activestorage (6.1.7.3) + actionpack (= 6.1.7.3) + activejob (= 6.1.7.3) + activerecord (= 6.1.7.3) + activesupport (= 6.1.7.3) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.6) + activesupport (6.1.7.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -77,8 +77,8 @@ GEM activesupport (>= 3.0.0, < 6.2) ruby2_keywords (>= 0.0.2, < 1.0) ast (2.4.2) - autoprefixer-rails (10.2.4.0) - execjs + autoprefixer-rails (10.4.13.0) + execjs (~> 2) aws-eventstream (1.1.1) aws-partitions (1.451.0) aws-sdk-core (3.114.0) @@ -126,10 +126,11 @@ GEM regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) childprocess (3.0.0) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) connection_pool (2.2.5) crass (1.0.6) database_cleaner (1.8.5) + date (3.3.3) devise (4.7.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -144,10 +145,10 @@ GEM dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) - erubi (1.10.0) + erubi (1.12.0) et-orbi (1.2.4) tzinfo - execjs (2.7.0) + execjs (2.8.1) fabrication (2.22.0) faker (2.17.0) i18n (>= 1.6, < 2) @@ -159,7 +160,7 @@ GEM et-orbi (~> 1.1, >= 1.1.8) raabro (~> 1.4) gli (2.21.0) - globalid (1.0.1) + globalid (1.1.0) activesupport (>= 5.0) has_scope (0.7.2) actionpack (>= 4.1) @@ -214,8 +215,11 @@ GEM loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) method_source (1.0.0) mime-types (3.4.1) @@ -223,11 +227,20 @@ GEM mime-types-data (3.2022.0105) mini_magick (4.11.0) mini_mime (1.1.2) - mini_portile2 (2.8.0) - minitest (5.17.0) + mini_portile2 (2.8.1) + minitest (5.18.0) msgpack (1.5.2) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) + net-smtp (0.3.3) + net-protocol net-ssh (6.1.0) netrc (0.11.0) nio4r (2.5.8) @@ -252,24 +265,24 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.6.1) - rack (2.2.6.3) - rack-test (2.0.2) + racc (1.6.2) + rack (2.2.6.4) + rack-test (2.1.0) rack (>= 1.3) - rails (6.1.6) - actioncable (= 6.1.6) - actionmailbox (= 6.1.6) - actionmailer (= 6.1.6) - actionpack (= 6.1.6) - actiontext (= 6.1.6) - actionview (= 6.1.6) - activejob (= 6.1.6) - activemodel (= 6.1.6) - activerecord (= 6.1.6) - activestorage (= 6.1.6) - activesupport (= 6.1.6) + rails (6.1.7.3) + actioncable (= 6.1.7.3) + actionmailbox (= 6.1.7.3) + actionmailer (= 6.1.7.3) + actionpack (= 6.1.7.3) + actiontext (= 6.1.7.3) + actionview (= 6.1.7.3) + activejob (= 6.1.7.3) + activemodel (= 6.1.7.3) + activerecord (= 6.1.7.3) + activestorage (= 6.1.7.3) + activesupport (= 6.1.7.3) bundler (>= 1.15.0) - railties (= 6.1.6) + railties (= 6.1.7.3) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -278,14 +291,14 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) + rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) - railties (6.1.6) - actionpack (= 6.1.6) - activesupport (= 6.1.6) + railties (6.1.7.3) + actionpack (= 6.1.7.3) + activesupport (= 6.1.7.3) method_source rake (>= 12.2) thor (~> 1.0) @@ -381,9 +394,9 @@ GEM simplecov_json_formatter (0.1.3) skylight (5.0.1) activesupport (>= 5.2.0) - sprockets (4.1.1) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) @@ -393,8 +406,9 @@ GEM net-ssh (>= 2.8.0) thor (1.2.1) tilt (2.0.10) + timeout (0.3.2) ttfunk (1.7.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) @@ -421,7 +435,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS ruby From e467044b2b9afbc445ce7725f57f872bd3b24ffa Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Mon, 27 Mar 2023 21:25:58 +0200 Subject: [PATCH 30/34] =?UTF-8?q?=F0=9F=8C=90=20update=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/ca.yml | 40 ++++++++++++++++++++-------------------- config/locales/es.yml | 40 ++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 1e774fa6..f30d500d 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -274,7 +274,7 @@ ca: contact_details: Dades de contacte create: Crear date: Data - decline: + decline: rebutjar delete: Esborrar demote: Convertir en usuari normal edit: Modificar @@ -282,7 +282,7 @@ ca: filter: Filtre from: Des de give_time: Transferir temps - here: + here: aquí home: Inici information: Informació locales_header: canviar llengua @@ -290,7 +290,7 @@ ca: more: Veure més movements: Moviments next: Següent - or: + or: o promote: Convertir en administrador reason: Raó required_field: "* Camp obligatori" @@ -318,7 +318,7 @@ ca: edit_profile: Modificar perfil help: Ajuda login: Entra - manage_memberships: + manage_memberships: Gestiona membres report: report_title: INFORME locales: @@ -416,19 +416,19 @@ ca: title: El software disenyat per i per title2: als Bancs de Temps petitions: - application_sent: - application_sent_body: - application_status: - applications: - apply: - new: - new_body: + application_sent: Sol·licitud enviada correctament + application_sent_body: Hola! La teva sol·licitud a %{organization_name} s'ha enviat correctament. + application_status: Sol·licitud %{status} + applications: Sol·licituds + apply: Sol·licita unir-te + new: Nova sol·licitud + new_body: Hola! Nova petició de l'usuari %{username}. Gestiona les sol·licituds %{here_link}. status: - accepted: - declined: - pending: - sent: - status_applications: + accepted: acceptada + declined: rebutjada + pending: pendent + sent: enviada + status_applications: "%{status} sol·licituds" posts: show: info: Aquesta %{type} pertany a %{organization}. @@ -525,8 +525,8 @@ ca: crop_the_image: Retalla la imatge max_size_warning: La imatge és massa gran, el màxim permès és de %{size}MB confirm_email: - email_sent: - please: + email_sent: T'hem enviat un correu electrònic a %{email}. Un cop confirmis el teu compte de correu podràs sol·licitar unir-te a qualsevol organització. + please: Si us plau, confirma el teu correu electrònic. edit: edit_user: Canviar usuari form: @@ -576,9 +576,9 @@ ca: active_warning: Vas a canviar l'estat del compte de l'usuari %{user} cancel_warning: Vas a eliminar del banc a l'usuari %{user} deactivate: Desactivar - delete_membership: + delete_membership: Elimina pertinença manage_warning: Vas a canviar els privilegis de l'usuari %{user} - sure_delete: + sure_delete: Estàs segur que vols sortir de %{organization_name}? views: pagination: first: "« Primera" diff --git a/config/locales/es.yml b/config/locales/es.yml index 6fda18e8..cc68059e 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -274,7 +274,7 @@ es: contact_details: Datos de contacto create: Crear date: Fecha - decline: + decline: rechazar delete: Borrar demote: Convertir en usuario normal edit: Modificar @@ -282,7 +282,7 @@ es: filter: Filtro from: De give_time: Transferir tiempo - here: + here: aquí home: Inicio information: Información locales_header: cambiar idioma @@ -290,7 +290,7 @@ es: more: Ver más movements: Movimientos next: Siguiente - or: + or: o promote: Convertir en administrador reason: Razón required_field: "* Campo obligatorio" @@ -318,7 +318,7 @@ es: edit_profile: Modificar mi perfil help: Ayuda login: Entra - manage_memberships: + manage_memberships: Gestionar membresia report: report_title: INFORME locales: @@ -416,19 +416,19 @@ es: title: El software diseñado por y para title2: los Bancos de Tiempo petitions: - application_sent: - application_sent_body: - application_status: - applications: - apply: - new: - new_body: + application_sent: Solicitud enviada correctamente + application_sent_body: 'Hola! Tu solicitud a %{organization_name} se ha enviado correctamente. ' + application_status: Solicitud %{status} + applications: Solicitudes + apply: Solicita unirte + new: Nueva solicitud + new_body: Hola! Nueva petición del usuario %{username}. Gestiona las solicitudes %{here_link}. status: - accepted: - declined: - pending: - sent: - status_applications: + accepted: aceptada + declined: rechazada + pending: pendiente + sent: enviada + status_applications: "%{status} solicitudes" posts: show: info: Esta %{type} pertenece a %{organization}. @@ -525,8 +525,8 @@ es: crop_the_image: Recortar la imagen max_size_warning: La imagen es demasiado grande, el máximo permitido es %{size}MB confirm_email: - email_sent: - please: + email_sent: Un email se ha enviado a %{email}. Cuando lo hayas confirmado podrás solicitar unirte a cualquier organización. + please: Por favor, confirma el correo electrónico edit: edit_user: Cambiar usuario form: @@ -576,9 +576,9 @@ es: active_warning: Va a cambiar el estado de la cuenta del usuario %{user} cancel_warning: Va a eliminar del banco al usuario %{user} deactivate: Desactivar - delete_membership: + delete_membership: Borrar membresia manage_warning: Va a cambiar los privilegios del usuario %{user} - sure_delete: + sure_delete: Estás seguro de que quieres dejar de ser miembro de %{organization_name}? views: pagination: first: "« Primera" From 1820729332b7faff535c74dc26e456cba8deae14 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Thu, 30 Mar 2023 21:26:53 +0200 Subject: [PATCH 31/34] [FIX] do not show movements if user is not an active member of the given org --- app/views/organizations/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index fb5eaee7..7247ea8c 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -104,7 +104,7 @@
    -<% if current_user %> +<% if current_user&.active?(@organization) %> <%= render "shared/movements" %> <% else %>
    From cc4e2d67b1ba7fa1bd393024120fb2bbbcb28a55 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Sat, 1 Apr 2023 17:20:50 +0200 Subject: [PATCH 32/34] [deps] update RDiscount (closes #555) --- Gemfile | 4 +--- Gemfile.lock | 7 ++----- app/admin/document.rb | 4 +--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 92c41c38..5b741602 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,8 @@ source 'https://rubygems.org' -ruby ">= #{File.read('.ruby-version').strip}" - gem 'rails', '~> 6.1.1' gem 'rails-i18n', '~> 6.0.0' -gem 'rdiscount', '~> 2.2.0.1' +gem 'rdiscount', '~> 2.2.7' gem 'rubyzip', '~> 2.3.0' gem 'activeadmin', '~> 2.9.0' gem 'bootsnap', '~> 1.12.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 2e0919b2..a8a42aa5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -312,7 +312,7 @@ GEM rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - rdiscount (2.2.0.2) + rdiscount (2.2.7) redis (4.5.1) regexp_parser (2.1.1) responders (3.0.1) @@ -472,7 +472,7 @@ DEPENDENCIES rails (~> 6.1.1) rails-controller-testing rails-i18n (~> 6.0.0) - rdiscount (~> 2.2.0.1) + rdiscount (~> 2.2.7) rollbar (~> 2.22.1) rspec-rails (~> 4.0.0) rubocop (~> 1.6) @@ -492,8 +492,5 @@ DEPENDENCIES web-console (~> 4.1.0) webdrivers (~> 4.4) -RUBY VERSION - ruby 2.6.3p62 - BUNDLED WITH 2.1.4 diff --git a/app/admin/document.rb b/app/admin/document.rb index 804b8a8f..136a6d2c 100644 --- a/app/admin/document.rb +++ b/app/admin/document.rb @@ -17,9 +17,7 @@ end row :label row :title - row :content do - raw RDiscount.new(t.content).to_html - end + row :content end end From e2aeba75d6d9269664fc5b5bf6b565cbefd84d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Perej=C3=B3n=20Barrios?= <70280187+franpb14@users.noreply.github.com> Date: Sat, 1 Apr 2023 21:59:10 +0200 Subject: [PATCH 33/34] [NZ changes] reset password fixes, translatable terms, Inquiry -> Request, max hours in transfers removed (#678) Co-authored-by: Marc Anguera Insa --- Gemfile | 3 ++- Gemfile.lock | 9 +++++--- app/admin/category.rb | 5 +---- app/admin/document.rb | 14 ++++++++----- app/admin/organization.rb | 3 ++- app/admin/post.rb | 3 ++- app/admin/user.rb | 4 ++-- app/helpers/active_admin_helper.rb | 8 +++++++ app/models/document.rb | 2 ++ .../confirmation_instructions.ca.html.erb | 5 ----- .../confirmation_instructions.es.html.erb | 5 ----- .../mailer/confirmation_instructions.html.erb | 5 ----- .../reset_password_instructions.ca.html.erb | 8 ------- .../reset_password_instructions.es.html.erb | 8 ------- .../reset_password_instructions.html.erb | 8 ------- .../mailer/unlock_instructions.ca.html.erb | 7 ------- .../mailer/unlock_instructions.es.html.erb | 7 ------- .../mailer/unlock_instructions.html.erb | 7 ------- .../steps/_set_params.html.erb | 4 +--- app/views/shared/_post.html.erb | 2 +- app/views/transfers/new.html.erb | 4 +--- config/locales/en.yml | 16 +++++++------- .../20230401114456_make_terms_translatable.rb | 21 +++++++++++++++++++ db/structure.sql | 9 ++++---- spec/helpers/active_admin_helper_spec.rb | 8 +++++++ 25 files changed, 79 insertions(+), 96 deletions(-) create mode 100644 app/helpers/active_admin_helper.rb delete mode 100644 app/views/devise/mailer/confirmation_instructions.ca.html.erb delete mode 100644 app/views/devise/mailer/confirmation_instructions.es.html.erb delete mode 100644 app/views/devise/mailer/confirmation_instructions.html.erb delete mode 100644 app/views/devise/mailer/reset_password_instructions.ca.html.erb delete mode 100644 app/views/devise/mailer/reset_password_instructions.es.html.erb delete mode 100644 app/views/devise/mailer/reset_password_instructions.html.erb delete mode 100644 app/views/devise/mailer/unlock_instructions.ca.html.erb delete mode 100644 app/views/devise/mailer/unlock_instructions.es.html.erb delete mode 100644 app/views/devise/mailer/unlock_instructions.html.erb create mode 100644 db/migrate/20230401114456_make_terms_translatable.rb create mode 100644 spec/helpers/active_admin_helper_spec.rb diff --git a/Gemfile b/Gemfile index 5b741602..424f7453 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,8 @@ gem 'has_scope', '~> 0.7.2' gem 'pundit', '~> 2.1.0' gem 'pg', '~> 1.4' gem 'json_translate', '~> 4.0.0' -gem 'devise', '~> 4.7.1' +gem 'devise', '~> 4.9.1' +gem 'devise-i18n', '~> 1.11.0' gem 'http_accept_language', '~> 2.1.1' gem 'unicorn', '~> 5.5.1' gem 'kaminari', '~> 1.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index a8a42aa5..1a610fc3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,7 +95,7 @@ GEM aws-sigv4 (~> 1.1) aws-sigv4 (1.2.3) aws-eventstream (~> 1, >= 1.0.2) - bcrypt (3.1.16) + bcrypt (3.1.18) bindex (0.8.1) bootsnap (1.12.0) msgpack (~> 1.2) @@ -131,12 +131,14 @@ GEM crass (1.0.6) database_cleaner (1.8.5) date (3.3.3) - devise (4.7.3) + devise (4.9.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) + devise-i18n (1.11.0) + devise (>= 4.9.0) diff-lcs (1.4.4) docile (1.3.5) domain_name (0.5.20190701) @@ -451,7 +453,8 @@ DEPENDENCIES capistrano-rbenv (~> 2.1) capybara (~> 3.29) database_cleaner (~> 1.8.5) - devise (~> 4.7.1) + devise (~> 4.9.1) + devise-i18n (~> 1.11.0) dotenv-rails (~> 2.7.1) fabrication (~> 2.20) faker (~> 2.15) diff --git a/app/admin/category.rb b/app/admin/category.rb index ed3b8ca1..9a80ac39 100644 --- a/app/admin/category.rb +++ b/app/admin/category.rb @@ -21,10 +21,7 @@ row :updated_at row :icon_name row :name_translations do - cat.name_translations.map do |locale, translation| - tag.strong("#{I18n.t("locales.#{locale}", locale: locale)}: ") + - tag.span(translation) - end.join(" | ").html_safe + render_translations(cat.name_translations) end end end diff --git a/app/admin/document.rb b/app/admin/document.rb index 136a6d2c..55c9d0fa 100644 --- a/app/admin/document.rb +++ b/app/admin/document.rb @@ -1,5 +1,5 @@ ActiveAdmin.register Document do - permit_params *Document.attribute_names + permit_params :label, :title, :content index do id_column @@ -16,16 +16,20 @@ t.documentable end row :label - row :title - row :content + row :title_translations do + render_translations(t.title_translations) + end + row :content_translations do + render_translations(t.content_translations, "
    ") + end end end form do |f| f.inputs do f.input :label - f.input :title, as: :string - f.input :content + f.input :title, as: :text + f.input :content, as: :text end f.actions end diff --git a/app/admin/organization.rb b/app/admin/organization.rb index a8d75a70..825cb193 100644 --- a/app/admin/organization.rb +++ b/app/admin/organization.rb @@ -46,5 +46,6 @@ def destroy filter :city, as: :select, collection: -> { Organization.pluck(:city).uniq } filter :neighborhood - permit_params *Organization.attribute_names + permit_params :name, :email, :web, :phone, :city, :neighborhood, + :address, :description, :public_opening_times end diff --git a/app/admin/post.rb b/app/admin/post.rb index 5aef7fe3..43c32daf 100644 --- a/app/admin/post.rb +++ b/app/admin/post.rb @@ -30,7 +30,8 @@ f.actions end - permit_params :type, :tag_list, *Post.attribute_names + permit_params :type, :tag_list, :title, :category_id, :user_id, + :description, :organization_id, :active, :is_group filter :type, as: :select, collection: -> { Post.subclasses } filter :id diff --git a/app/admin/user.rb b/app/admin/user.rb index ff4690e2..ada5346e 100644 --- a/app/admin/user.rb +++ b/app/admin/user.rb @@ -77,6 +77,6 @@ end end - permit_params *User.attribute_names, - members_attributes: Member.attribute_names + permit_params :username, :email, :phone, :postcode, :gender, + members_attributes: [:organization_id, :active, :manager] end diff --git a/app/helpers/active_admin_helper.rb b/app/helpers/active_admin_helper.rb new file mode 100644 index 00000000..8e43496a --- /dev/null +++ b/app/helpers/active_admin_helper.rb @@ -0,0 +1,8 @@ +module ActiveAdminHelper + def render_translations(attribute, joiner = " | ") + attribute.map do |locale, translation| + tag.strong("#{I18n.t("locales.#{locale}", locale: locale)}: ") + + tag.span(translation) + end.join(joiner).html_safe + end +end diff --git a/app/models/document.rb b/app/models/document.rb index 6cbb0a81..ff42de6c 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -1,6 +1,8 @@ class Document < ApplicationRecord belongs_to :documentable, polymorphic: true, optional: true + translates :title, :content + def self.terms_and_conditions where(label: "t&c", documentable_id: nil).first end diff --git a/app/views/devise/mailer/confirmation_instructions.ca.html.erb b/app/views/devise/mailer/confirmation_instructions.ca.html.erb deleted file mode 100644 index 3921f315..00000000 --- a/app/views/devise/mailer/confirmation_instructions.ca.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

    Benvingut <%= @email %>!

    - -

    Confirma el teu compte fent clic en el següent enllaç:

    - -

    <%= link_to 'Confirmar compte', confirmation_url(@resource, :confirmation_token => @token) %>

    diff --git a/app/views/devise/mailer/confirmation_instructions.es.html.erb b/app/views/devise/mailer/confirmation_instructions.es.html.erb deleted file mode 100644 index 2343f561..00000000 --- a/app/views/devise/mailer/confirmation_instructions.es.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

    ¡Bienvenido <%= @email %>!

    - -

    Confirma tu cuenta haciendo click en el siguiente link:

    - -

    <%= link_to 'Confirmar cuenta', confirmation_url(@resource, :confirmation_token => @token) %>

    diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb deleted file mode 100644 index 36670f91..00000000 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

    Welcome <%= @email %>!

    - -

    You can confirm your account email through the link below:

    - -

    <%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %>

    diff --git a/app/views/devise/mailer/reset_password_instructions.ca.html.erb b/app/views/devise/mailer/reset_password_instructions.ca.html.erb deleted file mode 100644 index bd2808b2..00000000 --- a/app/views/devise/mailer/reset_password_instructions.ca.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

    Hola <%= @resource.email %>!

    - -

    S'ha sol·licitat el canvi de la teva contrasenya. Pots canviar-la a travès del següent enllaç.

    - -

    <%= link_to 'Canviar contrasenya', edit_password_url(@resource, :reset_password_token => @token) %>

    - -

    Si tu no has sol·licitat el canvi de contrasenya, no facis cas d'aquest correu.

    -

    La teva contrasenya no canviarà fins que no facis clic a l'enllaç.

    diff --git a/app/views/devise/mailer/reset_password_instructions.es.html.erb b/app/views/devise/mailer/reset_password_instructions.es.html.erb deleted file mode 100644 index 1f5716d4..00000000 --- a/app/views/devise/mailer/reset_password_instructions.es.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

    Hola <%= @resource.email %>!

    - -

    Se ha solicitado el cambio de tu contraseña. Puedes cambiarlo a través del siguiente enlace.

    - -

    <%= link_to 'Cambiar mi contraseña', edit_password_url(@resource, :reset_password_token => @token) %>

    - -

    Si tu no has solicitado un cambio de contraseña ignora este mail.

    -

    Tu password no cambiará hasta que no accedas al link.

    diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb deleted file mode 100644 index 93de6d05..00000000 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

    Hello <%= @resource.email %>!

    - -

    Someone has requested a link to change your password. You can do this through the link below.

    - -

    <%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %>

    - -

    If you didn't request this, please ignore this email.

    -

    Your password won't change until you access the link above and create a new one.

    diff --git a/app/views/devise/mailer/unlock_instructions.ca.html.erb b/app/views/devise/mailer/unlock_instructions.ca.html.erb deleted file mode 100644 index c1a3ce62..00000000 --- a/app/views/devise/mailer/unlock_instructions.ca.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

    Hola <%= @resource.email %>!

    - -

    El teu compte ha estat bloquejat després de diversos intents d'entrada.

    - -

    Per desbloquejar el teu compte accedeix al següent enllaç:

    - -

    <%= link_to 'Desbloquejar compte', unlock_url(@resource, :unlock_token => @token) %>

    diff --git a/app/views/devise/mailer/unlock_instructions.es.html.erb b/app/views/devise/mailer/unlock_instructions.es.html.erb deleted file mode 100644 index 607993de..00000000 --- a/app/views/devise/mailer/unlock_instructions.es.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

    ¡Hola <%= @resource.email %>!

    - -

    Tu cuenta ha sido bloqueada después de varios intentos fallidos de acceso.

    - -

    Accede al siguiente link para desbloquear tu cuenta:

    - -

    <%= link_to 'Desbloquear mi cuenta', unlock_url(@resource, :unlock_token => @token) %>

    diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb deleted file mode 100644 index f59615fe..00000000 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

    Hello <%= @resource.email %>!

    - -

    Your account has been locked due to an excessive number of unsuccessful sign in attempts.

    - -

    Click the link below to unlock your account:

    - -

    <%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %>

    diff --git a/app/views/multi_transfers/steps/_set_params.html.erb b/app/views/multi_transfers/steps/_set_params.html.erb index 9b79dc87..bad1aa3d 100644 --- a/app/views/multi_transfers/steps/_set_params.html.erb +++ b/app/views/multi_transfers/steps/_set_params.html.erb @@ -10,9 +10,7 @@ input_html: { value: @transfer_hours, min: 0, - max: 20, - "data-rule-either-hours-minutes-informed" => "true", - "data-rule-range" => "[0,20]" + "data-rule-either-hours-minutes-informed" => "true" } %> <%= f.input :minutes, required: false, diff --git a/app/views/shared/_post.html.erb b/app/views/shared/_post.html.erb index bd56189f..20fe064a 100644 --- a/app/views/shared/_post.html.erb +++ b/app/views/shared/_post.html.erb @@ -64,7 +64,7 @@
    - <%= m post.rendered_description.to_html.html_safe %> + <%= m post.rendered_description.to_html %>
    diff --git a/app/views/transfers/new.html.erb b/app/views/transfers/new.html.erb index b5f7163a..b00a3379 100644 --- a/app/views/transfers/new.html.erb +++ b/app/views/transfers/new.html.erb @@ -11,9 +11,7 @@ as: :integer, input_html: { min: 0, - max: 20, - "data-rule-either-hours-minutes-informed" => "true", - "data-rule-range" => "[0,20]" + "data-rule-either-hours-minutes-informed" => "true" } %> <%= f.input :minutes, as: :integer, diff --git a/config/locales/en.yml b/config/locales/en.yml index fcec14fd..0f0ec74d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -19,7 +19,7 @@ en: created_at: Created updated_at: Updated inquiry: - is_group: Group inquiry + is_group: Group request offer: is_group: Group offer organization: @@ -95,8 +95,8 @@ en: one: Comment other: Comments inquiry: - one: Inquiry - other: Inquiries + one: Request + other: Requests offer: one: Offer other: Offers @@ -137,7 +137,7 @@ en: demographics: Demographics data global_activity: Global activity inactive_users: Inactive users - inquiry_public_link: Inquiries public link + inquiry_public_link: Requests public link last_login: Last login offer_public_link: Offers public link organizations: Organizations @@ -305,11 +305,11 @@ en: to: To inquiries: edit: - submit: Change inquiry + submit: Change request index: - new_inquiry: New inquiry + new_inquiry: New request new: - submit: Create inquiry + submit: Create request layouts: application: about: About TimeOverflow @@ -440,7 +440,7 @@ en: delete_reason: Are you sure to delete this comment? movements: Movements post_form: - group_inquiry: Is it a group inquiry? + group_inquiry: Is it a group request? group_offer: Is it a group offer? you_can_use: You can use simple_form: diff --git a/db/migrate/20230401114456_make_terms_translatable.rb b/db/migrate/20230401114456_make_terms_translatable.rb new file mode 100644 index 00000000..c03e9ed2 --- /dev/null +++ b/db/migrate/20230401114456_make_terms_translatable.rb @@ -0,0 +1,21 @@ +class MakeTermsTranslatable < ActiveRecord::Migration[6.1] + def up + add_column :documents, :title_translations, :jsonb, default: {}, null: false + add_column :documents, :content_translations, :jsonb, default: {}, null: false + Document.find_each do |doc| + doc.update_columns(title_translations: { es: doc[:title] }, content_translations: { es: doc[:content] }) + end + remove_column :documents, :title + remove_column :documents, :content + end + + def down + add_column :documents, :title, :text + add_column :documents, :content, :text + Document.find_each do |doc| + doc.update_columns(title: doc.title_translations["es"], content: doc.content_translations["es"]) + end + remove_column :documents, :title_translations + remove_column :documents, :content_translations + end +end diff --git a/db/structure.sql b/db/structure.sql index 427b1b36..7239a85a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -340,11 +340,11 @@ CREATE TABLE public.documents ( id integer NOT NULL, documentable_id integer, documentable_type character varying, - title text, - content text, label character varying, created_at timestamp without time zone, - updated_at timestamp without time zone + updated_at timestamp without time zone, + title_translations jsonb DEFAULT '{}'::jsonb NOT NULL, + content_translations jsonb DEFAULT '{}'::jsonb NOT NULL ); @@ -1367,6 +1367,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20210503201944'), ('20221016192111'), ('20230312231058'), -('20230314233504'); +('20230314233504'), +('20230401114456'); diff --git a/spec/helpers/active_admin_helper_spec.rb b/spec/helpers/active_admin_helper_spec.rb new file mode 100644 index 00000000..f7d0971d --- /dev/null +++ b/spec/helpers/active_admin_helper_spec.rb @@ -0,0 +1,8 @@ +RSpec.describe ActiveAdminHelper do + describe '#render_translations' do + it 'renders hash to HTML' do + attr_with_translations = { en: 'hi', es: 'hola' } + expect(helper.render_translations(attr_with_translations)).to eq("English: hi | Español: hola") + end + end +end From e6208cf3b80c68f0e594592370653786d4de1611 Mon Sep 17 00:00:00 2001 From: Marc Anguera Date: Sun, 2 Apr 2023 03:12:14 +0200 Subject: [PATCH 34/34] =?UTF-8?q?[UI/UX]=20some=20random=20small=20enhance?= =?UTF-8?q?ments=20=F0=9F=92=85=20(#679)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/user.rb | 1 + app/assets/stylesheets/application.scss | 10 +- .../stylesheets/application/member-card.scss | 7 - app/helpers/application_helper.rb | 2 +- app/views/inquiries/index.html.erb | 50 ++++--- app/views/inquiries/show.html.erb | 4 +- app/views/layouts/application.html.erb | 4 +- app/views/multi_transfers/step.html.erb | 8 +- app/views/offers/index.html.erb | 50 ++++--- app/views/offers/show.html.erb | 4 +- app/views/petitions/manage.html.erb | 88 ++++++------- app/views/shared/_post.html.erb | 2 +- app/views/shared/_post_actions.html.erb | 2 +- app/views/shared/_post_form.html.erb | 2 +- app/views/shared/_posts.html.erb | 10 +- app/views/terms/show.html.erb | 10 +- app/views/users/_member_card.html.erb | 2 +- app/views/users/index.html.erb | 50 ++++--- app/views/users/manage.html.erb | 123 +++++++++--------- app/views/users/show.html.erb | 2 +- 20 files changed, 198 insertions(+), 233 deletions(-) diff --git a/app/admin/user.rb b/app/admin/user.rb index ada5346e..2bec1c54 100644 --- a/app/admin/user.rb +++ b/app/admin/user.rb @@ -71,6 +71,7 @@ end column :entry_date column :member_uid + column :tag_list end end end diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 70a3b582..606f1168 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -11,12 +11,12 @@ html { } .content { - margin-bottom: 76px; + margin-bottom: 120px; } .actions-menu { - margin-bottom: 16px; - padding: 0 15px; + margin-bottom: 10px; + padding: 0 10px; @media(max-width: $screen-sm-min) { padding: 0; @@ -670,6 +670,10 @@ label[required]::after{ margin: 0 !important; } +.organization-logo { + padding-top: 120px; +} + .input__password-eye { display: flex; align-items: center; diff --git a/app/assets/stylesheets/application/member-card.scss b/app/assets/stylesheets/application/member-card.scss index c72c603e..6592e33f 100644 --- a/app/assets/stylesheets/application/member-card.scss +++ b/app/assets/stylesheets/application/member-card.scss @@ -37,13 +37,6 @@ } } - &__tags { - a { - margin-left: 4px; - color: white; - } - } - &__activity { font-size: 14px; color: #78adb9; diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 277101bb..c34d8186 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -30,7 +30,7 @@ def organization_logo return unless org && org.logo.attached? return if "#{controller_name}##{action_name}".in? %w(organizations#index pages#show) - content_tag(:div, class: "row") do + content_tag(:div, class: "row organization-logo") do image_tag(org.logo.variant(resize: "x200^"), class: 'img-responsive center-block') end end diff --git a/app/views/inquiries/index.html.erb b/app/views/inquiries/index.html.erb index 95d440ac..9da12537 100644 --- a/app/views/inquiries/index.html.erb +++ b/app/views/inquiries/index.html.erb @@ -1,38 +1,32 @@ -
    -
    -
    -

    - <%= Inquiry.model_name.human(count: :many) %> - <%= render "shared/show_filter_hint" %> -

    -
    +
    +
    +

    + <%= Inquiry.model_name.human(count: :many) %> + <%= render "shared/show_filter_hint" %> +

    -
    -
    - <%= render "shared/post_filters", base_path: inquiries_path %> +
    + <%= render "shared/post_filters", base_path: inquiries_path %> -
    - <% if current_user && current_organization && !params[:org] %> - - <% end %> -
    +
    + <% if current_user && current_organization && !params[:org] %> + + <% end %>
    -
    -
    -
    - <%= render "shared/posts", posts: @inquiries %> -
    +
    +
    + <%= render "shared/posts", posts: @inquiries %>
    diff --git a/app/views/inquiries/show.html.erb b/app/views/inquiries/show.html.erb index 388c1528..f9c651b4 100644 --- a/app/views/inquiries/show.html.erb +++ b/app/views/inquiries/show.html.erb @@ -1,8 +1,8 @@ <% if @inquiry.organization == current_organization %> -

    +

    <% if admin? or @inquiry.user == current_user %> <%= render 'shared/post_actions', post: @inquiry %> <% end %> -

    +
    <% end %> <%= render "shared/post", post: @inquiry %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d97dea28..41e21caf 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,7 +17,9 @@ <%= render 'navbar' %>
    <%= render 'layouts/messages' unless devise_controller? %> - <%= yield %> +
    + <%= yield %> +
    <%= organization_logo %>