docbrown/app/policies
rhymes 99ddd31058
Pin posts to feed (#13807)
* Add SiteConfig.feed_pinned_article and validation

* Display pinned article at the top of feed

* Add (basic) functionality to pin/unpin post

* Admins can pin other users posts as well

* Hide the button if looking at the non pinned post

* Add pinned/unpinned snackbar message

* Rename SiteConfig usage to Settings::General

* Add pinned article to the Admin articles index

* Show the pin post button when there's no pinned article

* Move pinning to a separate controller

* Fix SiteConfig reference

* Hide PinController actions to unauthorized users

* PinnedArticlesController#show action and refactor some of the code

* Add Modal interaction

* Fix modal-pinned checkbox interaction

* Fixed pin/unpin post

* Add ArticleDecorator#pinned? specs

* Add PinnedArticlePolicy and PinnedArticlesController specs

* Add ability to actually pin an article from the admin after submit

* Add partial Cypress pin/unpin spec

* Fix pinned article and add basic Cypress interaction tests

* Add Crayons styling to modal

* Only render the pinned article on the default Feed page

* Use persisted?

* Add some comments

* Update app/javascript/articles/Article.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/javascript/packs/homePageFeed.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Fix Cypress tests

* Update app/javascript/admin/controllers/article_controller.js

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Fix pinning in article show page

* Used PinnedArticle domain model

* Fix spec

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/articleFlows/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/articleFlows/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/articles/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Fix merge woes

* Add missing article pin post flows

* Add missing admin article flows

* Add Unpin to Admin as well

* Add Audit::Log entries for pin/unpin actions

* Update app/controllers/stories/feeds_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Do not rate limit in E2E tests

* Use .find instead of .filter

* Rename ArticleIdValidator to ExistingArticleIdValidator

* Treat draft and deleted articles the same

* Make sure posts can be pinned after the pinned article is unpublished or deleted

* Use .get directly

* Fix spec and fix PinnedArticlesController#show

* Strengthen pinArticle Cypress tests

* Add Cypress test heading guard

* Add another Cypress test heading guard

* Remove duplicate validator

* Try using the Tools: header instead of the article title

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-06-04 10:54:53 +02:00
..
admin_policy.rb Various internal functionality adjustments (#1264) 2018-12-05 13:28:46 -05:00
api_secret_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
application_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
article_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
chat_channel_membership_policy.rb [deploy] 🚀 Feature: Chat channel request manager (#9305) 2020-07-22 09:12:09 -04:00
chat_channel_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
comment_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
consumer_app_policy.rb Push Notification multi app support (#13304) 2021-04-21 17:13:01 -06:00
follow_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
github_repo_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
html_variant_policy.rb Add below-article html variant (#1669) 2019-01-28 14:31:43 -05:00
image_upload_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
internal_policy.rb Create InternalPolicy (#4380) 2019-10-17 14:21:43 -04:00
liquid_tag_policy.rb [deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
listing_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
message_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
organization_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
pinned_article_policy.rb Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
rating_vote_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
reaction_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
response_template_policy.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
stripe_active_card_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
stripe_subscription_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
tag_policy.rb Update tag admin page(#1990) 2019-03-06 14:28:30 -05:00
user_block_policy.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
user_policy.rb Remove references to social link profile fields (#13252) 2021-05-03 10:16:02 -05:00
video_policy.rb Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00