Commit graph

30 commits

Author SHA1 Message Date
Ben Halpern
d447d0cadf
[deploy] Update design and functionality of internal/articles (#7517)
* Update design and functionality of internal/articles

* Fix spec

* Update specs

* Fiddle with test

* Fix request spec
2020-04-26 18:27:09 -04:00
Jacob Herrington
38d56542eb
[deploy] Moderator and admin actions log (#6797)
* Add audit logging for negative reactions

This change saves requests that create negative reactions to the audit
log. We need to be monitoring admin and moderator actions throughout the
app to increase visiblity on how our tools are being used and identify
abuse.

Additionally, this will help east concerns about giving elevated users
more powerful tools.

* Add a basic UI for moderator audit logs

* Log experience level ratings

* Log tag adjustments

* UI tweaks for moderator actions log

* Add logging to internal reactions controller

* Add logging for admin actions on users and articles

* Add searching to the moderator actions table

* Move audit instrumentation out of concern

We are able to use a PORO here instead of using a Rails concern. Moving
this also makes syntax to audit something quite a bit more explicit and
obvious to future developers

* Change moderator logs pagination page length

* Move auditing to after action filters

* Add moderator actions to the internal navbar

* Add request spec for internal moderator actions

* Use request params to populate AuditLog slug
2020-03-26 16:59:24 -05:00
Michael Kohl
b57ced5466 CacheBuster refactoring (#4766)
* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Consistently use string interpolation and parenthesis

* Destructure arrays into meaningful names, formatting

* Fix request spec for internal classified listings controller

Interestingly this works when asserting directly on the module, but not on a double.
Asserting directly in the module seems sufficient for this test so the indirection
was removed.

* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Fix specs after rebasing
2019-11-13 10:51:23 -05:00
Mac Siri
d976eb7ab6 Create InternalPolicy (#4380)
* Ensure verify_authorized in internal

* Create internal_policy

* Replace ArticlePolicy usage with InternalPolicy

* Replace BufferUpdate&CommentPolicy with InternalPolicy

* Remove verbose authorize_admin

* Forgot to remove coresponding specs

* Create specs for InternalPolicy

* Expand policy access on internal's broadcast

* Refactor

* Create shared spec

* Create request specs

* Add additional test cases
2019-10-17 14:21:43 -04:00
rhymes
232bc48e3e Fix eager loadings (#4365) 2019-10-17 14:08:31 -04:00
Jess Lee
ff135c7839 Give interns access to internal articles (#4016)
* add intern role and update policies

* update admin policy spec for rubocop

* add article poolicy spec

* fix spec

* switch to scoped admin role

* Finalize single resource admin

* Adjust buffer permissions
2019-09-19 11:35:49 -07:00
Jacob Herrington
59e7c104f2 Remove commented code and tests (#3989) [ci skip] 2019-09-09 14:51:02 -04:00
Jess Lee
464d37310e add buffered checkbox to individual articles (#3238) 2019-06-20 09:34:03 -04:00
rhymes
5782ffd7e0 Use published scope for articles (#2374)
* Use published scope for articles

* Fix variable name

* The sequencing in the union query matters

* Fix spec

* Restore a published: true condition

* This test is actually misleading due to the union

* Revert this change, not sure why it's not a relation

* Fix useless diff
2019-04-11 13:18:26 -04:00
Ben Halpern
5f3fd96960
Modify social share button and functionality (#2316)
* Modify social share button and functionality

* Some nightmode changes tossed in

* Style adjustments and test snapshot fix
2019-04-06 14:49:52 -04:00
Ben Halpern
1552df98d2
Add ability for trusted users to suggest social copy for posts (#2306)
* Add ability for trusted users to suggest social copy for posts

* Fix schema

* Fix tests

* Fix test
2019-04-04 17:01:58 -04:00
Keshav Biswa
8d57d45ecc Rubocop Style cops enabled (#2056)
* Rubocop enabled style/alias

* Enabled Style/ArrayJoin Cop

* Enabled Style/Attr

* Enabled Case Equality

* Enabled CharacterLiteral

*  Enabled ColonMethodCall Cop

* Enabled CommentAnnotation cop

* Enabled PreferredHashMethods Cop

*  Enabled DoubleNegation Cop

* Enabled EachWithObject Cop

* Enabled EmptyLiteral Cop

* Enabled EvenOdd Cop

* Enabled IfWithSemicolon Cop

* Enabled Lambda and LambdaCall Cop

* Enabled LineEndConcatenation Cop

* Enabled ModuleFunction Cop;

* Enable NegatedIf and NegatedWhile Cop

* Enabled NilComparison Cop

* Enabled Not Cop

* Enabled NumericLiterals Cop

* Enabled OneLineConditional Cop

* Enabled PercentLiteralDelimiters Cop

* Excluded internal/users_controller from negated_if cop

* Reverted the double negation change from github_issue_tag and github_issue.rb"

* Enabled PerlBackrefs Cop

* Changed Regexp.last_match(1) to Regexp.last_match(0)

* Enabled proc cop

* Enabled RaiseArgs Cop

* Reverted Regexp.last_match(0) to Regexp.last_match(1)

* Enabled SelfAssignment Cop

* Enabled SingleLineMethods Cop

* Enabled SpecialGlobalVars Cop

* Enabled VariableInterpolation Cop

* Enabled WhenThen Cop

* Enabled WhileUntilModifier Cop

* Enabled WordArray Cop

* Enabled IfUnlessModifier Cop

* Enabled GuardClause Cop
2019-03-15 18:33:54 -04:00
Ben Halpern
044b088d4f
Switch satellite view to any: true for tags (#1956) 2019-03-03 18:55:39 -08:00
Ben Halpern
f280d9e266
Fix a couple things and modify dev digest logic (#1954) 2019-03-03 18:25:39 -08:00
Jess Lee
d0b17f2a77 Adds internal/articles input to update author (#1628)
* adds input to change article author

* remove link

* remove unnecessary attribute
2019-01-23 11:58:11 -05:00
Jess Lee
38091ba486 Update twitter validation and internal/articles query (#1571)
* update validation and only show published articles

* update twitter satellite count

Co-Authored-By: jessleenyc <jessleenyc@gmail.com>
2019-01-16 17:15:22 -05:00
Jess Lee
80339dd573 Fix internal article query (#964)
* update abuse report subject template

* fix internal/article top month filters

* update resolution email spec with proper subject line
2018-10-19 16:16:43 -04:00
rhymes
1b60ee5009 Use timezone aware methods (#893)
* Use timezone aware datetime methods

* Use timezone aware date parse for GitHub issue tag

* Introduce a bit of chaos programming using Zonebie

Zonebie uses a random timezone to run tests, it's a really good way to see if the code is timezone dependent or not.

* Convert GitHub issue date as UTC
2018-10-18 16:26:29 -04:00
Adam Lombard
92645d6062 Fix indentation in articles_controller.rb (#908) [ci skip] 2018-10-15 12:30:08 -04:00
Ben Halpern
384c5ce8ae
Update internal/articles to have faster buffer controls (#839) 2018-10-05 18:22:50 -04:00
Ben Halpern
eae8b6332f
Change various admin pages (#758)
* Change int to float for more granular admin controls

* Change int to float for more granular admin controls

* Add details to /mod for admins
2018-09-27 18:03:49 -04:00
Ben Halpern
b95f8ae028
Add tab for not-buffered today and this week for internal articles (#756) 2018-09-27 12:51:27 -04:00
Ben Halpern
a4ed6dd71a
Modify internal/articles and RSS feed rules/page (#754) 2018-09-26 18:33:37 -04:00
Ben Halpern
2517bb555b
Add functionality for buffering to different accounts (#752)
* Create initial buffer updates logic

* Add UI functionality and test for sattelite tweets

* Add additional /mod functionality and re-use script partial in /internal
2018-09-26 15:51:39 -04:00
rhymes
e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00
Mac Siri
923e1acbda Create Suggester service object (#372)
* Create Suggester::Article::Boosted

* Fix lint & Remove .compact

* Expand Suggester service-object WIP

* Create Suggester::Users

* Remove ClassicArticle

* Replace old refactored classes

* Move Suggester specs into appropriate folder

* Fix broken spec & Fix lint

* Fix lint

* Fix lint

* Fix broken code
2018-06-08 17:17:20 -04:00
Ben Halpern
f2101410ea
[WIP] Improve article boosting abilities and insights (#237)
* Update email subjects split test

* Create alternate editor

* Add proof of concept to emails

* Add utm for internal nav

* Add ability to boost in DEV Digest

* Adjust articles.scss

* Adjust article_form.scss

* Remove unnecessary files

* Remove files from PR

* Adjust boosted email settings

* Conditionally include organization in additional box

* Modify schema.rb
2018-05-02 12:24:54 -04:00
Ben Halpern
c1e623ebc2
Add additional content boxes under posts (#86)
* Add additional content boxes under posts

* Fix issue with classic article for under content
2018-03-16 16:35:54 -04:00
Ben Halpern
2771a2e866
Add Algolia to comments, modify button styles, add comments tab to reading list area (#32)
* Add Algolia to search and add Only My Posts filter

* Actually fix Algolia index possible issue

* Fix search issue

* Make minor adjustments to sponsorship sidebar

* Make submission rules headsup html allowed and remove devise trackable

* Remove devise_trackable from application_controller

* Adjust login CTA for /new

* Adjust string in test to reflect changes

* Quick fix for internal navigatioon draft caching issue

* Add ID to internal/articles

* Fix auth with Twitter in two places

* Added comments to algolia and modified design

* Update sidebar styles and make other small adjustments

* Clean up tag styling and other small improvements

* Finalize design adjustments

* Add indexing condition for comments

* Fix Algolia typo

* Fix Algolia indexing on comment
2018-03-04 22:25:08 -05:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00