docbrown/app/models
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
..
ahoy [15 Min Fix]: Fix incorrect scope used by metrics:overview rake task (#13138) 2021-03-25 17:31:10 -07:00
articles Rubocop: Move from OpenStruct to Struct in Organization (#9431) 2020-07-30 21:04:05 +07:00
concerns Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
liquid_tags [deploy] Add role and docs for user subscription liquid tag (#9170) 2020-07-08 14:07:53 -04:00
settings Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
users UsersSettings RFC: Code to Sync User Settings updates to new tables (#13719) 2021-05-27 09:52:54 -04:00
webhook Add missing presence validators to models (#10495) 2020-10-01 16:15:32 +02:00
admin_menu.rb Replace Pusher Beams with Rpush PN delivery ✂️ ✂️ (#13588) 2021-05-05 08:37:20 -06:00
announcement.rb Add Polymorphism to Broadcasts (Part 1) (#9231) [deploy] 2020-07-13 09:36:19 -06:00
api_secret.rb Limit the Number of API Keys a User Can Have (#7870) 2020-05-15 11:33:02 +02:00
application_record.rb Filter only ordinary tables in estimated count (#8913) 2020-06-25 14:04:13 -04:00
article.rb Add :detect_animated_images feature flag to guard animated images detection (#13906) 2021-06-03 17:21:43 -04:00
audit_log.rb Add missing presence validators to models (#10495) 2020-10-01 16:15:32 +02:00
badge.rb Refactor cache purging (#12811) 2021-03-02 10:09:05 -05:00
badge_achievement.rb Configure badge credits by admins (#13145) 2021-03-30 10:58:48 +03:00
banished_user.rb Introduce BanishedUser table (#5589) [deploy] 2020-01-21 17:15:58 -05:00
broadcast.rb Fix Rails/HasManyOrHasOneDependent for Broadcast and Collection (#9662) 2020-08-07 14:27:24 -04:00
campaign.rb Split Settings::Campaign from SiteConfig (#13238) 2021-04-19 10:01:03 +07:00
chat_channel.rb 🚀 Ability to allow tag moderators to create chat channels (#9741) 2020-12-08 13:10:36 +07:00
chat_channel_membership.rb Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
collection.rb Fix Rails/HasManyOrHasOneDependent for Broadcast and Collection (#9662) 2020-08-07 14:27:24 -04:00
comment.rb add user friendly error message when a comment is made on a deleted post (#13721) 2021-06-03 10:17:26 +07:00
config.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
consumer_app.rb Have specs run without Redis and refactor ConsumerApp and Device (#13647) 2021-05-07 08:03:16 +02:00
credit.rb Replace activerecord-import with Rails 6 insert_all and upsert_all (#8407) 2020-06-12 11:16:06 +02:00
custom_profile_field.rb Add custom profile fields (#10202) 2020-09-09 14:37:15 +00:00
data_update_script.rb Navigation Items and Role access for Data Update Scripts (#12292) 2021-02-09 17:41:14 +02:00
device.rb Bump rubocop from 1.15.0 to 1.16.0 (#13894) 2021-06-02 09:11:38 -04:00
display_ad.rb Move CodeBlockParse and MarkdownParser to service (#12112) 2021-01-07 10:13:01 -05:00
display_ad_event.rb Remove unused columns from display_ad_events (#6806) [deploy] 2020-03-25 17:47:05 -04:00
email_authorization.rb Add missing presence validators to models (#10495) 2020-10-01 16:15:32 +02:00
email_message.rb Upgrade to Ahoy 2.0.x (#13085) 2021-04-06 10:12:32 -05:00
event.rb Rename MarkdownParser to MarkdownProcessor::Parser (#12248) 2021-01-13 10:39:13 -05:00
feedback_message.rb Add open reports count to admin overview (#13346) 2021-04-12 12:03:11 -05:00
follow.rb rubocop -a (#11674) 2020-11-30 14:50:13 +01:00
forem_instance.rb Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
github_issue.rb Replace need for GitHub ENV vars on bootup (#10372) 2020-09-18 11:21:31 -04:00
github_repo.rb Refactor cache purging (#12811) 2021-03-02 10:09:05 -05:00
html_variant.rb Fix html variant image prefix logic (#11917) 2020-12-15 14:44:11 -05:00
html_variant_success.rb [deploy] Add relations and foreign keys between HtmlVariant related models (#9846) 2020-08-18 11:33:38 -04:00
html_variant_trial.rb [deploy] Add relations and foreign keys between HtmlVariant related models (#9846) 2020-08-18 11:33:38 -04:00
identity.rb secure Identity#email in case of missing auth_data_dump hash (#11936) (#12322) 2021-01-18 19:27:07 -05:00
invitation.rb [deploy] Invite users to join and create password (#9294) 2020-07-15 11:37:19 -04:00
listing.rb Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
listing_category.rb [deploy] Manage listing categories in dashboard (#10506) 2020-10-02 11:05:09 -04:00
mention.rb [deploy] Add missing unique indexes - part 2 (#8002) 2020-05-21 14:15:49 -05:00
message.rb Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
mod.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
moderator_action.rb [deploy] Moderator and admin actions log (#6797) 2020-03-26 16:59:24 -05:00
navigation_link.rb Update NavigationLink handling (#12316) 2021-01-20 13:57:59 -05:00
note.rb [deploy] Add missing dependent clauses to User and cleanup relations (#10011) 2020-08-28 20:19:24 +02:00
notification.rb Expand @-mention functionality to posts (#13367) 2021-05-12 07:33:33 -07:00
notification_subscription.rb Add missing presence validators to models (#10495) 2020-10-01 16:15:32 +02:00
organization.rb Organizations delete optimizations and refactoring (#13610) 2021-05-11 12:14:55 +03:00
organization_membership.rb Refactoring ChatChannel - distributing into services (#9253) 2020-08-07 10:41:34 +02:00
overview.rb Add admin overview page (#12726) 2021-03-01 18:59:05 -06:00
page.rb Rename MarkdownParser to MarkdownProcessor::Parser (#12248) 2021-01-13 10:39:13 -05:00
page_view.rb Declare winner in feed_top_articles_query test (#12308) 2021-02-04 13:02:00 -05:00
permission.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
pinned_article.rb Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
podcast.rb Podcast ownership join table (MLH Fellowship #81) (#11410) 2020-11-19 12:41:17 +01:00
podcast_episode.rb Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
podcast_episode_appearance.rb Add podcast_appearances joined table (forem#82) (#11354) 2020-11-30 17:12:52 +01:00
podcast_ownership.rb Podcast ownership join table (MLH Fellowship #81) (#11410) 2020-11-19 12:41:17 +01:00
poll.rb Rename MarkdownParser to MarkdownProcessor::Parser (#12248) 2021-01-13 10:39:13 -05:00
poll_option.rb Rename MarkdownParser to MarkdownProcessor::Parser (#12248) 2021-01-13 10:39:13 -05:00
poll_skip.rb Improve speed of model tests by around 50/60 seconds (#5016) 2019-12-09 16:33:48 -05:00
poll_vote.rb Rubocop: enable and fix new Rails cops (#9537) 2020-07-29 11:14:19 +02:00
privileged_reaction.rb [deploy] New Feature: Mod Actions Panel (#7777) 2020-06-08 13:24:18 -04:00
profile.rb Migrate "static" profile fields into new columns (#13641) 2021-05-26 14:40:18 -05:00
profile_field.rb Prepare for profile column drop (#11246) 2020-11-09 10:17:39 +07:00
profile_field_group.rb [deploy] /profile/settings page rendering (Ridhwana/Michael) (#10733) 2020-10-20 09:18:13 -04:00
profile_pin.rb Fix Typos (#3510) 2019-07-22 12:56:48 -04:00
rating_vote.rb [deploy] Add missing foreign keys to models related to users (#10018) 2020-08-31 15:39:57 +02:00
reaction.rb Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
response_template.rb Add unique indexes - part 4 (#8059) 2020-05-27 09:29:20 +02:00
role.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00
secret.rb [deploy] Feature: Setup Admin Area to Update Vault Secrets (#8935) 2020-06-29 15:08:09 -05:00
sponsorship.rb Add missing presence validators to models (#10495) 2020-10-01 16:15:32 +02:00
tag.rb Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
tag_adjustment.rb [deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
timeframe.rb Remove timeframer from app/labor (#11782) 2020-12-08 12:52:33 +07:00
tool.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
tweet.rb Refactor RssReader and Feeds::Import common parts: take 1 (#11412) 2020-11-18 14:17:53 +01:00
user.rb Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
user_block.rb Fix and refactor hide user content (#12307) 2021-01-18 11:08:23 -05:00
user_role.rb [Search 2.0] Users (#13453) 2021-04-24 19:06:06 +02:00
user_subscription.rb Rename MarkdownParser to MarkdownProcessor::Parser (#12248) 2021-01-13 10:39:13 -05:00
webhook_endpoint.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
welcome.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
welcome_notification.rb Add Polymorphism to Broadcasts (Part 1) (#9231) [deploy] 2020-07-13 09:36:19 -06:00