From 1c0924fe31064df64da4f4905683041f819c0da1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 01:44:30 +0000 Subject: [PATCH 01/42] Bump rails from 6.1.7.6 to 6.1.7.7 Bumps [rails](https://github.com/rails/rails) from 6.1.7.6 to 6.1.7.7. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v6.1.7.6...v6.1.7.7) --- updated-dependencies: - dependency-name: rails dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 112 +++++++++++++++++++++++++-------------------------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Gemfile b/Gemfile index 4e87cca0..653aa542 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.2.3" # TODO: use file: '.tool-versions' when heroku supports it. (bundler >= 2.5) -gem "rails", "6.1.7.6" +gem "rails", "6.1.7.7" # Production app server gem "puma", "~> 5" diff --git a/Gemfile.lock b/Gemfile.lock index 47f889a5..ea4b767c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,62 +24,62 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + actioncable (6.1.7.7) + actionpack (= 6.1.7.7) + activesupport (= 6.1.7.7) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + actionmailbox (6.1.7.7) + actionpack (= 6.1.7.7) + activejob (= 6.1.7.7) + activerecord (= 6.1.7.7) + activestorage (= 6.1.7.7) + activesupport (= 6.1.7.7) mail (>= 2.7.1) - actionmailer (6.1.7.6) - actionpack (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activesupport (= 6.1.7.6) + actionmailer (6.1.7.7) + actionpack (= 6.1.7.7) + actionview (= 6.1.7.7) + activejob (= 6.1.7.7) + activesupport (= 6.1.7.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.6) - actionview (= 6.1.7.6) - activesupport (= 6.1.7.6) + actionpack (6.1.7.7) + actionview (= 6.1.7.7) + activesupport (= 6.1.7.7) 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.7.6) - actionpack (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + actiontext (6.1.7.7) + actionpack (= 6.1.7.7) + activerecord (= 6.1.7.7) + activestorage (= 6.1.7.7) + activesupport (= 6.1.7.7) nokogiri (>= 1.8.5) - actionview (6.1.7.6) - activesupport (= 6.1.7.6) + actionview (6.1.7.7) + activesupport (= 6.1.7.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.6) - activesupport (= 6.1.7.6) + activejob (6.1.7.7) + activesupport (= 6.1.7.7) globalid (>= 0.3.6) - activemodel (6.1.7.6) - activesupport (= 6.1.7.6) - activerecord (6.1.7.6) - activemodel (= 6.1.7.6) - activesupport (= 6.1.7.6) + activemodel (6.1.7.7) + activesupport (= 6.1.7.7) + activerecord (6.1.7.7) + activemodel (= 6.1.7.7) + activesupport (= 6.1.7.7) activerecord-import (1.4.0) activerecord (>= 4.2) - activestorage (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activesupport (= 6.1.7.6) + activestorage (6.1.7.7) + actionpack (= 6.1.7.7) + activejob (= 6.1.7.7) + activerecord (= 6.1.7.7) + activesupport (= 6.1.7.7) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.6) + activesupport (6.1.7.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -370,7 +370,7 @@ GEM puma (5.6.8) nio4r (~> 2.0) racc (1.7.3) - rack (2.2.8) + rack (2.2.8.1) rack-mini-profiler (2.3.3) rack (>= 1.2.0) rack-protection (3.2.0) @@ -380,20 +380,20 @@ GEM rack rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.6) - actioncable (= 6.1.7.6) - actionmailbox (= 6.1.7.6) - actionmailer (= 6.1.7.6) - actionpack (= 6.1.7.6) - actiontext (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activemodel (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + rails (6.1.7.7) + actioncable (= 6.1.7.7) + actionmailbox (= 6.1.7.7) + actionmailer (= 6.1.7.7) + actionpack (= 6.1.7.7) + actiontext (= 6.1.7.7) + actionview (= 6.1.7.7) + activejob (= 6.1.7.7) + activemodel (= 6.1.7.7) + activerecord (= 6.1.7.7) + activestorage (= 6.1.7.7) + activesupport (= 6.1.7.7) bundler (>= 1.15.0) - railties (= 6.1.7.6) + railties (= 6.1.7.7) sprockets-rails (>= 2.0.0) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) @@ -402,9 +402,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + railties (6.1.7.7) + actionpack (= 6.1.7.7) + activesupport (= 6.1.7.7) method_source rake (>= 12.2) thor (~> 1.0) @@ -520,7 +520,7 @@ GEM temple (0.8.2) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.3.0) + thor (1.3.1) thread_safe (0.3.6) tilt (2.0.10) timeout (0.4.1) @@ -588,7 +588,7 @@ DEPENDENCIES pronto-rubocop puma (~> 5) rack-mini-profiler (~> 2.0) - rails (= 6.1.7.6) + rails (= 6.1.7.7) rspec-rails rubocop rubocop-faker From 4aa19d91c3a5e84fd576d3b50dbf32249059c5ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 01:39:07 +0000 Subject: [PATCH 02/42] Bump rack from 2.2.8 to 2.2.8.1 Bumps [rack](https://github.com/rack/rack) from 2.2.8 to 2.2.8.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/v2.2.8...v2.2.8.1) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 47f889a5..66001248 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -370,7 +370,7 @@ GEM puma (5.6.8) nio4r (~> 2.0) racc (1.7.3) - rack (2.2.8) + rack (2.2.8.1) rack-mini-profiler (2.3.3) rack (>= 1.2.0) rack-protection (3.2.0) From d97fb135b471eab44dfd6836d3ec29483a7692c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 23 Mar 2024 20:43:40 +0000 Subject: [PATCH 03/42] Bump webpack-dev-middleware from 5.3.3 to 5.3.4 Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4. - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases) - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4) --- updated-dependencies: - dependency-name: webpack-dev-middleware dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 218f5baa..20c766b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7173,9 +7173,9 @@ webpack-cli@^3.3.12: yargs "^13.3.2" webpack-dev-middleware@^5.3.1: - version "5.3.3" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz#efae67c2793908e7311f1d9b06f2a08dcc97e51f" - integrity sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA== + version "5.3.4" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz#eb7b39281cbce10e104eb2b8bf2b63fce49a3517" + integrity sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q== dependencies: colorette "^2.0.10" memfs "^3.4.3" From a15abe6201aa47f10e531afd3c3b1b1052b08381 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:05:53 +0000 Subject: [PATCH 04/42] Bump rdoc from 6.6.2 to 6.6.3.1 Bumps [rdoc](https://github.com/ruby/rdoc) from 6.6.2 to 6.6.3.1. - [Release notes](https://github.com/ruby/rdoc/releases) - [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rdoc/compare/v6.6.2...v6.6.3.1) --- updated-dependencies: - dependency-name: rdoc dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ea4b767c..3fa2ea39 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -413,7 +413,7 @@ GEM rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) - rdoc (6.6.2) + rdoc (6.6.3.1) psych (>= 4.0.0) regexp_parser (2.8.2) reline (0.4.2) From 208097335aa7148fc79f4443c98b1af2b29a77de Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:40:12 -0700 Subject: [PATCH 05/42] added happy path test for updating email template --- features/email_template.feature | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/features/email_template.feature b/features/email_template.feature index 36e96d97..2a81a311 100644 --- a/features/email_template.feature +++ b/features/email_template.feature @@ -63,3 +63,11 @@ Scenario: Editing email template to have blank body or to field displays flash e When I fill in TinyMCE email form with "" And I press "Submit" Then I should see "Failed to save Welcome Email template: Body cannot be blank" + +Scenario: Updating email template with valid parameters succeeds + Given I am on the email templates index + And I follow "Welcome Email" + And I fill in "email_template_to" with "abc@berkeley.edu" + And I fill in TinyMCE email form with "ABC" + And I press "Submit" + Then I should see "Updated Welcome Email template successfully" \ No newline at end of file From 722bc6c4d3bc4f3428c396122cad36cad0703d9c Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:48:13 -0700 Subject: [PATCH 06/42] clean up: remove commented lines --- app/mailers/teacher_mailer.rb | 1 - app/views/main/_deny_modal.html.erb | 9 --------- 2 files changed, 10 deletions(-) diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index a1bd199c..706a49d6 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -59,7 +59,6 @@ def liquid_assigns base_rules = { bjc_password: Rails.application.secrets[:bjc_password], piazza_password: Rails.application.secrets[:piazza_password], - # TODO: Review if below two are needed, or can they be refractored? denial_reason: @denial_reason, request_reason: @request_reason } diff --git a/app/views/main/_deny_modal.html.erb b/app/views/main/_deny_modal.html.erb index 92957bdd..22ad38be 100644 --- a/app/views/main/_deny_modal.html.erb +++ b/app/views/main/_deny_modal.html.erb @@ -11,15 +11,6 @@ <%= hidden_field_tag :action_type, '', class: "form-control action-type" %> <%= label_tag 'action_reason', 'Reason', class: 'control-label' %> <%= text_field_tag :action_reason_placeholder, '', class: "form-control action-reason", id: "action_reason" %> -
<%= check_box_tag :skip_email, 'skip_email', false, class: 'form-check-input' %> <%= label_tag 'skip_email', 'Skip email notification?', class: 'form-check-label' %> From 630a8a2385736a4df44b1fcbc49230a119c3e80b Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:52:21 -0700 Subject: [PATCH 07/42] removed duplicate code from merge conflict failed resolution --- features/step_definitions/admin_steps.rb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/features/step_definitions/admin_steps.rb b/features/step_definitions/admin_steps.rb index aa21bee4..40e85d69 100644 --- a/features/step_definitions/admin_steps.rb +++ b/features/step_definitions/admin_steps.rb @@ -111,23 +111,3 @@ last_email = ActionMailer::Base.deliveries.last last_email.should eq nil end - -Then(/I send a form submission email to both admin and teacher with email "(.*)"/) do |teacher_email| - # this step definition assumes that the admin form submission email gets - # sent first, as this is how it is implemented in the code - admin_fs_email = ActionMailer::Base.deliveries[-2] - teacher_fs_email = ActionMailer::Base.deliveries.last - admin_fs_email.subject.should eq "Form Submission" - admin_fs_email.to[0].should eq "lmock@berkeley.edu" - admin_fs_email.to[1].should eq "contact@bjc.berkeley.edu" - admin_fs_email.body.encoded.should include "Here is the information that was submitted" - teacher_fs_email.subject.should eq "Teacher Form Submission" - teacher_fs_email.to[0].should eq teacher_email - teacher_fs_email.body.encoded.should include "Here is the information that was submitted" -end - -Then(/I attach the csv "([^"]*)"$/) do |path| - Capybara.ignore_hidden_elements = false - attach_file("file", File.expand_path(path)) - Capybara.ignore_hidden_elements = true -end From def37fe0be01ce24ace3f0fd5c1ca15b5847c75f Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Fri, 5 Apr 2024 11:32:58 -0700 Subject: [PATCH 08/42] Tidy Whitespace / hash creation --- app/controllers/main_controller.rb | 4 +--- app/views/teachers/_form.html.erb | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 1441cbe1..1f3a343d 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -14,7 +14,6 @@ def index elsif is_teacher? && !current_user.validated? message = "Your application is #{mapped_application_status(current_user.application_status)}. You may update your information. Please check your email for more information." # Both `info_needed` and `not_reviewed` flash message should be flash[:warn] style - # flash[:warn] for yellow warning message in bootstrap style redirect_to edit_teacher_path(current_user.id), warn: message # if this user is denied, redirect to new else @@ -35,8 +34,7 @@ def mapped_application_status(status) status_map = { "info_needed" => "requested to be updated", "not_reviewed" => "not reviewed" - } - # Fetch the mapped status if present; otherwise, return the original status + }.with_indifferent_access status_map.fetch(status, status) end end diff --git a/app/views/teachers/_form.html.erb b/app/views/teachers/_form.html.erb index 8f16299c..5397d0ee 100644 --- a/app/views/teachers/_form.html.erb +++ b/app/views/teachers/_form.html.erb @@ -186,7 +186,4 @@ status ONLY IF the person viewing this page is an admin. %> } } - - - From 7472de2f449cd75151d46f0a13b18034c1b856e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 20:33:40 +0000 Subject: [PATCH 09/42] Bump follow-redirects from 1.15.4 to 1.15.6 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 218f5baa..bcc5729e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3305,9 +3305,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.15.4" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf" - integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== for-in@^1.0.2: version "1.0.2" From c8077c57653602b3c078e91eb1ac4959a3ed5d12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:14:52 +0000 Subject: [PATCH 10/42] Bump express from 4.18.2 to 4.19.2 Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/yarn.lock b/yarn.lock index 218f5baa..a2386689 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1773,13 +1773,13 @@ bn.js@^5.0.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== +body-parser@1.20.2: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== dependencies: bytes "3.1.2" - content-type "~1.0.4" + content-type "~1.0.5" debug "2.6.9" depd "2.0.0" destroy "1.2.0" @@ -1787,7 +1787,7 @@ body-parser@1.20.1: iconv-lite "0.4.24" on-finished "2.4.1" qs "6.11.0" - raw-body "2.5.1" + raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" @@ -2335,7 +2335,7 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-type@~1.0.4: +content-type@~1.0.4, content-type@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== @@ -2350,10 +2350,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" + integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== copy-concurrently@^1.0.0: version "1.0.5" @@ -3113,16 +3113,16 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: homedir-polyfill "^1.0.1" express@^4.17.3: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.19.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" + integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.2" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.6.0" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" @@ -5919,10 +5919,10 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" From ef2d3c4c019d3cb51b3fd94d8dc9dd8bd3d4d7e1 Mon Sep 17 00:00:00 2001 From: razztech <41014369+razztech@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:53:58 -0700 Subject: [PATCH 11/42] Removed empty lines --- app/views/teachers/_form.html.erb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/views/teachers/_form.html.erb b/app/views/teachers/_form.html.erb index 8f16299c..5397d0ee 100644 --- a/app/views/teachers/_form.html.erb +++ b/app/views/teachers/_form.html.erb @@ -186,7 +186,4 @@ status ONLY IF the person viewing this page is an admin. %> } } - - - From c40138a9f7706054bda0fe11b6633d233601fd9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:18:37 +0000 Subject: [PATCH 12/42] Bump tar from 6.1.11 to 6.2.1 Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.11 to 6.2.1. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v6.1.11...v6.2.1) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 28d6981d..9499a1ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4560,6 +4560,11 @@ minipass@^3.0.0, minipass@^3.1.1: dependencies: yallist "^4.0.0" +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + minizlib@^2.1.1: version "2.1.2" resolved "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz" @@ -6765,13 +6770,13 @@ tapable@^1.0.0, tapable@^1.1.3: integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== tar@^6.0.2: - version "6.1.11" - resolved "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" - minipass "^3.0.0" + minipass "^5.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" From ff543d6be3c86d62becbdf5b79e5fcc879b6be55 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:30:39 -0700 Subject: [PATCH 13/42] Update email_template.feature Fix cucumber test -- note that error messages have been standardized in the application to have the common format "An error occured: ..." --- features/email_template.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/email_template.feature b/features/email_template.feature index d0d8e008..28a3c89a 100644 --- a/features/email_template.feature +++ b/features/email_template.feature @@ -62,7 +62,7 @@ Scenario: Editing email template to have blank body or to field displays flash e Then I should see "An error occurred: To can't be blank" When I fill in TinyMCE email form with "" And I press "Submit" - Then I should see "Failed to save Welcome Email template: Body cannot be blank" + Then I should see "An error occured: Body can't be blank" Scenario: Updating email template with valid parameters succeeds Given I am on the email templates index From 2e1c1d15fa64d488253d548b89cbe5224ea20551 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:45:05 -0700 Subject: [PATCH 14/42] Update schools_controller.rb remove debugger --- app/controllers/schools_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/schools_controller.rb b/app/controllers/schools_controller.rb index 127fb8ca..500f6ca0 100644 --- a/app/controllers/schools_controller.rb +++ b/app/controllers/schools_controller.rb @@ -44,7 +44,6 @@ def edit def update @school = School.find(params[:id]) @school.assign_attributes(school_params) - debugger if @school.save flash[:success] = "Updated #{@school.name} successfully." redirect_to school_path(@school) From d58eda9cea0429e02df5b595fbfb2078b201bc00 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:45:42 -0700 Subject: [PATCH 15/42] fix cucumber tests --- app/controllers/email_templates_controller.rb | 2 +- app/controllers/teachers_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/email_templates_controller.rb b/app/controllers/email_templates_controller.rb index 0ee2bcc1..85c02069 100644 --- a/app/controllers/email_templates_controller.rb +++ b/app/controllers/email_templates_controller.rb @@ -36,7 +36,7 @@ def create flash[:success] = "Created #{@email_template.title} successfully." redirect_to email_templates_path else - flash.now[:alert] = "Failed to submit information: #{@email_template.errors.full_messages.join(", ")}" + flash.now[:alert] = "An error occurred: #{@email_template.errors.full_messages.join(", ")}" render "new" end end diff --git a/app/controllers/teachers_controller.rb b/app/controllers/teachers_controller.rb index fd167eab..9c923f17 100644 --- a/app/controllers/teachers_controller.rb +++ b/app/controllers/teachers_controller.rb @@ -65,7 +65,7 @@ def create if @school.new_record? @school = School.new(school_params) unless @school.save - flash[:alert] = "An error occurred! #{@school.errors.full_messages.join(', ')}" + flash[:alert] = "An error occurred: #{@school.errors.full_messages.join(', ')}" render "new" && return end end From 838c4c02f1d096c099af3b02c84a5ebf214283f8 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:47:07 -0700 Subject: [PATCH 16/42] change new --> edit redirect for update school failure --- app/controllers/teachers_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/teachers_controller.rb b/app/controllers/teachers_controller.rb index 9c923f17..886ccc89 100644 --- a/app/controllers/teachers_controller.rb +++ b/app/controllers/teachers_controller.rb @@ -102,7 +102,7 @@ def update @school.update(school_params) if school_params unless @school.save flash[:alert] = "An error occurred: #{@school.errors.full_messages.join(', ')}" - render "new" && return + render "edit" && return end @teacher.school = @school end From b1fe2d5e9317e0c839496fb6d754e20be83bd893 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:49:44 -0700 Subject: [PATCH 17/42] actually fixed it now --- app/controllers/email_templates_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/email_templates_controller.rb b/app/controllers/email_templates_controller.rb index 85c02069..45f63b99 100644 --- a/app/controllers/email_templates_controller.rb +++ b/app/controllers/email_templates_controller.rb @@ -18,7 +18,7 @@ def update flash[:success] = "Updated #{@email_template.title} template successfully." redirect_to email_templates_path else - flash.now[:alert] = "Failed to save #{@email_template.title} template: #{@email_template.errors.full_messages.join(", ")}" + flash.now[:alert] = "An error occured: #{@email_template.errors.full_messages.join(", ")}" render "edit" end end From 66eb04c604dd74620e796ef580de1af4fa8d53ab Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:51:01 -0700 Subject: [PATCH 18/42] it turns out I don't know how to spell the word 'occured' --- features/email_template.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/email_template.feature b/features/email_template.feature index 28a3c89a..3da35895 100644 --- a/features/email_template.feature +++ b/features/email_template.feature @@ -62,7 +62,7 @@ Scenario: Editing email template to have blank body or to field displays flash e Then I should see "An error occurred: To can't be blank" When I fill in TinyMCE email form with "" And I press "Submit" - Then I should see "An error occured: Body can't be blank" + Then I should see "An error occurred: Body can't be blank" Scenario: Updating email template with valid parameters succeeds Given I am on the email templates index From 6e46e5cd0159cf66ef4b1cb05b415952bec0a8f2 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:12:12 -0700 Subject: [PATCH 19/42] fixed another myterious cucumber test bug --- app/controllers/email_templates_controller.rb | 2 +- features/teacher_info_request.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/email_templates_controller.rb b/app/controllers/email_templates_controller.rb index 45f63b99..76a78b65 100644 --- a/app/controllers/email_templates_controller.rb +++ b/app/controllers/email_templates_controller.rb @@ -18,7 +18,7 @@ def update flash[:success] = "Updated #{@email_template.title} template successfully." redirect_to email_templates_path else - flash.now[:alert] = "An error occured: #{@email_template.errors.full_messages.join(", ")}" + flash.now[:alert] = "An error occurred: #{@email_template.errors.full_messages.join(", ")}" render "edit" end end diff --git a/features/teacher_info_request.feature b/features/teacher_info_request.feature index 367d60a4..ca698981 100644 --- a/features/teacher_info_request.feature +++ b/features/teacher_info_request.feature @@ -25,7 +25,7 @@ Feature: Request additional information for teacher application And I should see "Request Info from Joseph Mamoa" And I fill in "request_reason" with "Please provide more details on your teaching experience" And I press "Submit" - Then I can send a request info email + Then I send a request info email And I follow "Logout" Given I am on the BJC home page From f9388fc79b881b1614f65656e4c141c9645d486a Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:17:23 -0700 Subject: [PATCH 20/42] remove country from teachers table --- app/views/schools/index.html.erb | 1 - app/views/teachers/_table_headers.erb | 1 - app/views/teachers/_teacher.erb | 3 --- 3 files changed, 5 deletions(-) diff --git a/app/views/schools/index.html.erb b/app/views/schools/index.html.erb index 103478dc..ae0d33fa 100644 --- a/app/views/schools/index.html.erb +++ b/app/views/schools/index.html.erb @@ -6,7 +6,6 @@ Name Location - Country URL Teachers Grade Level diff --git a/app/views/teachers/_table_headers.erb b/app/views/teachers/_table_headers.erb index f519ec1e..8c070619 100644 --- a/app/views/teachers/_table_headers.erb +++ b/app/views/teachers/_table_headers.erb @@ -4,6 +4,5 @@ Status Snap! School -Country Approved? Created diff --git a/app/views/teachers/_teacher.erb b/app/views/teachers/_teacher.erb index beed2b95..7523cca7 100644 --- a/app/views/teachers/_teacher.erb +++ b/app/views/teachers/_teacher.erb @@ -27,9 +27,6 @@ <%= link_to(teacher.school.name, school_path(teacher.school)) %> <%= teacher.school.location %> - - <%= teacher.school.country %> - <%= teacher.short_application_status %> From 8ca38723be52e72970f4d5783b59fc95a7bcde0a Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:18:50 -0700 Subject: [PATCH 21/42] removed one unnecessary deletion --- app/views/schools/index.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/schools/index.html.erb b/app/views/schools/index.html.erb index ae0d33fa..103478dc 100644 --- a/app/views/schools/index.html.erb +++ b/app/views/schools/index.html.erb @@ -6,6 +6,7 @@ Name Location + Country URL Teachers Grade Level From 05df57cbc122e105c7c238b449ce53376a4dde88 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:21:52 -0700 Subject: [PATCH 22/42] update location method to display country --- app/models/school.rb | 2 +- app/views/teachers/_teacher_info.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/school.rb b/app/models/school.rb index f33f4c8b..b07a7047 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -61,7 +61,7 @@ def website end def location - "#{city}, #{state}" + "#{city}, #{state}, #{country}" end # TODO: Consider renaming this. diff --git a/app/views/teachers/_teacher_info.html.erb b/app/views/teachers/_teacher_info.html.erb index 38622fc5..6a08e630 100644 --- a/app/views/teachers/_teacher_info.html.erb +++ b/app/views/teachers/_teacher_info.html.erb @@ -74,7 +74,7 @@
School Location:
- <%= "#{teacher.school.location}, #{teacher.school.country}" %> + <%= "#{teacher.school.location}" %>
From 38b2ce1871a35c318bef7bf890a6ce9c76ac7486 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:25:58 -0700 Subject: [PATCH 23/42] update selectize options --- app/models/school.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/school.rb b/app/models/school.rb index b07a7047..6a15ad62 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -78,11 +78,11 @@ def display_grade_level end def selectize_options - [name_location, to_json(only: [:id, :name, :city, :state, :website]) ] + [name_location, to_json(only: [:id, :name, :city, :state, :country, :website]) ] end def name_location - "#{name} (#{city}, #{state})" + "#{name} (#{city}, #{state}, #{country})" end def update_gps_data From 8f831eb05a3a0ae60a676505006e82ad42ae4a90 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:28:46 -0700 Subject: [PATCH 24/42] revert placeholder --- app/views/schools/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/schools/_form.html.erb b/app/views/schools/_form.html.erb index b0b3a37e..1d911cee 100644 --- a/app/views/schools/_form.html.erb +++ b/app/views/schools/_form.html.erb @@ -2,7 +2,7 @@
<%= f.label :name, "School Name", class: "label-required" %> - <%= f.text_field :name, placeholder: 'Name of School', class: 'form-control', + <%= f.text_field :name, placeholder: 'UC Berkeley', class: 'form-control', required: false, id: 'school_name' %>
From fb9e87742532dc68fed65583c1b966e3a86057e7 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:21:52 -0700 Subject: [PATCH 25/42] update location method to display country --- app/models/school.rb | 2 +- app/views/teachers/_teacher_info.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/school.rb b/app/models/school.rb index f33f4c8b..b07a7047 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -61,7 +61,7 @@ def website end def location - "#{city}, #{state}" + "#{city}, #{state}, #{country}" end # TODO: Consider renaming this. diff --git a/app/views/teachers/_teacher_info.html.erb b/app/views/teachers/_teacher_info.html.erb index 38622fc5..6a08e630 100644 --- a/app/views/teachers/_teacher_info.html.erb +++ b/app/views/teachers/_teacher_info.html.erb @@ -74,7 +74,7 @@
School Location:
- <%= "#{teacher.school.location}, #{teacher.school.country}" %> + <%= "#{teacher.school.location}" %>
From 4cf6fbc746a93731082c4b49146de84ed854d70a Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:25:58 -0700 Subject: [PATCH 26/42] update selectize options --- app/models/school.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/school.rb b/app/models/school.rb index b07a7047..6a15ad62 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -78,11 +78,11 @@ def display_grade_level end def selectize_options - [name_location, to_json(only: [:id, :name, :city, :state, :website]) ] + [name_location, to_json(only: [:id, :name, :city, :state, :country, :website]) ] end def name_location - "#{name} (#{city}, #{state})" + "#{name} (#{city}, #{state}, #{country})" end def update_gps_data From eeea4caa2dcca937fe2d5074a94d89c8c072a51a Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:53:15 -0700 Subject: [PATCH 27/42] add back teachers to table to prevent cucumber bugs --- app/views/teachers/_table_headers.erb | 1 + app/views/teachers/_teacher.erb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/views/teachers/_table_headers.erb b/app/views/teachers/_table_headers.erb index 8c070619..f519ec1e 100644 --- a/app/views/teachers/_table_headers.erb +++ b/app/views/teachers/_table_headers.erb @@ -4,5 +4,6 @@ Status Snap! School +Country Approved? Created diff --git a/app/views/teachers/_teacher.erb b/app/views/teachers/_teacher.erb index 7523cca7..beed2b95 100644 --- a/app/views/teachers/_teacher.erb +++ b/app/views/teachers/_teacher.erb @@ -27,6 +27,9 @@ <%= link_to(teacher.school.name, school_path(teacher.school)) %> <%= teacher.school.location %> + + <%= teacher.school.country %> + <%= teacher.short_application_status %> From fa97d32051cefd796433c41f61d61d2709dd5301 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:30:11 -0700 Subject: [PATCH 28/42] make search_list change --- app/controllers/schools_controller.rb | 2 +- app/models/school.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/schools_controller.rb b/app/controllers/schools_controller.rb index 500f6ca0..191191f5 100644 --- a/app/controllers/schools_controller.rb +++ b/app/controllers/schools_controller.rb @@ -12,7 +12,7 @@ def show end def search - School.all.collect { |school| ["#{school.name}, #{school.country}, #{school.city}, #{school.state}", school.name] } + School.search_list end def create diff --git a/app/models/school.rb b/app/models/school.rb index 6a15ad62..2d12c61e 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -101,6 +101,18 @@ def maps_marker_data } end + def format_school(data) + name, city, state, country = data + country_str = country == "US" ? "" : ", #{country}" + "#{name} (#{city}, #{state}#{country_str})" + end + + def self.search_list + School.pluck(:name, :city, :state, :country).map do |data| + format_school(data) + end + end + def self.grade_level_options School.grade_levels.map { |key, _val| [key.to_s.titlecase, key] } end From c027698129c2f92211f7bdb0535808ff9704c800 Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:58:18 -0700 Subject: [PATCH 29/42] added unique school params and DRY out code --- app/controllers/concerns/school_params.rb | 17 +++++++++++++++++ app/controllers/schools_controller.rb | 7 ++----- app/controllers/teachers_controller.rb | 9 +++------ 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 app/controllers/concerns/school_params.rb diff --git a/app/controllers/concerns/school_params.rb b/app/controllers/concerns/school_params.rb new file mode 100644 index 00000000..5bb01362 --- /dev/null +++ b/app/controllers/concerns/school_params.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module SchoolParams + private + def unique_school_params + { + name: school_params[:name], + country: school_params[:country], + city: school_params[:city], + state: school_params[:state] + } + end + + def school_params + params.require(:school).permit(:name, :country, :city, :state, :website, :grade_level, :school_type, :country, { tags: [] }, :nces_id) + end +end diff --git a/app/controllers/schools_controller.rb b/app/controllers/schools_controller.rb index 191191f5..ecdbfc37 100644 --- a/app/controllers/schools_controller.rb +++ b/app/controllers/schools_controller.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class SchoolsController < ApplicationController + include SchoolParams before_action :require_admin def index @@ -16,7 +17,7 @@ def search end def create - @school = School.find_by(name: school_params[:name], country: school_params[:country], city: school_params[:city], state: school_params[:state]) + @school = School.find_by(**unique_school_params) if @school @school.assign_attributes(school_params) else @@ -64,10 +65,6 @@ def destroy end private - def school_params - params.require(:school).permit(:name, :country, :city, :state, :website, :grade_level, :school_type, :country, { tags: [] }, :nces_id) - end - def load_ordered_schools @ordered_schools ||= School.all.order(:name) end diff --git a/app/controllers/teachers_controller.rb b/app/controllers/teachers_controller.rb index 886ccc89..ec6cd27e 100644 --- a/app/controllers/teachers_controller.rb +++ b/app/controllers/teachers_controller.rb @@ -6,6 +6,7 @@ require "activerecord-import" class TeachersController < ApplicationController + include SchoolParams include CsvProcess before_action :load_pages, only: [:new, :create, :edit, :update] @@ -63,6 +64,7 @@ def create load_school if @school.new_record? + return unless params[:school] @school = School.new(school_params) unless @school.save flash[:alert] = "An error occurred: #{@school.errors.full_messages.join(', ')}" @@ -205,7 +207,7 @@ def load_school if teacher_params[:school_id].present? @school ||= School.find(teacher_params[:school_id]) end - @school ||= School.find_or_create_by(name: school_params[:name], city: school_params[:city], country: school_params[:country], state: school_params[:state]) + @school ||= School.find_or_create_by(**unique_school_params) end def teacher_params @@ -218,11 +220,6 @@ def teacher_params params.require(:teacher).permit(*teacher_attributes) end - def school_params - return unless params[:school] - params.require(:school).permit(:name, :country, :city, :state, :website, :grade_level, :school_type) - end - def omniauth_data @omniauth_data ||= session[:auth_data]&.slice("first_name", "last_name", "email") end From f41d0b94367877c204c3a4840e646fce02251e9c Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 18:01:30 -0700 Subject: [PATCH 30/42] converted valid states list using country gem --- app/models/school.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/school.rb b/app/models/school.rb index 2d12c61e..040ddbd9 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -26,8 +26,7 @@ # class School < ApplicationRecord - VALID_STATES = [ "AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY"].freeze - + VALID_STATES = ISO3166::Country['US'].subdivisions.keys.freeze validates :name, :city, :website, :country, presence: true validates :country, inclusion: { in: ISO3166::Country.all.map(&:alpha2), message: "%{value} is not a valid country" } validates :state, presence: true, if: -> { country == "US" } From 1f682da9753058c0d8b1353344f74896334ab45c Mon Sep 17 00:00:00 2001 From: Arush Chhatrapati <65872167+ArushC@users.noreply.github.com> Date: Fri, 12 Apr 2024 18:02:34 -0700 Subject: [PATCH 31/42] fixed rubocop --- app/models/school.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/school.rb b/app/models/school.rb index 040ddbd9..b51b546c 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -26,7 +26,7 @@ # class School < ApplicationRecord - VALID_STATES = ISO3166::Country['US'].subdivisions.keys.freeze + VALID_STATES = ISO3166::Country["US"].subdivisions.keys.freeze validates :name, :city, :website, :country, presence: true validates :country, inclusion: { in: ISO3166::Country.all.map(&:alpha2), message: "%{value} is not a valid country" } validates :state, presence: true, if: -> { country == "US" } From 22df60190abcefaa5466c73f4f76694f22923607 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 22 Apr 2024 17:04:32 -0700 Subject: [PATCH 32/42] Update app/models/school.rb --- app/models/school.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/school.rb b/app/models/school.rb index b51b546c..ac1ae256 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -60,7 +60,8 @@ def website end def location - "#{city}, #{state}, #{country}" + country_text = country == "US" ? '' : ", #{country}" + "#{city}, #{state}#{country_text}" end # TODO: Consider renaming this. From a2bf6e1230eb051591e356999e591c0c14b07cd8 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 22 Apr 2024 17:04:52 -0700 Subject: [PATCH 33/42] Update app/views/schools/_form.html.erb --- app/views/schools/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/schools/_form.html.erb b/app/views/schools/_form.html.erb index 1d911cee..4f23165d 100644 --- a/app/views/schools/_form.html.erb +++ b/app/views/schools/_form.html.erb @@ -9,7 +9,7 @@
<%= f.label :city, class: "label-required", for: "school_city" %> - <%= f.text_field :city, placeholder: 'Name of City', class: 'form-control', + <%= f.text_field :city, placeholder: 'Berkeley', class: 'form-control', required: false, id: 'school_city' %>
From 875b65b49a93d7cdbbd552ac7f331844eb38cbcb Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 22 Apr 2024 17:05:30 -0700 Subject: [PATCH 34/42] Update app/views/schools/show.html.erb --- app/views/schools/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/schools/show.html.erb b/app/views/schools/show.html.erb index 5a579716..4a179b3a 100644 --- a/app/views/schools/show.html.erb +++ b/app/views/schools/show.html.erb @@ -18,7 +18,7 @@
Location
- <%= "#{@school.location}, #{@school.country}" %> + <%= @school.location %>
From 53fcb0b4074fed403788d6fb3759608ae0599990 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 22 Apr 2024 17:05:43 -0700 Subject: [PATCH 35/42] Update app/views/teachers/_table_headers.erb --- app/views/teachers/_table_headers.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/teachers/_table_headers.erb b/app/views/teachers/_table_headers.erb index f519ec1e..8c070619 100644 --- a/app/views/teachers/_table_headers.erb +++ b/app/views/teachers/_table_headers.erb @@ -4,6 +4,5 @@ Status Snap! School -Country Approved? Created From eb884a92be51f422d613ea3b136a6817f19c367a Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 22 Apr 2024 17:05:58 -0700 Subject: [PATCH 36/42] Update app/views/teachers/_teacher.erb --- app/views/teachers/_teacher.erb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/views/teachers/_teacher.erb b/app/views/teachers/_teacher.erb index beed2b95..7523cca7 100644 --- a/app/views/teachers/_teacher.erb +++ b/app/views/teachers/_teacher.erb @@ -27,9 +27,6 @@ <%= link_to(teacher.school.name, school_path(teacher.school)) %> <%= teacher.school.location %> - - <%= teacher.school.country %> - <%= teacher.short_application_status %> From 9207b11c6f9fb391c4832d51fe664294032a74a6 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 22 Apr 2024 17:06:30 -0700 Subject: [PATCH 37/42] Update app/views/teachers/_teacher_info.html.erb --- app/views/teachers/_teacher_info.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/teachers/_teacher_info.html.erb b/app/views/teachers/_teacher_info.html.erb index 6a08e630..74c707f7 100644 --- a/app/views/teachers/_teacher_info.html.erb +++ b/app/views/teachers/_teacher_info.html.erb @@ -74,7 +74,6 @@
School Location:
- <%= "#{teacher.school.location}" %>
From 57dd25a0c549fa24bc772f95e2ad81cbfe9fc362 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Tue, 23 Apr 2024 10:19:46 -0700 Subject: [PATCH 38/42] delint... --- app/models/school.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/school.rb b/app/models/school.rb index ac1ae256..2bde54f9 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -60,7 +60,7 @@ def website end def location - country_text = country == "US" ? '' : ", #{country}" + country_text = country == "US" ? "" : ", #{country}" "#{city}, #{state}#{country_text}" end From d3d33a593f0dddfc11575c727707385a5e1ae4c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 16:51:52 +0000 Subject: [PATCH 39/42] Bump trix from 1.3.1 to 2.1.1 Bumps [trix](https://github.com/basecamp/trix) from 1.3.1 to 2.1.1. - [Release notes](https://github.com/basecamp/trix/releases) - [Commits](https://github.com/basecamp/trix/compare/1.3.1...v2.1.1) --- updated-dependencies: - dependency-name: trix dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 58ea9cc3..3a29ae15 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "popper.js": "^1.16.0", "selectize": "^0.12.6", "tinymce": "^5.x", - "trix": "^1.2.0", + "trix": "^2.1.1", "turbolinks": "^5.2.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 28d6981d..f06a34fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6902,10 +6902,10 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -trix@^1.2.0: - version "1.3.1" - resolved "https://registry.npmjs.org/trix/-/trix-1.3.1.tgz" - integrity sha512-BbH6mb6gk+AV4f2as38mP6Ucc1LE3OD6XxkZnAgPIduWXYtvg2mI3cZhIZSLqmMh9OITEpOBCCk88IVmyjU7bA== +trix@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/trix/-/trix-2.1.1.tgz#688f1213601316cf8b92c5e625d2f562c118c780" + integrity sha512-IljOMGOlRUPg1i5Pk/+x/Ia65ZY7Gw5JxxKCh/4caxG5ZaKuFJCKdn1+TF0efUYfdg+bqWenB/mAYCHjZu0zpQ== ts-pnp@^1.1.6: version "1.2.0" From c4ad7f5c5fabeb4dd14aad5295af13af3104f5e4 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Fri, 10 May 2024 10:33:17 +0200 Subject: [PATCH 40/42] Apply suggestions from code review --- app/models/school.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/school.rb b/app/models/school.rb index 2bde54f9..29966ddc 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -108,9 +108,7 @@ def format_school(data) end def self.search_list - School.pluck(:name, :city, :state, :country).map do |data| - format_school(data) - end + School.pluck(:name, :city, :state, :country).map(&:format_school) end def self.grade_level_options From 163e2a9901a5ae13e09f3d4be2fdc73cfcb8dfa0 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Fri, 10 May 2024 10:55:03 +0200 Subject: [PATCH 41/42] move datatables stuff to new file --- .github/workflows/specs.yml | 2 +- features/admin.feature | 44 ----------------------------- features/data_tables.feature | 54 ++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 45 deletions(-) create mode 100644 features/data_tables.feature diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml index 8eb5a7be..2d93ce7f 100644 --- a/.github/workflows/specs.yml +++ b/.github/workflows/specs.yml @@ -57,4 +57,4 @@ jobs: run: | export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" $CCTR sum-coverage coverage/codeclimate.*.json - $CCTR upload-coverage --id "$CC_TEST_REPORTER_ID" + $CCTR upload-coverage --id "${{ secrets.CC_TEST_REPORTER_ID }}" diff --git a/features/admin.feature b/features/admin.feature index 5b5486be..8f8208fa 100644 --- a/features/admin.feature +++ b/features/admin.feature @@ -147,26 +147,6 @@ Feature: basic admin functionality And I press "Update" Then I should not have sent out any emails - Scenario: Updating application status persists changes in database - Given the following schools exist: - | name | country | city | state | website | grade_level | school_type | - | UC Berkeley | US | Berkeley | CA | https://www.berkeley.edu | university | public | - Given the following teachers exist: - | first_name | last_name | admin | email | school | snap | application_status | - | Bobby | John | false | testteacher@berkeley.edu | UC Berkeley | bobby | denied | - Given I am on the BJC home page - And I have an admin email - And I follow "Log In" - Then I can log in with Google - When I go to the teachers page - And I go to the edit page for Bobby John - And I set my application status as "Validated" - And I press "Update" - Then I see a confirmation "Saved" - When I go to the teachers page - And I check "Validated" - Then I should see "Bobby John" - Scenario: Deny teacher as an admin Given the following schools exist: | name | country | city | state | website | grade_level | school_type | @@ -199,30 +179,6 @@ Feature: basic admin functionality When I go to the edit page for Joseph Mamoa Then should see "You need to log in to access this." - Scenario: Filter all teacher info as an admin - Given the following schools exist: - | name | country | city | state | website | grade_level | school_type | - | UC Berkeley | US | Berkeley | CA | https://www.berkeley.edu | university | public | - Given the following teachers exist: - | first_name | last_name | admin | email | school | application_status | - | Victor | Validateme | false | testteacher1@berkeley.edu | UC Berkeley | Validated | - | Danny | Denyme | false | testteacher2@berkeley.edu | UC Berkeley | Denied | - | Peter | Pendme | false | testteacher3@berkeley.edu | UC Berkeley | Not Reviewed | - Given I am on the BJC home page - Given I have an admin email - And I follow "Log In" - Then I can log in with Google - When I go to the teachers page - And I check "Not Reviewed" - And I uncheck "Validated" - Then I should see "Peter" - Then I should not see "Victor" - Then I should not see "Danny" - And I check "Validated" - Then I should see "Peter" - Then I should see "Victor" - Then I should not see "Danny" - Scenario: View teacher info as an admin Given the following schools exist: | name | country | city | state | website | grade_level | school_type | diff --git a/features/data_tables.feature b/features/data_tables.feature new file mode 100644 index 00000000..072bf825 --- /dev/null +++ b/features/data_tables.feature @@ -0,0 +1,54 @@ +Feature: Admin Data Tables functionality + + As an admin + So that I can see how many people are teaching BJC + I can use interactive datatables + + Background: Has an Admin in DB + Given the following teachers exist: + | first_name | last_name | admin | email | + | Admin | User | true | testadminuser@berkeley.edu | + + # Scenario: Updating application status persists changes in database + # Given the following schools exist: + # | name | country | city | state | website | grade_level | school_type | + # | UC Berkeley | US | Berkeley | CA | https://www.berkeley.edu | university | public | + # Given the following teachers exist: + # | first_name | last_name | admin | email | school | snap | application_status | + # | Bobby | John | false | testteacher@berkeley.edu | UC Berkeley | bobby | denied | + # Given I am on the BJC home page + # And I have an admin email + # And I follow "Log In" + # Then I can log in with Google + # When I go to the teachers page + # And I go to the edit page for Bobby John + # And I set my application status as "Validated" + # And I press "Update" + # Then I see a confirmation "Saved" + # When I go to the teachers page + # And I check "Validated" + # Then I should see "Bobby John" + + # Scenario: Filter all teacher info as an admin + # Given the following schools exist: + # | name | country | city | state | website | grade_level | school_type | + # | UC Berkeley | US | Berkeley | CA | https://www.berkeley.edu | university | public | + # Given the following teachers exist: + # | first_name | last_name | admin | email | school | application_status | + # | Victor | Validateme | false | testteacher1@berkeley.edu | UC Berkeley | Validated | + # | Danny | Denyme | false | testteacher2@berkeley.edu | UC Berkeley | Denied | + # | Peter | Pendme | false | testteacher3@berkeley.edu | UC Berkeley | Not Reviewed | + # Given I am on the BJC home page + # Given I have an admin email + # And I follow "Log In" + # Then I can log in with Google + # When I go to the teachers page + # And I check "Not Reviewed" + # And I uncheck "Validated" + # Then I should see "Peter" + # Then I should not see "Victor" + # Then I should not see "Danny" + # And I check "Validated" + # Then I should see "Peter" + # Then I should see "Victor" + # Then I should not see "Danny" From 2f7823d4a5a0f7fa79054c746ccb53e916e9f67f Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Fri, 10 May 2024 11:08:35 +0200 Subject: [PATCH 42/42] disable codecliamte for now...sigh --- .github/workflows/specs.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml index 2d93ce7f..23f634ae 100644 --- a/.github/workflows/specs.yml +++ b/.github/workflows/specs.yml @@ -53,8 +53,8 @@ jobs: uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} - - name: Publish Code Climate - run: | - export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" - $CCTR sum-coverage coverage/codeclimate.*.json - $CCTR upload-coverage --id "${{ secrets.CC_TEST_REPORTER_ID }}" + # - name: Publish Code Climate + # run: | + # export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" + # $CCTR sum-coverage coverage/codeclimate.*.json + # $CCTR upload-coverage --id "${{ secrets.CC_TEST_REPORTER_ID }}"