From e68b344cc239f874dc87addf889da7b9116145b6 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 11 Sep 2025 12:34:31 -0500 Subject: [PATCH] Remove _Everything_ inolvement --- app/assets/images/notification-bell-everything.svg | 1 - app/assets/images/notification-bell-watching.svg | 2 +- app/assets/stylesheets/icons.css | 1 - app/helpers/accesses_helper.rb | 10 ++++------ app/models/access.rb | 2 +- app/models/card/watchable.rb | 2 +- test/models/card/watchable_test.rb | 2 +- test/models/notifier/event_notifier_test.rb | 2 +- 8 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 app/assets/images/notification-bell-everything.svg diff --git a/app/assets/images/notification-bell-everything.svg b/app/assets/images/notification-bell-everything.svg deleted file mode 100644 index 52a5611fb..000000000 --- a/app/assets/images/notification-bell-everything.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/images/notification-bell-watching.svg b/app/assets/images/notification-bell-watching.svg index 05827531d..52a5611fb 100644 --- a/app/assets/images/notification-bell-watching.svg +++ b/app/assets/images/notification-bell-watching.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/assets/stylesheets/icons.css b/app/assets/stylesheets/icons.css index 8b1e2421d..7d135bf49 100644 --- a/app/assets/stylesheets/icons.css +++ b/app/assets/stylesheets/icons.css @@ -61,7 +61,6 @@ .icon--minus { --svg: url("minus.svg "); } .icon--move { --svg: url("move.svg "); } .icon--notification-bell-access-only { --svg: url("notification-bell-access-only.svg "); } - .icon--notification-bell-everything { --svg: url("notification-bell-everything.svg "); } .icon--notification-bell-watching { --svg: url("notification-bell-watching.svg "); } .icon--password { --svg: url("password.svg "); } .icon--pencil { --svg: url("pencil.svg "); } diff --git a/app/helpers/accesses_helper.rb b/app/helpers/accesses_helper.rb index 5eb39466c..3dd935214 100644 --- a/app/helpers/accesses_helper.rb +++ b/app/helpers/accesses_helper.rb @@ -21,7 +21,7 @@ module AccessesHelper turbo_frame_tag dom_id(collection, :involvement_button) do button_to collection_involvement_path(collection), method: :put, aria: { labelledby: dom_id(collection, :involvement_label) }, - class: [ "btn tooltip", { "btn--reversed": access.involvement == "watching" || access.involvement == "everything" } ], + class: [ "btn tooltip", { "btn--reversed": access.involvement == "watching" } ], params: { involvement: next_involvement(access.involvement) } do icon_tag("notification-bell-#{access.involvement.dasherize}") + tag.span(involvement_access_label(collection, access.involvement), class: "for-screen-reader", id: dom_id(collection, :involvement_label)) @@ -31,18 +31,16 @@ module AccessesHelper private def next_involvement(involvement) - order = %w[ everything watching access_only ] + order = %w[ watching access_only ] order[(order.index(involvement.to_s) + 1) % order.size] end def involvement_access_label(collection, involvement) case involvement when "access_only" - "Notifications are off for #{collection.name}" - when "everything" - "Notifying me about everything in #{collection.name}" + "Not watching #{collection.name}" when "watching" - "Notifying me only about @mentions and new items in #{collection.name}" + "Watching #{collection.name}" end end end diff --git a/app/models/access.rb b/app/models/access.rb index 88303bd15..c761fc7ba 100644 --- a/app/models/access.rb +++ b/app/models/access.rb @@ -2,7 +2,7 @@ class Access < ApplicationRecord belongs_to :collection belongs_to :user - enum :involvement, %i[ access_only watching everything ].index_by(&:itself) + enum :involvement, %i[ access_only watching ].index_by(&:itself) scope :ordered_by_recently_accessed, -> { order(accessed_at: :desc) } diff --git a/app/models/card/watchable.rb b/app/models/card/watchable.rb index f511ddc7e..883975398 100644 --- a/app/models/card/watchable.rb +++ b/app/models/card/watchable.rb @@ -21,7 +21,7 @@ module Card::Watchable end def watchers_and_subscribers(include_only_watching: false) - involvements = include_only_watching ? [ :watching, :everything ] : :everything + involvements = include_only_watching ? [ :watching ] : [] subscribers = collection.users.where(accesses: { involvement: involvements }) User.where(id: subscribers.pluck(:id) + diff --git a/test/models/card/watchable_test.rb b/test/models/card/watchable_test.rb index a2aa6e103..2c0328026 100644 --- a/test/models/card/watchable_test.rb +++ b/test/models/card/watchable_test.rb @@ -32,7 +32,7 @@ class Card::WatchableTest < ActiveSupport::TestCase test "watchers_and_subscribers" do collections(:writebook).access_for(users(:kevin)).watching! - collections(:writebook).access_for(users(:jz)).everything! + collections(:writebook).access_for(users(:jz)).watching! cards(:logo).watch_by users(:kevin) cards(:logo).unwatch_by users(:jz) diff --git a/test/models/notifier/event_notifier_test.rb b/test/models/notifier/event_notifier_test.rb index 2a99a2d39..395d5bfa1 100644 --- a/test/models/notifier/event_notifier_test.rb +++ b/test/models/notifier/event_notifier_test.rb @@ -48,7 +48,7 @@ class Notifier::EventNotifierTest < ActiveSupport::TestCase test "assignment events only create a notification for the assignee" do collections(:writebook).access_for(users(:jz)).watching! - collections(:writebook).access_for(users(:kevin)).everything! + collections(:writebook).access_for(users(:kevin)).watching! notifications = Notifier.for(events(:logo_assignment_jz)).notify