From 2c3de4a0e30c04830469433d42b713e3bbcacd04 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 20 Jul 2022 07:50:57 +0000
Subject: [PATCH 01/16] Bump terser from 4.8.0 to 4.8.1
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)
---
updated-dependencies:
- dependency-name: terser
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
---
yarn.lock | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index cc7542dd..2c7b0eae 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1735,9 +1735,9 @@ browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.16.6, browserslist@^4
node-releases "^1.1.71"
buffer-from@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
- integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
+ integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
buffer-indexof@^1.0.0:
version "1.1.1"
@@ -6332,9 +6332,9 @@ source-map-resolve@^0.5.0:
urix "^0.1.0"
source-map-support@~0.5.12, source-map-support@~0.5.19:
- version "0.5.19"
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
- integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
+ version "0.5.21"
+ resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
+ integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
@@ -6626,9 +6626,9 @@ terser-webpack-plugin@^4.2.3:
webpack-sources "^1.4.3"
terser@^4.1.2:
- version "4.8.0"
- resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17"
- integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==
+ version "4.8.1"
+ resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f"
+ integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==
dependencies:
commander "^2.20.0"
source-map "~0.6.1"
From 5fce735f95cdc49bf603acb8e1a7a579eed9a17c Mon Sep 17 00:00:00 2001
From: drusepth
Date: Sun, 7 Aug 2022 15:36:25 -0700
Subject: [PATCH 02/16] funny rhymey words
---
app/services/forum_replacement_service.rb | 29 ++++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/app/services/forum_replacement_service.rb b/app/services/forum_replacement_service.rb
index 8eb38abe..d0fa9a56 100644
--- a/app/services/forum_replacement_service.rb
+++ b/app/services/forum_replacement_service.rb
@@ -126,10 +126,12 @@ class ForumReplacementService < Service
'computers' => 'electrical miracleboxes',
'confuse' => 'bumfuzzle',
'confused' => 'bumfuzzled',
- 'cookie' => 'choco chip bicky wicky',
- 'cookies' => 'choco chip bicky wickies',
+ 'cookie' => 'naughty biscotti',
+ 'cookies' => 'naughty biscottis',
'counterclockwise' => 'widdershin',
'courtroom' => 'legal objectionbox',
+ 'cowboy' => 'colorado desparado',
+ 'cowboys' => 'colorado desparados',
'cranberry' => 'wild redbean',
'crazy' => 'bonkers',
'cumberbatch' => 'Cramplescrunch',
@@ -146,8 +148,8 @@ class ForumReplacementService < Service
'doorknob' => 'twisting plankhandle',
'doorknobs' => 'twisting plankhandles',
'doors' => 'wobbly flip-shutters',
- 'dragon' => "big boppin' fire droppin' flyin' thing",
- 'dragons' => "big boppin' fire droppin' flyin' things",
+ 'dragon' => "wizard lizard",
+ 'dragons' => "wizard lizards",
'earth' => 'earth',
'electric' => 'electric',
'end my suffering' => "I'm having an absolutely fine time",
@@ -166,6 +168,8 @@ class ForumReplacementService < Service
'fireworks' => 'merry fizzlebombs',
'fish' => 'aquatic blooper',
'fishes' => 'aquatic bloopers',
+ 'flower' => 'frilly lily',
+ 'flowers' => 'frilly lilies',
'fortnite' => 'hippity buildershooter',
'forums' => 'words warehouse',
'foo' => '',
@@ -196,6 +200,7 @@ class ForumReplacementService < Service
'hip' => 'hep',
'history' => 'lastpast yesteryear',
'homework' => 'timey wimey studystruggles',
+ 'honey' => 'bees cheese',
'hot chocolate' => 'boiled chocowater',
'ice cold' => 'cooler than being cool',
'icky' => 'oofy doofy',
@@ -218,6 +223,8 @@ class ForumReplacementService < Service
'lightbulb' => 'ceiling-bright',
'lightbulbs' => 'ceiling-brights',
'lizard people' => 'definitely normal human beings',
+ 'llama' => 'coat goat',
+ 'llamas' => 'coat goats',
'lock' => 'lumberlatch',
'locks' => 'lumberlatches',
'marker' => 'crockety snapwicket',
@@ -231,8 +238,8 @@ class ForumReplacementService < Service
'mittens' => 'hand socks',
'money' => 'molded cheddar',
'moon' => 'night cheese',
- 'mosquito' => 'buzzy itchybee',
- 'mosquitoes' => 'buzzy itchybees',
+ 'mosquito' => 'mighty bitey',
+ 'mosquitoes' => 'mighty biteys',
'movie' => 'magical moving picture',
'movies' => 'magical moving pictures',
'murder' => 'mucduc',
@@ -240,11 +247,15 @@ class ForumReplacementService < Service
'netflix and chill' => 'hulu and vibe',
'nice' => 'noice',
'night' => 'shadowtime',
+ 'novel' => 'fiction depiction',
+ 'novels' => 'fiction depictions',
'nugget' => "lil' nuggy",
'nuggets' => "lil' nuggies",
'oh no' => '
',
'offensive' => 'bogue',
'oof' => '',
+ 'oven' => 'boiler-broiler roasty-toasty',
+ 'ovens' => 'boiler-broiler roasty-toasties',
'owo' => '(◕‿◕✿)',
'pancake' => 'roundy-yum',
'pancakes' => 'roundy-yums',
@@ -275,6 +286,8 @@ class ForumReplacementService < Service
'reverse' => 'esrever',
'road' => 'cobble-stone-clippity-clop',
'roads' => 'cobble-stone-clippity-clops',
+ 'rocking chair' => 'knitter-sitter',
+ 'rocking chairs' => 'knitter-sitters',
'room' => 'human containment unit',
'same' => 'same',
'sandwich' => 'breaddystack',
@@ -288,6 +301,8 @@ class ForumReplacementService < Service
'shenanigans' => 'silly fun',
'shoe' => 'leather winklepicker',
'shoes' => 'leather winklepickers',
+ 'shrimp' => 'chill krill',
+ 'shrimps' => 'chill krills',
'sick' => 'collywobble icky',
'skiing' => 'slippery snownoodle moving',
'skydiving' => 'falling out of the sky',
@@ -310,6 +325,8 @@ class ForumReplacementService < Service
'stupid' => 'stoopid',
'success' => 'Yahtzee!',
'summer' => 'sunseason',
+ 'sunset' => 'skylight twilight',
+ 'sunsets' => 'skylight twilights',
'sup' => 'soup',
'sweater' => 'sheepity sleepity',
'sweaters' => 'sheepity sleepities',
From 52ca00c9e00d65c4a72cb26386c5f0360110b101 Mon Sep 17 00:00:00 2001
From: drusepth
Date: Wed, 10 Aug 2022 17:46:36 -0700
Subject: [PATCH 03/16] allow users to edit zeroed-out universe links
---
app/views/content/display/attribute_value/_universe.html.erb | 1 +
app/views/content/form/field_types/_universe.html.erb | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/views/content/display/attribute_value/_universe.html.erb b/app/views/content/display/attribute_value/_universe.html.erb
index d7b08180..6c5e9ed5 100644
--- a/app/views/content/display/attribute_value/_universe.html.erb
+++ b/app/views/content/display/attribute_value/_universe.html.erb
@@ -1,4 +1,5 @@
<%# Treat universe values as if they're just link fields %>
+
<%=
render partial: "content/display/attribute_value/link",
locals: { value: value.map { |universe| "Universe-#{universe.id}" }, content: content }
diff --git a/app/views/content/form/field_types/_universe.html.erb b/app/views/content/form/field_types/_universe.html.erb
index 4854f792..5e0b26b2 100644
--- a/app/views/content/form/field_types/_universe.html.erb
+++ b/app/views/content/form/field_types/_universe.html.erb
@@ -5,7 +5,7 @@
<%= f.label field[:id], field[:label] %>
- <% if !page.persisted? || (page.persisted? && page.universe && page.universe.user == current_user) || page.universe_id.nil? %>
+ <% if page.new_record? || (page.persisted? && page.universe && page.universe.user == current_user) || page.universe_id.nil? # || page.universe_id.zero? %>
<%# todo not like this %>
<%
valid_universes = []
From bf7a83dc724d188124ad5ee3682e93f0d91235ff Mon Sep 17 00:00:00 2001
From: drusepth
Date: Wed, 10 Aug 2022 17:51:06 -0700
Subject: [PATCH 04/16] allow users to edit the universe of their premium pages
even if they're not actively premium
---
app/views/content/form/field_types/_universe.html.erb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/views/content/form/field_types/_universe.html.erb b/app/views/content/form/field_types/_universe.html.erb
index 5e0b26b2..c44996fb 100644
--- a/app/views/content/form/field_types/_universe.html.erb
+++ b/app/views/content/form/field_types/_universe.html.erb
@@ -17,13 +17,15 @@
else
# Premium content
if current_user.on_premium_plan? \
- || PermissionService.user_has_active_promotion_for_this_content_type(user: current_user, content_type: page.class.name)
+ || PermissionService.user_has_active_promotion_for_this_content_type(user: current_user, content_type: page.class.name) \
+ || page.user == current_user
valid_universes += current_user.universes
# Allow premium users to add premium content to non-premium universes
valid_universes += current_user.contributable_universes
else
+
show_premium_notice = true
end
From 417970d403d57011a3dadb688ac7f08eba96da99 Mon Sep 17 00:00:00 2001
From: drusepth
Date: Wed, 10 Aug 2022 17:51:44 -0700
Subject: [PATCH 05/16] update footer year (woo)
---
app/javascript/components/Footer.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/javascript/components/Footer.js b/app/javascript/components/Footer.js
index f9354f26..012fad14 100644
--- a/app/javascript/components/Footer.js
+++ b/app/javascript/components/Footer.js
@@ -22,7 +22,7 @@ class Footer extends React.Component {
- Notebook.ai © 2016-2021
+ Notebook.ai © 2016-2022
Indent Labs, LLC
From 5b757964307c8055448ea717ab11b80d90577269 Mon Sep 17 00:00:00 2001
From: drusepth
Date: Thu, 11 Aug 2022 13:25:07 -0700
Subject: [PATCH 06/16] upgrade ruby 2.7.5 -> 2.7.6
---
.ruby-version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.ruby-version b/.ruby-version
index 460b6fd4..5b013b97 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.7.5
\ No newline at end of file
+2.7.6
\ No newline at end of file
From 34a0a10d593caec6258f50116ea18c22f67300a7 Mon Sep 17 00:00:00 2001
From: drusepth
Date: Fri, 12 Aug 2022 15:41:31 -0700
Subject: [PATCH 07/16] strip out deleted te entry links
---
app/views/timelines/edit.html.erb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/views/timelines/edit.html.erb b/app/views/timelines/edit.html.erb
index 0f14ce5c..0a2846c2 100644
--- a/app/views/timelines/edit.html.erb
+++ b/app/views/timelines/edit.html.erb
@@ -229,6 +229,7 @@
<% event.timeline_event_entities.order('entity_type').preload(:entity).group_by(&:entity_type).each do |entity_type, entity_list| %>
+ <% entity_list.reject! { |te_entity| te_entity.entity.nil? } %>
-
<% klass = content_class_from_name(entity_type) %>
<% event_entities.each do |entity_type, entity_list| %>
+ <% entity_list.reject! { |te_entity| te_entity.entity.nil? } %>
-
<% klass = content_class_from_name(entity_type) %>
<% else %>
-
<%
# Mute the post if it's one line that starts with ( and ends with )
muted_post = post.present? && post.to_model.content.split("\n").reject(&:empty?).all? { |paragraph| paragraph.strip.start_with?('(') && paragraph.strip.end_with?(')') }
@@ -29,4 +28,4 @@
<% end %>
<% end %>
-<% end %>
\ No newline at end of file
+<% end %>
diff --git a/app/views/thredded/posts_common/_actions2.html.erb b/app/views/thredded/posts_common/_actions2.html.erb
new file mode 100644
index 00000000..60761c31
--- /dev/null
+++ b/app/views/thredded/posts_common/_actions2.html.erb
@@ -0,0 +1,27 @@
+<% actions ||= {} %>
+<% actions_html = capture do %>
+ <%= view_hooks.post_common.actions.render self, post: post do %>
+ <% if actions[:quote] && post.can_reply? %>
+ <%= render 'thredded/posts_common/actions/quote', post: post %>
+ <% end %>
+ <% if post.can_update? %>
+ <%= render 'thredded/posts_common/actions/edit', post: post %>
+ <% end %>
+ <% if post.can_destroy? %>
+ <%= render 'thredded/posts_common/actions/delete', post: post %>
+ <% end %>
+ <% if post.read_state %>
+ <%= view_hooks.post_common.mark_as_unread.render self, post: post do %>
+ <%= render 'thredded/posts_common/actions/mark_as_unread', post: post %>
+ <% end %>
+ <% end %>
+ <% end %>
+<% end %>
+<%- if actions_html.present? %>
+
+ <%= inline_svg_tag 'thredded/three-dot-menu.svg', class: 'thredded--post--dropdown--toggle' %>
+
+ <%= actions_html %>
+
+
+<% end %>
\ No newline at end of file
diff --git a/db/migrate/20220816051024_add_thredded_moderation_indices.rb b/db/migrate/20220816051024_add_thredded_moderation_indices.rb
new file mode 100644
index 00000000..97cf65aa
--- /dev/null
+++ b/db/migrate/20220816051024_add_thredded_moderation_indices.rb
@@ -0,0 +1,6 @@
+class AddThreddedModerationIndices < ActiveRecord::Migration[6.1]
+ def change
+ add_index :thredded_posts, :created_at
+ add_index :thredded_posts, [:created_at, :postable_id]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 187d87ad..a9fdac14 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: 2021_10_27_065954) do
+ActiveRecord::Schema.define(version: 2022_08_16_051024) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
@@ -3184,6 +3184,8 @@ ActiveRecord::Schema.define(version: 2021_10_27_065954) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "deleted_at"
+ t.index ["created_at", "postable_id"], name: "index_thredded_posts_on_created_at_and_postable_id"
+ t.index ["created_at"], name: "index_thredded_posts_on_created_at"
t.index ["deleted_at", "messageboard_id"], name: "index_thredded_posts_on_deleted_at_and_messageboard_id"
t.index ["deleted_at", "postable_id"], name: "index_thredded_posts_on_deleted_at_and_postable_id"
t.index ["deleted_at", "user_id"], name: "index_thredded_posts_on_deleted_at_and_user_id"
From bda757f343f1e917041c9bd891e54deab527a324 Mon Sep 17 00:00:00 2001
From: drusepth
Date: Wed, 17 Aug 2022 14:52:42 -0700
Subject: [PATCH 11/16] add index for [deleted_at, id] on thredded
---
Gemfile | 2 +-
Gemfile.lock | 2 +-
app/views/thredded/users/_link.html.erb | 6 ++++++
...0220817213907_add_deleted_at_and_id_index_to_thredded.rb | 5 +++++
db/schema.rb | 3 ++-
5 files changed, 15 insertions(+), 3 deletions(-)
create mode 100644 db/migrate/20220817213907_add_deleted_at_and_id_index_to_thredded.rb
diff --git a/Gemfile b/Gemfile
index 9bda1734..c4a649e9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -76,7 +76,7 @@ gem 'barnes'
gem 'thredded', git: 'https://github.com/indentlabs/thredded.git', branch: 'feature/report-posts'
# gem 'thredded', path: "../thredded"
-# gem 'thredded', git: 'https://github.com/thredded/thredded', branch: 'master'
+# gem 'thredded'
# gem 'thredded', git: 'https://github.com/sudara/thredded', branch: 'master'
gem 'rails-ujs'
diff --git a/Gemfile.lock b/Gemfile.lock
index 23c1f334..670e9524 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -26,7 +26,7 @@ GIT
GIT
remote: https://github.com/indentlabs/thredded.git
- revision: 262c55ba1777304061bec5c6c3b99a67ddfb8864
+ revision: f5200ea1a4311791552b99c9ce8c2f023c521bf1
branch: feature/report-posts
specs:
thredded (1.0.1)
diff --git a/app/views/thredded/users/_link.html.erb b/app/views/thredded/users/_link.html.erb
index 6268cc76..66736bd7 100644
--- a/app/views/thredded/users/_link.html.erb
+++ b/app/views/thredded/users/_link.html.erb
@@ -6,8 +6,14 @@
<%= user.thredded_display_name %>
<% else %>
+
<%= user.thredded_display_name %>
+ <% if user.forum_moderator? %>
+
+ health_and_safety
+
+ <% end %>
<%= render partial: 'thredded/users/badge', locals: { user: user } %>
<% end %>
diff --git a/db/migrate/20220817213907_add_deleted_at_and_id_index_to_thredded.rb b/db/migrate/20220817213907_add_deleted_at_and_id_index_to_thredded.rb
new file mode 100644
index 00000000..98215b49
--- /dev/null
+++ b/db/migrate/20220817213907_add_deleted_at_and_id_index_to_thredded.rb
@@ -0,0 +1,5 @@
+class AddDeletedAtAndIdIndexToThredded < ActiveRecord::Migration[6.1]
+ def change
+ add_index :thredded_posts, [:id, :deleted_at]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a9fdac14..99fc2352 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: 2022_08_16_051024) do
+ActiveRecord::Schema.define(version: 2022_08_17_213907) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
@@ -3190,6 +3190,7 @@ ActiveRecord::Schema.define(version: 2022_08_16_051024) do
t.index ["deleted_at", "postable_id"], name: "index_thredded_posts_on_deleted_at_and_postable_id"
t.index ["deleted_at", "user_id"], name: "index_thredded_posts_on_deleted_at_and_user_id"
t.index ["deleted_at"], name: "index_thredded_posts_on_deleted_at"
+ t.index ["id", "deleted_at"], name: "index_thredded_posts_on_id_and_deleted_at"
t.index ["messageboard_id"], name: "index_thredded_posts_on_messageboard_id"
t.index ["moderation_state", "updated_at"], name: "index_thredded_posts_for_display"
t.index ["postable_id"], name: "index_thredded_posts_on_postable_id"
From f09270737fbf304dc82ba29e4972dd3bfbfec69d Mon Sep 17 00:00:00 2001
From: drusepth
Date: Wed, 17 Aug 2022 23:31:55 -0700
Subject: [PATCH 12/16] yaml fallback for changelogs
---
app/controllers/content_controller.rb | 5 ++++-
app/models/concerns/has_changelog.rb | 1 +
config/environments/development.rb | 4 ++++
config/environments/production.rb | 4 ++++
4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb
index 8d115431..94b4282e 100644
--- a/app/controllers/content_controller.rb
+++ b/app/controllers/content_controller.rb
@@ -508,7 +508,10 @@ class ContentController < ApplicationController
@attribute_field = AttributeField.find_by(id: params[:field_id].to_i)
attribute_value = @attribute_field.attribute_values.order('created_at desc').find_or_initialize_by(entity_params)
attribute_value.user_id ||= current_user.id
- attribute_value.value = field_params.fetch('value', '').to_i
+
+ new_universe_id = field_params.fetch('value', nil).to_i
+ new_universe_id = nil if new_universe_id == 0
+ attribute_value.value = new_universe_id
attribute_value.save!
@content = entity_params.fetch('entity_type').constantize.find_by(
diff --git a/app/models/concerns/has_changelog.rb b/app/models/concerns/has_changelog.rb
index 2d543733..5dc9eab6 100644
--- a/app/models/concerns/has_changelog.rb
+++ b/app/models/concerns/has_changelog.rb
@@ -40,6 +40,7 @@ module HasChangelog
before_update do
if self.is_a?(Attribute)
# todo how to get current_user?
+
ContentChangeEvent.create(
user: find_current_user,
changed_fields: changes,
diff --git a/config/environments/development.rb b/config/environments/development.rb
index eef5b034..121334cb 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -59,6 +59,10 @@ Rails.application.configure do
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
+ # Whitelist HashWithIndifferentAccess/TimeWithZone for changelog serialization
+ # config.active_record.yaml_column_permitted_classes = [HashWithIndifferentAccess, ActiveSupport::TimeWithZone, Time]
+ config.active_record.use_yaml_unsafe_load = true
+
# Set test-mode Stripe API key
Stripe.api_key = "sk_test_v37uWbseyPct6PpsfjTa3y1l"
config.stripe_publishable_key = 'pk_test_eXI4iyJ2gR9UOGJyJERvDlHF'
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 5d65c2ce..7bd937d7 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -91,6 +91,10 @@ Rails.application.configure do
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
+ # Whitelist HashWithIndifferentAccess/TimeWithZone for changelog serialization
+ # config.active_record.yaml_column_permitted_classes = [HashWithIndifferentAccess, ActiveSupport::TimeWithZone, Time]
+ config.active_record.use_yaml_unsafe_load = true
+
# Devise default url options
config.action_mailer.default_url_options = { host: 'www.notebook.ai' }
config.active_job.default_url_options = { host: 'www.notebook.ai' }
From 42038c49c2c4722a7b95d4d34b3f39376fcda899 Mon Sep 17 00:00:00 2001
From: drusepth
Date: Wed, 17 Aug 2022 23:33:22 -0700
Subject: [PATCH 13/16] unused partial
---
.../thredded/posts_common/_actions2.html.erb | 27 -------------------
1 file changed, 27 deletions(-)
delete mode 100644 app/views/thredded/posts_common/_actions2.html.erb
diff --git a/app/views/thredded/posts_common/_actions2.html.erb b/app/views/thredded/posts_common/_actions2.html.erb
deleted file mode 100644
index 60761c31..00000000
--- a/app/views/thredded/posts_common/_actions2.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<% actions ||= {} %>
-<% actions_html = capture do %>
- <%= view_hooks.post_common.actions.render self, post: post do %>
- <% if actions[:quote] && post.can_reply? %>
- <%= render 'thredded/posts_common/actions/quote', post: post %>
- <% end %>
- <% if post.can_update? %>
- <%= render 'thredded/posts_common/actions/edit', post: post %>
- <% end %>
- <% if post.can_destroy? %>
- <%= render 'thredded/posts_common/actions/delete', post: post %>
- <% end %>
- <% if post.read_state %>
- <%= view_hooks.post_common.mark_as_unread.render self, post: post do %>
- <%= render 'thredded/posts_common/actions/mark_as_unread', post: post %>
- <% end %>
- <% end %>
- <% end %>
-<% end %>
-<%- if actions_html.present? %>
-
- <%= inline_svg_tag 'thredded/three-dot-menu.svg', class: 'thredded--post--dropdown--toggle' %>
-
- <%= actions_html %>
-
-
-<% end %>
\ No newline at end of file
From 5b0413b2cbf3458b20f367b592917eea5fb818fe Mon Sep 17 00:00:00 2001
From: drusepth
Date: Thu, 18 Aug 2022 00:16:04 -0700
Subject: [PATCH 14/16] pull in thredded update
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 670e9524..b1df213f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -26,7 +26,7 @@ GIT
GIT
remote: https://github.com/indentlabs/thredded.git
- revision: f5200ea1a4311791552b99c9ce8c2f023c521bf1
+ revision: edd58a785cd18fb2d7967c1f74aeaa92d3d82fbd
branch: feature/report-posts
specs:
thredded (1.0.1)
From 9b1ba3fdad484bdda2e7f48dfb736e2050aa48fe Mon Sep 17 00:00:00 2001
From: drusepth
Date: Sat, 20 Aug 2022 11:38:47 -0700
Subject: [PATCH 15/16] don't leave orphan folders when deleting folders
---
app/controllers/folders_controller.rb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app/controllers/folders_controller.rb b/app/controllers/folders_controller.rb
index cb5b5282..715b90ee 100644
--- a/app/controllers/folders_controller.rb
+++ b/app/controllers/folders_controller.rb
@@ -16,8 +16,12 @@ class FoldersController < ApplicationController
end
def destroy
+ # Relocate all documents in this folder to the root "folder"
Document.where(folder_id: @folder.id).update_all(folder_id: nil)
+ # Relocate all child folders in this folder to the root "folder"
+ Folder.where(parent_folder_id: @folder.id).update_all(folder_id: nil)
+
@folder.destroy!
redirect_to(documents_path, notice: "Folder #{@folder.title} deleted!")
end
From 7012e31dfdd986f085cb180bf3aa4edad3e8317f Mon Sep 17 00:00:00 2001
From: drusepth
Date: Sat, 20 Aug 2022 12:14:51 -0700
Subject: [PATCH 16/16] don't error if IBM Watson changes api schema
---
.../documents/analysis/third_party/ibm_watson_service.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/services/documents/analysis/third_party/ibm_watson_service.rb b/app/services/documents/analysis/third_party/ibm_watson_service.rb
index 34b2526d..0535f70a 100644
--- a/app/services/documents/analysis/third_party/ibm_watson_service.rb
+++ b/app/services/documents/analysis/third_party/ibm_watson_service.rb
@@ -44,7 +44,7 @@ module Documents
# }
# ]
analysis.document_entities = []
- watson.dig('entities').each do |entity|
+ watson.fetch('entities', []).each do |entity|
analysis.document_entities.build(
entity_type: entity_type_map_to_notebook_entity_type.fetch(entity.dig('type'), entity.dig('type')),
text: entity.dig('text'),
@@ -67,7 +67,7 @@ module Documents
# "dbpedia_resource": "http://dbpedia.org/resource/Jeph_Loeb"
# },
analysis.document_concepts = []
- watson.dig('concepts').each do |concept|
+ watson.fetch('concepts', []).each do |concept|
analysis.document_concepts.build(
text: concept.dig('text'),
relevance: concept.dig('relevance'),
@@ -83,7 +83,7 @@ module Documents
# }
# ]
analysis.document_categories = []
- watson.dig('categories').each do |category|
+ watson.fetch('categories', []).each do |category|
analysis.document_categories.build(
label: category.dig('label'),
score: category.dig('score')