From 23f95da389d81fc2c8ec75612e505c66835f2a87 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2020 05:45:31 +0000 Subject: [PATCH 01/29] Bump webpacker from 5.0.1 to 5.1.1 Bumps [webpacker](https://github.com/rails/webpacker) from 5.0.1 to 5.1.1. - [Release notes](https://github.com/rails/webpacker/releases) - [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/webpacker/compare/v5.0.1...v5.1.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3b040fa4..e7021cb7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1491,7 +1491,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webpacker (5.0.1) + webpacker (5.1.1) activesupport (>= 5.2) rack-proxy (>= 0.6.1) railties (>= 5.2) From f18440840b29391ad6c73ef32b0c778412b15042 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2020 08:03:09 +0000 Subject: [PATCH 02/29] Bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- yarn.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 297cbbd2..d2c8dd94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8651,9 +8651,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._reinterpolate": { "version": "3.0.0", diff --git a/yarn.lock b/yarn.lock index 15dbf4c3..d2ac28f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6532,9 +6532,9 @@ lodash.uniq@^4.5.0: integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@~4.17.10: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== loglevel@^1.6.6: version "1.6.6" From 0f4f26bb8d860dc3efd342b655d6989da6c1b0e9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2020 05:45:51 +0000 Subject: [PATCH 03/29] Bump devise from 4.7.1 to 4.7.2 Bumps [devise](https://github.com/plataformatec/devise) from 4.7.1 to 4.7.2. - [Release notes](https://github.com/plataformatec/devise/releases) - [Changelog](https://github.com/heartcombo/devise/blob/master/CHANGELOG.md) - [Commits](https://github.com/plataformatec/devise/compare/v4.7.1...v4.7.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..a7ea21d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1100,7 +1100,7 @@ GEM db_text_search (0.3.1) activerecord (>= 4.1.15, < 7.0) debug_inspector (0.0.3) - devise (4.7.1) + devise (4.7.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -1386,7 +1386,7 @@ GEM redis (4.2.1) regexp_parser (1.7.1) remotipart (1.4.4) - responders (3.0.0) + responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) rexml (3.2.4) @@ -1525,7 +1525,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.3.1) + zeitwerk (2.4.0) PLATFORMS ruby From bc7ea11809d47334a082ada09d50f30d7ee4d6d1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2020 05:46:41 +0000 Subject: [PATCH 04/29] Bump capybara from 3.32.1 to 3.33.0 Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.32.1 to 3.33.0. - [Release notes](https://github.com/teamcapybara/capybara/releases) - [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md) - [Commits](https://github.com/teamcapybara/capybara/compare/3.32.1...3.33.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..75d5ac12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1027,7 +1027,7 @@ GEM bundler-audit (0.6.1) bundler (>= 1.2.0, < 3) thor (~> 0.18) - capybara (3.32.1) + capybara (3.33.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) From 358c1031870c8651dbfb0a052e7191bb244468d7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2020 05:47:48 +0000 Subject: [PATCH 05/29] Bump flipper from 0.17.2 to 0.18.0 Bumps [flipper](https://github.com/jnunemaker/flipper) from 0.17.2 to 0.18.0. - [Release notes](https://github.com/jnunemaker/flipper/releases) - [Changelog](https://github.com/jnunemaker/flipper/blob/master/Changelog.md) - [Commits](https://github.com/jnunemaker/flipper/compare/v0.17.2...v0.18.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..d72802a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1129,9 +1129,9 @@ GEM ffi (1.13.1) filesize (0.2.0) flamegraph (0.9.5) - flipper (0.17.2) - flipper-redis (0.17.2) - flipper (~> 0.17.2) + flipper (0.18.0) + flipper-redis (0.18.0) + flipper (~> 0.18.0) redis (>= 2.2, < 5) font-awesome-rails (4.7.0.5) railties (>= 3.2, < 6.1) From e6943c2151116c230bfdffc87b40856b18fbe139 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2020 05:48:23 +0000 Subject: [PATCH 06/29] Bump newrelic_rpm from 6.10.0.364 to 6.12.0.367 Bumps [newrelic_rpm](https://github.com/newrelic/newrelic-ruby-agent) from 6.10.0.364 to 6.12.0.367. - [Release notes](https://github.com/newrelic/newrelic-ruby-agent/releases) - [Changelog](https://github.com/newrelic/newrelic-ruby-agent/blob/main/CHANGELOG.md) - [Commits](https://github.com/newrelic/newrelic-ruby-agent/compare/6.10.0.364...6.12.0.367) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..0430f6b5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1255,7 +1255,7 @@ GEM mustache (1.1.1) nenv (0.3.0) nested_form (0.3.2) - newrelic_rpm (6.10.0.364) + newrelic_rpm (6.12.0.367) nio4r (2.5.2) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) From 8c508e733033bcafae3c2a49933633c6e869bd46 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2020 05:51:53 +0000 Subject: [PATCH 07/29] Bump rspec-rails from 4.0.0 to 4.0.1 Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/rspec/rspec-rails/releases) - [Changelog](https://github.com/rspec/rspec-rails/blob/master/Changelog.md) - [Commits](https://github.com/rspec/rspec-rails/compare/v4.0.0...v4.0.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..027534f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1396,9 +1396,9 @@ GEM rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.1) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-mocks (3.9.1) @@ -1407,7 +1407,7 @@ GEM rspec-prof (0.0.7) rspec (~> 3.0) ruby-prof - rspec-rails (4.0.0) + rspec-rails (4.0.1) actionpack (>= 4.2) activesupport (>= 4.2) railties (>= 4.2) @@ -1415,7 +1415,7 @@ GEM rspec-expectations (~> 3.9) rspec-mocks (~> 3.9) rspec-support (~> 3.9) - rspec-support (3.9.2) + rspec-support (3.9.3) rubocop (0.88.0) parallel (~> 1.10) parser (>= 2.7.1.1) @@ -1525,7 +1525,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.3.1) + zeitwerk (2.4.0) PLATFORMS ruby From 80c95899a69ed33dc42e4b3b0c9d336afdecb3d9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2020 17:42:27 +0000 Subject: [PATCH 08/29] [Security] Bump faye-websocket from 0.10.9 to 0.11.0 Bumps [faye-websocket](https://github.com/faye/faye-websocket-ruby) from 0.10.9 to 0.11.0. **This update includes a security fix.** - [Release notes](https://github.com/faye/faye-websocket-ruby/releases) - [Changelog](https://github.com/faye/faye-websocket-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/faye-websocket-ruby/compare/0.10.9...0.11.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..dfded367 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1123,7 +1123,7 @@ GEM multipart-post (>= 1.2, < 3) faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) - faye-websocket (0.10.9) + faye-websocket (0.11.0) eventmachine (>= 0.12.0) websocket-driver (>= 0.5.1) ffi (1.13.1) @@ -1520,7 +1520,7 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - websocket-driver (0.7.2) + websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) From ae46b787a4d027e9930989f7492cf17f07730b3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 15:35:05 +0000 Subject: [PATCH 09/29] Bump elliptic from 6.5.2 to 6.5.3 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- yarn.lock | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 297cbbd2..0846e07d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5574,9 +5574,9 @@ } }, "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index 15dbf4c3..ee4b152d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2610,9 +2610,9 @@ bluebird@^3.3.5, bluebird@^3.5.5: integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + version "4.11.9" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" + integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== body-parser@1.19.0: version "1.19.0" @@ -4150,9 +4150,9 @@ element-resize-detector@^1.2.1: batch-processor "1.0.0" elliptic@^6.0.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" - integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== + version "6.5.3" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" + integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== dependencies: bn.js "^4.4.0" brorand "^1.0.1" From 7ed0b042ddcbedab132c81754ce499ec6e907db5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2020 05:54:47 +0000 Subject: [PATCH 10/29] Bump rack-mini-profiler from 2.0.1 to 2.0.4 Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 2.0.1 to 2.0.4. - [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases) - [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md) - [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v2.0.1...v2.0.4) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..4e253836 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1307,7 +1307,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) rack (2.2.3) - rack-mini-profiler (2.0.1) + rack-mini-profiler (2.0.4) rack (>= 1.2.0) rack-pjax (1.1.0) nokogiri (~> 1.5) From 253e91857fedca310544b7c8f996b7474deec0f3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2020 16:55:50 +0000 Subject: [PATCH 11/29] [Security] Bump chartkick from 3.3.1 to 3.4.0 Bumps [chartkick](https://github.com/ankane/chartkick) from 3.3.1 to 3.4.0. **This update includes a security fix.** - [Release notes](https://github.com/ankane/chartkick/releases) - [Changelog](https://github.com/ankane/chartkick/blob/master/CHANGELOG.md) - [Commits](https://github.com/ankane/chartkick/compare/v3.3.1...v3.4.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..1fe47587 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1035,7 +1035,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - chartkick (3.3.1) + chartkick (3.4.0) childprocess (3.0.0) climate_control (0.2.0) cocoon (1.2.14) From 60008f8a7210915892d203baae750270eeeba919 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2020 03:38:05 +0000 Subject: [PATCH 12/29] Bump ibm_watson from 1.4.0 to 1.6.0 Bumps [ibm_watson](https://github.com/watson-developer-cloud/ruby-sdk) from 1.4.0 to 1.6.0. - [Release notes](https://github.com/watson-developer-cloud/ruby-sdk/releases) - [Changelog](https://github.com/watson-developer-cloud/ruby-sdk/blob/master/.releaserc) - [Commits](https://github.com/watson-developer-cloud/ruby-sdk/compare/v1.4.0...v1.6.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 796f90dd..013ba372 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1049,7 +1049,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.7) connection_pool (2.2.2) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -1123,7 +1123,7 @@ GEM multipart-post (>= 1.2, < 3) faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) - faye-websocket (0.10.9) + faye-websocket (0.11.0) eventmachine (>= 0.12.0) websocket-driver (>= 0.5.1) ffi (1.13.1) @@ -1179,7 +1179,7 @@ GEM concurrent-ruby (~> 1.0) http (~> 4.1.0) jwt (~> 2.2.1) - ibm_watson (1.4.0) + ibm_watson (1.6.0) concurrent-ruby (~> 1.0) eventmachine (~> 1.2) faye-websocket (~> 0.10) @@ -1200,7 +1200,7 @@ GEM jquery-ui-rails (6.0.1) railties (>= 3.2.16) json (2.3.0) - jwt (2.2.1) + jwt (2.2.2) kaminari (1.2.1) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.1) @@ -1520,7 +1520,7 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - websocket-driver (0.7.2) + websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) From e734c7dc756502313ddf7b76ddb8c04b0ba77dc5 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 12:00:40 -0700 Subject: [PATCH 13/29] Define 'month' in prepaid codes as 31 days instead of 30 --- app/models/paypal_invoice.rb | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/app/models/paypal_invoice.rb b/app/models/paypal_invoice.rb index 4a664cca..232b1eb4 100644 --- a/app/models/paypal_invoice.rb +++ b/app/models/paypal_invoice.rb @@ -26,32 +26,11 @@ class PaypalInvoice < ApplicationRecord code: 'PP-' + (0...8).map { (65 + rand(26)).chr }.join + '-' + (0...8).map { (65 + rand(26)).chr }.join, page_types: Rails.application.config.content_types[:premium].map(&:name), uses_remaining: 1, - days_active: 30 * self.months.to_i, + days_active: 31 * self.months.to_i, internal_description: "Prepaid with PayPal", description: "Prepaid Premium subscription" ) self.save! - - if PromoService.active?(:promo_bogo) && (self.months == 3 || self.months == 6) - # During this promo, we create a separate Invoice + PromoCode also - self.user.paypal_invoices.create( - paypal_id: "None -- Created from promo_bogo promo", - status: self.status, - user_id: self.user_id, - months: self.months, - amount_cents: 0, - page_unlock_promo_code: PageUnlockPromoCode.create( - code: 'BOGO-' + (0...8).map { (65 + rand(26)).chr }.join + '-' + (0...8).map { (65 + rand(26)).chr }.join, - page_types: Rails.application.config.content_types[:premium].map(&:name), - uses_remaining: 1, - days_active: 30 * self.months.to_i, - internal_description: "promo_bogo duplicate code", - description: "Your free buy-one-get-one-free Premium Code", - ), - approval_url: nil, - payer_id: self.payer_id - ) - end end def activateable? From 07d5024443d9a24b49952c318d4d4d55c36c88ad Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 12:26:40 -0700 Subject: [PATCH 14/29] allow clicking a prepaid code to prepopulate activation box --- app/authorizers/core_content_authorizer.rb | 9 +++++---- app/views/subscriptions/new.html.erb | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/authorizers/core_content_authorizer.rb b/app/authorizers/core_content_authorizer.rb index 0050fdf4..5d47581a 100644 --- a/app/authorizers/core_content_authorizer.rb +++ b/app/authorizers/core_content_authorizer.rb @@ -1,9 +1,10 @@ class CoreContentAuthorizer < ContentAuthorizer def self.creatable_by? user return false if ENV.key?('CONTENT_BLACKLIST') && ENV['CONTENT_BLACKLIST'].split(',').include?(user.email) - - [ - PermissionService.billing_plan_allows_core_content?(user: user) - ].any? + + return true # All billing plans support core content right now + # [ + # PermissionService.billing_plan_allows_core_content?(user: user) + # ].any? end end diff --git a/app/views/subscriptions/new.html.erb b/app/views/subscriptions/new.html.erb index 47416d35..49f7acc4 100644 --- a/app/views/subscriptions/new.html.erb +++ b/app/views/subscriptions/new.html.erb @@ -309,7 +309,7 @@

    <% current_user.page_unlock_promo_codes.where('uses_remaining > 0').each do |code| %> -
  • <%= code.code %> (<%= code.description %>)
  • +
  • <%= code.code %> (<%= code.description %>)
  • <% end %>
<% end %> From 5c688c16a6d172e50d6220d7916029d380e16f23 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 12:51:57 -0700 Subject: [PATCH 15/29] Verbiage change --- app/views/data/uploads.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/data/uploads.html.erb b/app/views/data/uploads.html.erb index 2ee22972..04c8c8f6 100644 --- a/app/views/data/uploads.html.erb +++ b/app/views/data/uploads.html.erb @@ -31,9 +31,9 @@
-
+
Did you know? - Premium users get an extra 10GB of storage space, but all users can earn even more storage space by referring their friends to Notebook.ai. + Premium users get an extra 10GB of storage space, but you can earn even more storage space by referring friends to Notebook.ai. <%= link_to 'Learn more.', referrals_path, class: 'orange-text text-lighten-3' %>
From e8e81de8a92bea5f6600a93aad45a1383c84dd11 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 13:05:38 -0700 Subject: [PATCH 16/29] clean up billing page --- app/controllers/subscriptions_controller.rb | 3 --- app/views/subscriptions/new.html.erb | 28 +-------------------- config/routes.rb | 3 ++- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb index fd18d658..2e22cb58 100644 --- a/app/controllers/subscriptions_controller.rb +++ b/app/controllers/subscriptions_controller.rb @@ -286,9 +286,6 @@ class SubscriptionsController < ApplicationController }, { label: "Billing history", href: main_app.billing_history_path - }, { - label: "Referrals", - href: main_app.referrals_path }] end end diff --git a/app/views/subscriptions/new.html.erb b/app/views/subscriptions/new.html.erb index 49f7acc4..459c4150 100644 --- a/app/views/subscriptions/new.html.erb +++ b/app/views/subscriptions/new.html.erb @@ -239,8 +239,7 @@
-
-
+
@@ -363,31 +362,6 @@
-
-
-
-
-
- Upload Bandwidth -
- <%= (current_user.upload_bandwidth_kb) > 0 ? Filesize.from("#{current_user.upload_bandwidth_kb}KB").pretty : '-' + Filesize.from("#{current_user.upload_bandwidth_kb.abs}KB").pretty %> remaining -
-
-

- You have <%= (current_user.upload_bandwidth_kb) > 0 ? Filesize.from("#{current_user.upload_bandwidth_kb}KB").pretty : '-' + Filesize.from("#{current_user.upload_bandwidth_kb.abs}KB").pretty %> of bandwidth remaining. -

-

- This bandwidth can be used to upload images to your content anywhere on the site. Deleting an uploaded image frees - up the same amount of bandwidth. - <% unless on_premium_plan %> - To get more bandwidth, upgrade to our Premium plan. - <% end %> -

-
-
-
-
-
All prices are in US Dollars. Making payments using another currency will automatically exchange into US Dollars at the current exchange rates.
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 4852c61f..ce2c9c73 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,12 +86,13 @@ Rails.application.routes.draw do # Legacy route: left intact so /my/documents/X URLs continue to work for everyone's bookmarks resources :documents + get '/referrals', to: 'subscriptions#referrals', as: :referrals + # Billing scope '/billing' do #get '/', to: 'subscriptions#show', as: :billing get '/subscription', to: 'subscriptions#new', as: :subscription get '/history', to: 'subscriptions#history', as: :billing_history - get '/referrals', to: 'subscriptions#referrals', as: :referrals get '/to/:stripe_plan_id', to: 'subscriptions#change', as: :change_subscription From f9983fcd9124611479a31cc4f4351ebce8e9f9b7 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 13:11:36 -0700 Subject: [PATCH 17/29] move referrals link from billing page to data vault --- app/views/data/index.html.erb | 14 ++++++++++++++ app/views/subscriptions/prepay.html.erb | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/views/data/index.html.erb b/app/views/data/index.html.erb index 8c24a550..c5fb24ab 100644 --- a/app/views/data/index.html.erb +++ b/app/views/data/index.html.erb @@ -69,6 +69,20 @@ <% end %>
+
+ <%= link_to referrals_path, class: 'black-text' do %> +
+
+ favorite +
Referrals
+

+ Get your referral code, browse potential rewards, and invite your friends! +

+
+
+ <% end %> +
+
<%= link_to discussions_path, class: 'black-text' do %>
diff --git a/app/views/subscriptions/prepay.html.erb b/app/views/subscriptions/prepay.html.erb index 387ed79a..2c2b9058 100644 --- a/app/views/subscriptions/prepay.html.erb +++ b/app/views/subscriptions/prepay.html.erb @@ -60,7 +60,7 @@
<%= link_to prepay_paypal_gateway_path(months: 3), class: 'black-text' do %> -
+
star @@ -77,7 +77,7 @@
<%= link_to prepay_paypal_gateway_path(months: 6), class: 'black-text' do %> -
+
star @@ -126,7 +126,7 @@

<% if current_user.on_premium_plan? && @invoices.any? %> -
+
Since you already have Premium features active, you won't be able to activate any codes on this account yet.
Activation links will appear again whenever you don't have Premium active.
From fce2a2930328b19deec5be577480da03f78ddafb Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 13:13:51 -0700 Subject: [PATCH 18/29] move referrals logic from sub to data controller --- app/assets/javascripts/billing.js | 7 +++++++ app/controllers/data_controller.rb | 6 ++++++ app/controllers/subscriptions_controller.rb | 6 ------ app/views/{subscriptions => data}/referrals.html.erb | 0 config/routes.rb | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 app/assets/javascripts/billing.js rename app/views/{subscriptions => data}/referrals.html.erb (100%) diff --git a/app/assets/javascripts/billing.js b/app/assets/javascripts/billing.js new file mode 100644 index 00000000..d67fd05c --- /dev/null +++ b/app/assets/javascripts/billing.js @@ -0,0 +1,7 @@ +$(document).ready(function () { + $('.js-prepaid-promo-code').click(function (event) { + var code = $(event.target).text(); + $('#promotional_code_promo_code').val(code); + return false; + }); +}) \ No newline at end of file diff --git a/app/controllers/data_controller.rb b/app/controllers/data_controller.rb index 7c726153..9e165ae6 100644 --- a/app/controllers/data_controller.rb +++ b/app/controllers/data_controller.rb @@ -43,6 +43,12 @@ class DataController < ApplicationController @collaborating_universes = Universe.where(id: collaborating_ids) end + def referrals + @referrals = current_user.referrals.includes(:referree) + @referral_count = @referrals.count + @share_link = "https://www.notebook.ai/?referral=#{current_user.referral_code.code}" + end + private def set_sidenav_expansion diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb index 2e22cb58..6169aae6 100644 --- a/app/controllers/subscriptions_controller.rb +++ b/app/controllers/subscriptions_controller.rb @@ -122,12 +122,6 @@ class SubscriptionsController < ApplicationController end end - def referrals - @referrals = current_user.referrals.includes(:referree) - @referral_count = @referrals.count - @share_link = "https://www.notebook.ai/?referral=#{current_user.referral_code.code}" - end - # This isn't actually needed since we change the paid plan to the free plan, but will be needed when we # add a way to deactivate/delete accounts, so the logic is here for when it's needed. # def cancel diff --git a/app/views/subscriptions/referrals.html.erb b/app/views/data/referrals.html.erb similarity index 100% rename from app/views/subscriptions/referrals.html.erb rename to app/views/data/referrals.html.erb diff --git a/config/routes.rb b/config/routes.rb index ce2c9c73..a86332c7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,7 +86,7 @@ Rails.application.routes.draw do # Legacy route: left intact so /my/documents/X URLs continue to work for everyone's bookmarks resources :documents - get '/referrals', to: 'subscriptions#referrals', as: :referrals + get '/referrals', to: 'data#referrals', as: :referrals # Billing scope '/billing' do From f44ce3cbe62b273f232e890a2a3e22f6ebff925a Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 13:29:38 -0700 Subject: [PATCH 19/29] fix clicking share placeholder text jumping to first textinput on page --- app/views/share_comments/_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/share_comments/_form.html.erb b/app/views/share_comments/_form.html.erb index bdadf8b8..535bc343 100644 --- a/app/views/share_comments/_form.html.erb +++ b/app/views/share_comments/_form.html.erb @@ -1,8 +1,8 @@ <%= form_for ShareComment.new do |f| %>
- <%= f.label :message, 'Leave a message' %> <%= f.hidden_field :content_page_share_id, value: share.id %> - <%= f.text_area :message, class: 'materialize-textarea' %> + <%= f.label 'Leave a message', for: "share_comment_#{share.id}" %> + <%= f.text_area :message, id: "share_comment_#{share.id}", class: 'materialize-textarea' %> <%= f.submit 'Comment', class: 'btn right green white-text submit-button' %>
<% end %> \ No newline at end of file From 8528fe6ed17c2b3ccdb9d95539799673b4ef7f85 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 13:36:14 -0700 Subject: [PATCH 20/29] allow linking pages in stream comments --- app/controllers/stream_controller.rb | 1 + app/views/share_comments/_form.html.erb | 2 +- app/views/share_comments/_show.html.erb | 5 ++++- app/views/stream/index.html.erb | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/stream_controller.rb b/app/controllers/stream_controller.rb index 0f4ef488..29c1c570 100644 --- a/app/controllers/stream_controller.rb +++ b/app/controllers/stream_controller.rb @@ -3,6 +3,7 @@ class StreamController < ApplicationController before_action :set_stream_navbar_actions, only: [:index, :global] before_action :set_stream_navbar_color, only: [:index, :global] before_action :set_sidenav_expansion + before_action :cache_linkable_content_for_each_content_type, only: [:index] def index followed_users = current_user.followed_users.pluck(:id) diff --git a/app/views/share_comments/_form.html.erb b/app/views/share_comments/_form.html.erb index 535bc343..753b0522 100644 --- a/app/views/share_comments/_form.html.erb +++ b/app/views/share_comments/_form.html.erb @@ -2,7 +2,7 @@
<%= f.hidden_field :content_page_share_id, value: share.id %> <%= f.label 'Leave a message', for: "share_comment_#{share.id}" %> - <%= f.text_area :message, id: "share_comment_#{share.id}", class: 'materialize-textarea' %> + <%= f.text_area :message, id: "share_comment_#{share.id}", class: 'materialize-textarea js-can-mention-pages' %> <%= f.submit 'Comment', class: 'btn right green white-text submit-button' %>
<% end %> \ No newline at end of file diff --git a/app/views/share_comments/_show.html.erb b/app/views/share_comments/_show.html.erb index a4666022..ef7d94a4 100644 --- a/app/views/share_comments/_show.html.erb +++ b/app/views/share_comments/_show.html.erb @@ -7,7 +7,10 @@ <% end %> <%# Nesting from above %> - <%= simple_format comment.message, class: 'black-text' %> + <%= simple_format ContentFormatterService.show( + text: comment.message, + viewing_user: current_user + ), class: 'black-text' %>
-<% end %> \ No newline at end of file +<% end %> + +<%= render partial: 'javascripts/content_linking' %> \ No newline at end of file From 4793d954caa1c2a57a97cd2bc30f6195428e32f7 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 13:59:21 -0700 Subject: [PATCH 21/29] allow linking pages in stream shares --- app/views/content_page_shares/_form.html.erb | 7 +------ .../content_page_shares/_stream_document_share.html.erb | 9 +++++++-- .../content_page_shares/_stream_page_share.html.erb | 9 +++++++-- app/views/content_page_shares/show.html.erb | 9 +++++++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/app/views/content_page_shares/_form.html.erb b/app/views/content_page_shares/_form.html.erb index 3a97df84..0f2d55ae 100644 --- a/app/views/content_page_shares/_form.html.erb +++ b/app/views/content_page_shares/_form.html.erb @@ -23,16 +23,11 @@ By default, your notebook pages are all private. Sharing your page here will automatically make it public, but you can change back to private at any time by editing the page directly.
-
- <%= f.text_area :message, class: 'materialize-textarea' %> + <%= f.text_area :message, class: 'materialize-textarea js-can-mention-pages' %> <%= f.label :message, '2. Write a question or message about your page.' %>
diff --git a/app/views/content_page_shares/_stream_document_share.html.erb b/app/views/content_page_shares/_stream_document_share.html.erb index 97ddeea8..bf53c6c6 100644 --- a/app/views/content_page_shares/_stream_document_share.html.erb +++ b/app/views/content_page_shares/_stream_document_share.html.erb @@ -47,8 +47,13 @@ <%= link_to [share.user, share] do %><%= time_ago_in_words share.shared_at %> ago<% end %>:
-
- <%= simple_format share.message %> +
+ <%= + simple_format ContentFormatterService.show( + text: share.message, + viewing_user: current_user + ) + %>
<% end %> diff --git a/app/views/content_page_shares/_stream_page_share.html.erb b/app/views/content_page_shares/_stream_page_share.html.erb index 71aff342..b2752486 100644 --- a/app/views/content_page_shares/_stream_page_share.html.erb +++ b/app/views/content_page_shares/_stream_page_share.html.erb @@ -47,8 +47,13 @@ <%= link_to [share.user, share] do %><%= time_ago_in_words share.shared_at %> ago<% end %>:
-
- <%= simple_format share.message %> +
+ <%= + simple_format ContentFormatterService.show( + text: share.message, + viewing_user: current_user + ) + %>
<% end %> diff --git a/app/views/content_page_shares/show.html.erb b/app/views/content_page_shares/show.html.erb index f6f7f67d..534cb2c2 100644 --- a/app/views/content_page_shares/show.html.erb +++ b/app/views/content_page_shares/show.html.erb @@ -102,8 +102,13 @@

<% if @share.message.present? %> -
- <%= simple_format @share.message %> +
+ <%= + simple_format ContentFormatterService.show( + text: @share.message, + viewing_user: current_user + ) + %>
<% end %> From f54e87467b8c2c170c2b271a56e5707db438e140 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 14:21:17 -0700 Subject: [PATCH 22/29] force word wrapping on nonbreaking lines on profile fields --- app/assets/stylesheets/layout.scss | 4 ++++ app/views/users/profile/_info.html.erb | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 3c1eaa66..41ca8190 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1,3 +1,7 @@ .container-fluid { margin: 0 30px; } + +.force-word-wrap { + overflow-wrap: break-word; +} \ No newline at end of file diff --git a/app/views/users/profile/_info.html.erb b/app/views/users/profile/_info.html.erb index 6b0906f8..6f852a8d 100644 --- a/app/views/users/profile/_info.html.erb +++ b/app/views/users/profile/_info.html.erb @@ -51,7 +51,7 @@
Username
-
+
<%= link_to "@#{@user.username}", profile_by_username_path(username: @user.username) %>

@@ -61,7 +61,7 @@
Also known as
-
+
<%= @user.other_names %>

@@ -76,7 +76,7 @@
Website
-
+
<%= link_to @user.website, @user.website, target: '_new', data: { confirm: "You are about to visit an external website not owned by Notebook.ai. Please only continue if you trust this user." }, ref: 'nofollow' %>

@@ -111,7 +111,7 @@
Bio
-
+
<%= simple_format truncate(@user.bio, length: 500) %>
@@ -126,7 +126,7 @@
<%= field.titleize %>
-
+
<%= simple_format @user.send(field) %>
From 5493f115ee543ad1c228640320480692f61f8dd5 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 15:24:51 -0700 Subject: [PATCH 23/29] Allow removing published submissions from a collection --- .../page_collection_submissions_controller.rb | 8 +++++++- app/controllers/page_collections_controller.rb | 5 +++++ app/views/page_collections/_stream.html.erb | 11 +++++++++++ app/views/page_collections/show.html.erb | 3 +-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/controllers/page_collection_submissions_controller.rb b/app/controllers/page_collection_submissions_controller.rb index 0d21120a..ca3e069f 100644 --- a/app/controllers/page_collection_submissions_controller.rb +++ b/app/controllers/page_collection_submissions_controller.rb @@ -46,8 +46,14 @@ class PageCollectionSubmissionsController < ApplicationController # DELETE /page_collection_submissions/1 def destroy + unless user_signed_in? && current_user == @page_collection_submission.page_collection.user + raise "Not allowed" + return + end + + page_collection = @page_collection_submission.page_collection @page_collection_submission.destroy - redirect_to page_collection_submissions_url, notice: 'Page collection submission was successfully destroyed.' + redirect_to page_collection, notice: 'The page was successfully removed from this collection.' end def approve diff --git a/app/controllers/page_collections_controller.rb b/app/controllers/page_collections_controller.rb index 74647d09..3e299ebd 100644 --- a/app/controllers/page_collections_controller.rb +++ b/app/controllers/page_collections_controller.rb @@ -79,6 +79,11 @@ class PageCollectionsController < ApplicationController # DELETE /page_collections/1 def destroy + unless user_signed_in? && current_user == @page_collection.user + raise "Permission denied" + return + end + @page_collection.destroy redirect_to page_collections_url, notice: 'Page collection was successfully destroyed.' end diff --git a/app/views/page_collections/_stream.html.erb b/app/views/page_collections/_stream.html.erb index 46eb0432..d3053fea 100644 --- a/app/views/page_collections/_stream.html.erb +++ b/app/views/page_collections/_stream.html.erb @@ -11,6 +11,17 @@
<%= link_to content.name, content %> + + <% if user_signed_in? && current_user == @page_collection.user %> + + more_vert + + + <% end %>
<% if page.explanation? %>
diff --git a/app/views/page_collections/show.html.erb b/app/views/page_collections/show.html.erb index 26280773..bbc13320 100644 --- a/app/views/page_collections/show.html.erb +++ b/app/views/page_collections/show.html.erb @@ -10,9 +10,8 @@
<% else %> <%= render partial: 'page_collections/sort_bar' %> + <%= render partial: 'page_collections/stream', locals: { pages: @pages } %> <% end %> - - <%= render partial: 'page_collections/stream', locals: { pages: @pages } %>
<%= render partial: 'page_collections/sidebar' %> From 8ef6ee66b8492cc0581c8f6c0d557b9f94e30e7e Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 15:38:45 -0700 Subject: [PATCH 24/29] add pagecollection page to highlight specific contributors --- .../page_collections_controller.rb | 21 +++++++++++++++++++ .../components/_collection_header.html.erb | 10 +++++---- app/views/page_collections/_stream.html.erb | 4 ++++ app/views/page_collections/show.html.erb | 6 ++++++ config/routes.rb | 2 ++ 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/app/controllers/page_collections_controller.rb b/app/controllers/page_collections_controller.rb index 3e299ebd..ba13c0ad 100644 --- a/app/controllers/page_collections_controller.rb +++ b/app/controllers/page_collections_controller.rb @@ -118,6 +118,27 @@ class PageCollectionsController < ApplicationController redirect_to root_path, notice: "That Collection has been reported to site administration. Thank you!" end + def by_user + @page_collection = PageCollection.find(params[:page_collection_id]) + + unless (@page_collection.privacy == 'public' || (user_signed_in? && @page_collection.user == current_user)) + return redirect_to page_collections_path, notice: "That Collection is not public." + end + + @pages = @page_collection.accepted_submissions.where(user_id: params[:user_id]) + sort_pages + + @submittable_content = if user_signed_in? + @current_user_content.slice(*@page_collection.page_types) + else + [] + end + + @show_contributor_highlight = true + @highlighted_contributor = User.find_by(id: params[:user_id].to_i) + render :show + end + private # Use callbacks to share common setup or constraints between actions. diff --git a/app/views/content/components/_collection_header.html.erb b/app/views/content/components/_collection_header.html.erb index 658621a1..fc9de293 100644 --- a/app/views/content/components/_collection_header.html.erb +++ b/app/views/content/components/_collection_header.html.erb @@ -3,10 +3,12 @@
  • <%= image_tag(collection.random_public_image) %>
    -

    - <%= PageCollection.icon %> - <%= collection.title %> -

    + <%= link_to collection, class: 'white-text' do %> +

    + <%= PageCollection.icon %> + <%= collection.title %> +

    + <% end %>
    <% if collection.subtitle? %> <%= collection.subtitle %> diff --git a/app/views/page_collections/_stream.html.erb b/app/views/page_collections/_stream.html.erb index d3053fea..4f28ad74 100644 --- a/app/views/page_collections/_stream.html.erb +++ b/app/views/page_collections/_stream.html.erb @@ -17,6 +17,10 @@ more_vert
    <% else %> <%= render partial: 'page_collections/sort_bar' %> + <% if !!@show_contributor_highlight %> +
    + Showing all submitted pages from <%= link_to @highlighted_contributor.display_name, @highlighted_contributor, class: "#{User.color}-text" %>. + Click <%= link_to 'here', @page_collection, class: 'blue-text text-lighten-3' %> to see all pages regardless of author. +
    + <% end %> <%= render partial: 'page_collections/stream', locals: { pages: @pages } %> <% end %>
  • diff --git a/config/routes.rb b/config/routes.rb index a86332c7..02822aea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,8 @@ Rails.application.routes.draw do get 'follow', on: :member get 'unfollow', on: :member get 'report', on: :member + + get 'by/:user_id', to: 'page_collections#by_user', as: :submissions_by_user end resources :page_collection_submissions do get 'approve', on: :member From 335397c8bbaa883a0fed82baf4e2c1bbfbaec586 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 18:14:31 -0700 Subject: [PATCH 25/29] add twitter/fb share links to stream shares and share modal on content pages --- app/views/content/_share.html.erb | 40 +++++++++++++++------ app/views/content_page_shares/show.html.erb | 25 ++++++++----- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/app/views/content/_share.html.erb b/app/views/content/_share.html.erb index 51276c63..8d835096 100644 --- a/app/views/content/_share.html.erb +++ b/app/views/content/_share.html.erb @@ -16,6 +16,13 @@
    To be shared, content must either be public or in a public Universe. + + <%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'blue-text lighten-1', target: '_new' do %> + Learn more about sharing on Notebook.ai. + <% end %> +
    +
    + Changes are saved automatically and can be changed at any time.
    @@ -69,10 +76,6 @@
    <% end %> - -
    - Changes are saved automatically and can be changed at any time. -
    <% if shared_content.is_a?(Universe) %> @@ -84,12 +87,29 @@
    <% end %> -
    -

    - <%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'blue-text lighten-1', target: '_new' do %> - Click here to learn more about sharing pages on Notebook.ai - <% end %> -

    + +
    + <%= link_to [ + 'http://twitter.com/share?', + 'url=' + URI::escape(send("#{shared_content.class.name.downcase}_url", shared_content)), + '&text=' + URI::escape("I'm using Notebook.ai to create fictional worlds! You can see my #{shared_content.class.name.downcase} #{shared_content.name} at this link:") + ].join, target: '_new' do %> +
    + + Share to Twitter +
    + <% end %> +
    + <% else %> diff --git a/app/views/content_page_shares/show.html.erb b/app/views/content_page_shares/show.html.erb index 534cb2c2..e8bac02a 100644 --- a/app/views/content_page_shares/show.html.erb +++ b/app/views/content_page_shares/show.html.erb @@ -66,27 +66,34 @@
    -
    From dd97ba4a620f076e7287cd57d007668c56e3ea3f Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 18:31:21 -0700 Subject: [PATCH 26/29] add paranoid deleted_at fields for recovery and reorganize model hierarchy --- app/models/{ => billing}/paypal_invoice.rb | 2 + .../{ => page_collections}/page_collection.rb | 2 + .../page_collection_following.rb | 0 .../page_collection_report.rb | 0 .../page_collection_submission.rb | 2 + .../{ => page_groupers}/planet_continent.rb | 0 app/models/{ => stream}/content_page_share.rb | 2 + .../content_page_share_following.rb | 0 .../{ => stream}/content_page_share_report.rb | 0 app/models/{ => stream}/share_comment.rb | 2 + .../attribute_category_suggestion.rb | 0 .../attribute_field_suggestion.rb | 0 app/models/{ => timelines}/timeline.rb | 0 app/models/{ => timelines}/timeline_event.rb | 2 + .../{ => timelines}/timeline_event_entity.rb | 0 app/models/{ => users}/notice_dismissal.rb | 0 app/models/{ => users}/notification.rb | 0 .../{ => users}/page_settings_override.rb | 0 app/models/{ => users}/user_blocking.rb | 0 app/models/{ => users}/user_following.rb | 0 ...00_add_paranoid_fields_to_recent_models.rb | 8 ++++ db/schema.rb | 38 ++++++++++++++++++- 22 files changed, 57 insertions(+), 1 deletion(-) rename app/models/{ => billing}/paypal_invoice.rb (98%) rename app/models/{ => page_collections}/page_collection.rb (98%) rename app/models/{ => page_collections}/page_collection_following.rb (100%) rename app/models/{ => page_collections}/page_collection_report.rb (100%) rename app/models/{ => page_collections}/page_collection_submission.rb (99%) rename app/models/{ => page_groupers}/planet_continent.rb (100%) rename app/models/{ => stream}/content_page_share.rb (97%) rename app/models/{ => stream}/content_page_share_following.rb (100%) rename app/models/{ => stream}/content_page_share_report.rb (100%) rename app/models/{ => stream}/share_comment.rb (89%) rename app/models/{ => suggestions}/attribute_category_suggestion.rb (100%) rename app/models/{ => suggestions}/attribute_field_suggestion.rb (100%) rename app/models/{ => timelines}/timeline.rb (100%) rename app/models/{ => timelines}/timeline_event.rb (93%) rename app/models/{ => timelines}/timeline_event_entity.rb (100%) rename app/models/{ => users}/notice_dismissal.rb (100%) rename app/models/{ => users}/notification.rb (100%) rename app/models/{ => users}/page_settings_override.rb (100%) rename app/models/{ => users}/user_blocking.rb (100%) rename app/models/{ => users}/user_following.rb (100%) create mode 100644 db/migrate/20200829011900_add_paranoid_fields_to_recent_models.rb diff --git a/app/models/paypal_invoice.rb b/app/models/billing/paypal_invoice.rb similarity index 98% rename from app/models/paypal_invoice.rb rename to app/models/billing/paypal_invoice.rb index 232b1eb4..4b12da61 100644 --- a/app/models/paypal_invoice.rb +++ b/app/models/billing/paypal_invoice.rb @@ -1,4 +1,6 @@ class PaypalInvoice < ApplicationRecord + acts_as_paranoid + belongs_to :user belongs_to :page_unlock_promo_code, optional: true diff --git a/app/models/page_collection.rb b/app/models/page_collections/page_collection.rb similarity index 98% rename from app/models/page_collection.rb rename to app/models/page_collections/page_collection.rb index a93addb0..062219b5 100644 --- a/app/models/page_collection.rb +++ b/app/models/page_collections/page_collection.rb @@ -1,4 +1,6 @@ class PageCollection < ApplicationRecord + acts_as_paranoid + belongs_to :user has_many :page_collection_submissions diff --git a/app/models/page_collection_following.rb b/app/models/page_collections/page_collection_following.rb similarity index 100% rename from app/models/page_collection_following.rb rename to app/models/page_collections/page_collection_following.rb diff --git a/app/models/page_collection_report.rb b/app/models/page_collections/page_collection_report.rb similarity index 100% rename from app/models/page_collection_report.rb rename to app/models/page_collections/page_collection_report.rb diff --git a/app/models/page_collection_submission.rb b/app/models/page_collections/page_collection_submission.rb similarity index 99% rename from app/models/page_collection_submission.rb rename to app/models/page_collections/page_collection_submission.rb index 7e905e24..471c7fa6 100644 --- a/app/models/page_collection_submission.rb +++ b/app/models/page_collections/page_collection_submission.rb @@ -1,4 +1,6 @@ class PageCollectionSubmission < ApplicationRecord + acts_as_paranoid + belongs_to :content, polymorphic: true belongs_to :page_collection belongs_to :user diff --git a/app/models/planet_continent.rb b/app/models/page_groupers/planet_continent.rb similarity index 100% rename from app/models/planet_continent.rb rename to app/models/page_groupers/planet_continent.rb diff --git a/app/models/content_page_share.rb b/app/models/stream/content_page_share.rb similarity index 97% rename from app/models/content_page_share.rb rename to app/models/stream/content_page_share.rb index a367ff3f..bf68edab 100644 --- a/app/models/content_page_share.rb +++ b/app/models/stream/content_page_share.rb @@ -1,4 +1,6 @@ class ContentPageShare < ApplicationRecord + adds_as_paranoid + belongs_to :user belongs_to :content_page, polymorphic: true, optional: true belongs_to :secondary_content_page, polymorphic: true, optional: true diff --git a/app/models/content_page_share_following.rb b/app/models/stream/content_page_share_following.rb similarity index 100% rename from app/models/content_page_share_following.rb rename to app/models/stream/content_page_share_following.rb diff --git a/app/models/content_page_share_report.rb b/app/models/stream/content_page_share_report.rb similarity index 100% rename from app/models/content_page_share_report.rb rename to app/models/stream/content_page_share_report.rb diff --git a/app/models/share_comment.rb b/app/models/stream/share_comment.rb similarity index 89% rename from app/models/share_comment.rb rename to app/models/stream/share_comment.rb index 702b8486..8f790e19 100644 --- a/app/models/share_comment.rb +++ b/app/models/stream/share_comment.rb @@ -1,4 +1,6 @@ class ShareComment < ApplicationRecord + acts_as_paranoid + belongs_to :user, optional: true belongs_to :content_page_share diff --git a/app/models/attribute_category_suggestion.rb b/app/models/suggestions/attribute_category_suggestion.rb similarity index 100% rename from app/models/attribute_category_suggestion.rb rename to app/models/suggestions/attribute_category_suggestion.rb diff --git a/app/models/attribute_field_suggestion.rb b/app/models/suggestions/attribute_field_suggestion.rb similarity index 100% rename from app/models/attribute_field_suggestion.rb rename to app/models/suggestions/attribute_field_suggestion.rb diff --git a/app/models/timeline.rb b/app/models/timelines/timeline.rb similarity index 100% rename from app/models/timeline.rb rename to app/models/timelines/timeline.rb diff --git a/app/models/timeline_event.rb b/app/models/timelines/timeline_event.rb similarity index 93% rename from app/models/timeline_event.rb rename to app/models/timelines/timeline_event.rb index 4b886ae6..fc68f032 100644 --- a/app/models/timeline_event.rb +++ b/app/models/timelines/timeline_event.rb @@ -1,4 +1,6 @@ class TimelineEvent < ApplicationRecord + acts_as_paranoid + belongs_to :timeline has_many :timeline_event_entities, dependent: :destroy diff --git a/app/models/timeline_event_entity.rb b/app/models/timelines/timeline_event_entity.rb similarity index 100% rename from app/models/timeline_event_entity.rb rename to app/models/timelines/timeline_event_entity.rb diff --git a/app/models/notice_dismissal.rb b/app/models/users/notice_dismissal.rb similarity index 100% rename from app/models/notice_dismissal.rb rename to app/models/users/notice_dismissal.rb diff --git a/app/models/notification.rb b/app/models/users/notification.rb similarity index 100% rename from app/models/notification.rb rename to app/models/users/notification.rb diff --git a/app/models/page_settings_override.rb b/app/models/users/page_settings_override.rb similarity index 100% rename from app/models/page_settings_override.rb rename to app/models/users/page_settings_override.rb diff --git a/app/models/user_blocking.rb b/app/models/users/user_blocking.rb similarity index 100% rename from app/models/user_blocking.rb rename to app/models/users/user_blocking.rb diff --git a/app/models/user_following.rb b/app/models/users/user_following.rb similarity index 100% rename from app/models/user_following.rb rename to app/models/users/user_following.rb diff --git a/db/migrate/20200829011900_add_paranoid_fields_to_recent_models.rb b/db/migrate/20200829011900_add_paranoid_fields_to_recent_models.rb new file mode 100644 index 00000000..5adc0c03 --- /dev/null +++ b/db/migrate/20200829011900_add_paranoid_fields_to_recent_models.rb @@ -0,0 +1,8 @@ +class AddParanoidFieldsToRecentModels < ActiveRecord::Migration[6.0] + def change + add_column :page_collections, :deleted_at, :datetime + add_column :page_collection_submissions, :deleted_at, :datetime + add_column :paypal_invoices, :deleted_at, :datetime + add_column :timeline_events, :deleted_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index f4ff1ade..2aeb90eb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_07_22_004641) do +ActiveRecord::Schema.define(version: 2020_08_29_011900) do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false @@ -41,6 +41,24 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.index ["user_id"], name: "index_api_keys_on_user_id" end + create_table "application_integrations", force: :cascade do |t| + t.integer "user_id", null: false + t.string "name" + t.string "description" + t.string "organization_name" + t.string "organization_url" + t.string "website_url" + t.string "privacy_policy_url" + t.string "token" + t.datetime "last_used_at" + t.string "authorization_callback_url" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "event_ping_url" + t.string "application_token" + t.index ["user_id"], name: "index_application_integrations_on_user_id" + end + create_table "archenemyships", force: :cascade do |t| t.integer "user_id" t.integer "character_id" @@ -1421,6 +1439,17 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.index ["user_id"], name: "index_image_uploads_on_user_id" end + create_table "integration_authorizations", force: :cascade do |t| + t.integer "user_id", null: false + t.integer "application_integration_id", null: false + t.string "referral_url" + t.string "ip_address" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["application_integration_id"], name: "index_integration_authorizations_on_application_integration_id" + t.index ["user_id"], name: "index_integration_authorizations_on_user_id" + end + create_table "item_magics", force: :cascade do |t| t.integer "item_id" t.integer "magic_id" @@ -2168,6 +2197,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.datetime "updated_at", precision: 6, null: false t.string "explanation" t.string "cached_content_name" + t.datetime "deleted_at" t.index ["content_type", "content_id"], name: "polycontent_collection_index" t.index ["page_collection_id"], name: "index_page_collection_submissions_on_page_collection_id" t.index ["user_id"], name: "index_page_collection_submissions_on_user_id" @@ -2187,6 +2217,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.string "description" t.boolean "allow_submissions" t.string "slug" + t.datetime "deleted_at" t.index ["user_id"], name: "index_page_collections_on_user_id" end @@ -2243,6 +2274,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.integer "page_unlock_promo_code_id" t.string "approval_url" t.string "payer_id" + t.datetime "deleted_at" t.index ["page_unlock_promo_code_id"], name: "index_paypal_invoices_on_page_unlock_promo_code_id" t.index ["user_id"], name: "index_paypal_invoices_on_user_id" end @@ -3111,6 +3143,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do t.integer "position" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false + t.datetime "deleted_at" t.index ["timeline_id"], name: "index_timeline_events_on_timeline_id" end @@ -3402,6 +3435,7 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "api_keys", "users" + add_foreign_key "application_integrations", "users" add_foreign_key "buildings", "universes" add_foreign_key "buildings", "users" add_foreign_key "character_birthtowns", "characters" @@ -3561,6 +3595,8 @@ ActiveRecord::Schema.define(version: 2020_07_22_004641) do add_foreign_key "group_creatures", "groups" add_foreign_key "group_creatures", "users" add_foreign_key "image_uploads", "users" + add_foreign_key "integration_authorizations", "application_integrations" + add_foreign_key "integration_authorizations", "users" add_foreign_key "item_magics", "items" add_foreign_key "item_magics", "magics" add_foreign_key "item_magics", "users" From f02cd0e0e43f6c4ac4b43ef229c78fe0f0cd519a Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 18:34:23 -0700 Subject: [PATCH 27/29] typo --- app/models/stream/content_page_share.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/stream/content_page_share.rb b/app/models/stream/content_page_share.rb index bf68edab..4d4e08bf 100644 --- a/app/models/stream/content_page_share.rb +++ b/app/models/stream/content_page_share.rb @@ -1,5 +1,5 @@ class ContentPageShare < ApplicationRecord - adds_as_paranoid + acts_as_paranoid belongs_to :user belongs_to :content_page, polymorphic: true, optional: true From af3e9f69645f4f3600e52213a80965ffb5754db5 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 19:33:50 -0700 Subject: [PATCH 28/29] add abstract PageGrouper class for later --- app/models/page_groupers/page_grouper.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/models/page_groupers/page_grouper.rb diff --git a/app/models/page_groupers/page_grouper.rb b/app/models/page_groupers/page_grouper.rb new file mode 100644 index 00000000..c1377268 --- /dev/null +++ b/app/models/page_groupers/page_grouper.rb @@ -0,0 +1,7 @@ +class PageGrouper < ApplicationRecord + self.abstract_class = true + + include HasContentLinking + + belongs_to :user, optional: true +end \ No newline at end of file From 26c85a9b0d34955694c6a5f1f82519dbfa2be491 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 29 Aug 2020 08:45:51 +0000 Subject: [PATCH 29/29] Bump sidekiq from 6.0.7 to 6.1.1 Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.0.7 to 6.1.1. - [Release notes](https://github.com/mperham/sidekiq/releases) - [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md) - [Commits](https://github.com/mperham/sidekiq/compare/v6.0.7...v6.1.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ae72adcc..0813be99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1050,7 +1050,7 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.1.7) - connection_pool (2.2.2) + connection_pool (2.2.3) crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.6) @@ -1312,8 +1312,6 @@ GEM rack-pjax (1.1.0) nokogiri (~> 1.5) rack (>= 1.1) - rack-protection (2.0.8.1) - rack rack-proxy (0.6.5) rack rack-test (1.1.0) @@ -1454,11 +1452,10 @@ GEM shellany (0.0.1) shoulda-matchers (4.3.0) activesupport (>= 4.2.0) - sidekiq (6.0.7) + sidekiq (6.1.1) connection_pool (>= 2.2.2) rack (~> 2.0) - rack-protection (>= 2.0.0) - redis (>= 4.1.0) + redis (>= 4.2.0) simplecov (0.13.0) docile (~> 1.1.0) json (>= 1.8, < 3)