docbrown/app/policies
Lawrence 0c93bde6c2
Subscribe to Comment Functionality (#19555)
* Move save over and add button labels

* comment notification design and functionality

* controller error handling

* add ternery operator for background class

* minor cleanup

* add proper styling toggles

* tests and mobile spec

* add for all buttons

* add article as a param

* comment is not required on article preview

* update policy spec

* add test for coverage

* add proper button titles

* use the last user comment as comment id

* add better error handling and remove multiple fetch calls in js

* copy change to threads

* update copy, fix multiple fetch calls, add observer for loading more notifications

* update spec

* add rspecs

* more test specs

* fix test specs

* subscribe button text tests

* add export

* optimistically update ui function tests

* button initialize test

* check for comment ancestry

* add feature flag block

* some cleanup

* update logic and specs

* oops

* rubocop issues

* change config names

* change config names

* fix spec

* add one more conditional

* check for comments

* service-object the toggler

* separate routes

* continual refactoring

* refine spec tests

* clean up policy

* Adjust js and view files to match be params

* some service object refactoring

* separate endpoints on client-side

* broken spec

* service specs

* policy spec fixes

* remove action param

* remove action param from spec

* minor updates

* trigger build

* update to post

* Services don't need permitted params

* Notifications continue to be a mess, decorator specs to follow

* Not toggling now

* This doesn't really belong here

* Fix tests after moving

* Streamline front-end

* There could be errors?

* polymorphic_name is a class thing

* ☠️ json_data in notification views

* Use feature_flag helper to get current_user

* Cannot derive current subscription status from notification, only from subscription

* Default is subscribe to all article comments

* Sync up matching unsubscribe, make subscribe idempotent-ish

* Temporarily comment-out button jest tests to see if I can unstick CI

* Stop trying to detect potential subscribe-to-comment

* Stop trying to detect potential subscribe-to-comment

* Minor spec refactoring

* Add specs for article notification decoration

* NotificationDecorator specs are rather long

* Rubocop likes it?

* Minor spec refactoring

* Doesn't need to stay pending

* Add spec for subscription finder

* Expand Subscribe service specs

* YAGNI, but I don't like hard-coded config

* Refactor Unsubscribe service specs

* nobody expects the infinite scroll

* This *might* work, except for feature flag

* Ancestry can be quite deep actually

* Rubocop

* Update subscribe button for subscribe-to-thread

* Jest tests are just tests

* hasAttribute != getAttribute

* Test knows **nothing** about window size

* Tests have been lying about mobileLabel this whole time

* Make payload/endpoint testable

* Is Jest actually happy???

* Still cleaning up jest/eslint

* Temporarily comment-out cypress tests pending feature flag

* Thanks, Rubocop, what would we do without you

* Preserve round-trip for 'top-level' and 'only-author' subscriptions

* Update specs

* Move save button icon

* Update test with better config param

* Try feature flag specific to cypress env

* Tell cypress to wait for (un)subscribing to work

---------

Co-authored-by: Lawrence S <lawrence@forem.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
2023-07-10 17:11:46 +02:00
..
admin_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
api_secret_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
application_policy.rb Try renaming moderator -> super_moderator (#18261) 2022-08-10 16:43:30 +02:00
article_policy.rb Routine rubocop fixes (#19254) 2023-03-24 14:37:44 +03:00
authorizer.rb Clear trusted cache in rolify callback (#19275) 2023-04-03 14:45:00 +02:00
comment_policy.rb Subscribe to Comment Functionality (#19555) 2023-07-10 17:11:46 +02:00
consumer_app_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
discussion_lock_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
follow_policy.rb Adjusting suspended user authorizations (#16634) 2022-02-21 10:08:24 -05:00
github_repo_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
html_variant_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
image_upload_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
internal_policy.rb Refactoring questions asked of user (#15762) 2021-12-21 12:45:12 -05:00
liquid_tag_policy.rb small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
listing_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
message_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
organization_policy.rb Ensuring the same policies for analytics (#16997) 2022-03-25 14:57:01 -04:00
pinned_article_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
rating_vote_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
reaction_policy.rb Refactor reaction categories as abstract class collection (#18540) 2022-11-01 10:50:37 +01:00
registration_policy.rb Refactor RegistrationsController (#13903) 2021-06-08 17:03:41 -04:00
response_template_policy.rb Change requirement for response_template (#18601) 2022-11-02 12:16:17 -04:00
role_policy.rb allows super_admin user to remove super_admin role (#19590) 2023-06-21 11:22:25 -04:00
space_policy.rb Penciling in a Default Spaces section (#16897) 2022-03-21 09:56:12 -04:00
stripe_active_card_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
stripe_subscription_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
tag_policy.rb Renaming policy methods for consistency (#16523) 2022-02-11 09:10:54 -05:00
user_block_policy.rb Favoring method aliasing over explicit delegation (#16526) 2022-02-10 11:09:17 -05:00
user_policy.rb Try renaming moderator -> super_moderator (#18261) 2022-08-10 16:43:30 +02:00
video_policy.rb Ensuring the VideoPolicy adhears to article creation (#16762) 2022-03-07 15:27:18 -05:00