Remove _Everything_ inolvement

This commit is contained in:
Jason Zimdars
2025-09-11 12:34:31 -05:00
parent 2a3cb28891
commit e68b344cc2
8 changed files with 9 additions and 13 deletions
@@ -1 +0,0 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m21 17.5a1.5 1.5 0 0 1 -1.5-1.5v-4.862a7.957 7.957 0 0 0 -6.5-8.065v-2.073a1 1 0 0 0 -2 0v2.073a7.957 7.957 0 0 0 -6.5 8.065v4.862a1.5 1.5 0 0 1 -1.5 1.5 1 1 0 0 0 0 2h18a1 1 0 0 0 0-2z"/><path d="m14.236 21h-4.472a.25.25 0 0 0 -.248.222 2.319 2.319 0 0 0 -.016.278 2.5 2.5 0 1 0 5 0 2.319 2.319 0 0 0 -.016-.278.248.248 0 0 0 -.248-.222z"/></svg>

Before

Width:  |  Height:  |  Size: 416 B

@@ -1 +1 @@
<svg enable-background="new 0 0 24 24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m7 16.4c0-5 4-9 9-9 1.1 0 2.2.2 3.2.6-.6-1.8-1.8-3.3-3.3-4.4-.7-.5-1.5-.8-2.3-.9v-1.2c-.1-.8-.8-1.5-1.6-1.5s-1.5.7-1.5 1.5v1.1c-1 .2-2 .6-2.9 1.3-2.2 1.8-3.4 4.4-3.3 7.2v.8c0 2.5-.6 5.1-1.7 7.3-.1.2 0 .5.2.7 0 .1.1.1.2.1h4.7c-.4-1.1-.7-2.3-.7-3.6z"/><path d="m22.1 11.4c-1.6-1.6-3.9-2.4-6.2-2.3-4.1 0-7.4 3.3-7.4 7.4s3.3 7.4 7.4 7.4c.7 0 1.5-.1 2.2-.3.5-.1.8-.7.6-1.2s-.7-.8-1.2-.6c-2.9.9-6-.7-6.9-3.6s.7-6 3.6-6.9c.5-.2 1.1-.2 1.6-.2 1.8-.1 3.5.5 4.8 1.7.9.9 1.4 2.1 1.4 3.4s-.6 2.6-1.5 2.6c-.1 0-.2 0-.3 0v-5c0-.5-.4-.9-.9-.9-.3 0-.6.2-.8.5-.7-.6-1.6-.9-2.5-.9-2.3 0-4.1 1.8-4.1 4.1s1.8 4.1 4.1 4.1c1 0 1.9-.3 2.6-1 .1.2.2.3.3.4.5.4 1.1.6 1.7.6 2 0 3.4-1.9 3.4-4.5 0-1.8-.7-3.5-1.9-4.8zm-6.2 7.4c-1.2 0-2.2-1-2.2-2.2s1-2.2 2.2-2.2 2.2 1 2.2 2.2-1 2.2-2.2 2.2z"/></svg>
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m21 17.5a1.5 1.5 0 0 1 -1.5-1.5v-4.862a7.957 7.957 0 0 0 -6.5-8.065v-2.073a1 1 0 0 0 -2 0v2.073a7.957 7.957 0 0 0 -6.5 8.065v4.862a1.5 1.5 0 0 1 -1.5 1.5 1 1 0 0 0 0 2h18a1 1 0 0 0 0-2z"/><path d="m14.236 21h-4.472a.25.25 0 0 0 -.248.222 2.319 2.319 0 0 0 -.016.278 2.5 2.5 0 1 0 5 0 2.319 2.319 0 0 0 -.016-.278.248.248 0 0 0 -.248-.222z"/></svg>

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 416 B

-1
View File
@@ -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 "); }
+4 -6
View File
@@ -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
+1 -1
View File
@@ -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) }
+1 -1
View File
@@ -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) +
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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