Commit graph

12654 commits

Author SHA1 Message Date
PJ
90780fd97a
Fix comment moderation's UI bugs (#19554) 2023-06-23 09:56:24 -04:00
Joshua Wehner
900f42d224
Try to stop eslint complaining about destructuring (#19629) 2023-06-23 08:51:17 -04:00
Rajat Talesra
67ff8d4efb
Add Edit Profile Image option to Onboarding (#19589)
* Basic implementation

* Nit fix

* Using existing profile update api

* API call working

* Basic full implementation

* Nit fixes in design

* UI changes

* Image upload limit set

* Removed drag & drop

* Image size issue fix

* Minor naming fixes

* Removed native mobile code

* Nit fix

* Added few tests

* Added test

* Added test

* Added image upload error

* Added validateFileInput test failure case

* Updated code to test fix

* Revert db changes

* Minor design fixes

* Minor updated test

* Added validateFileInputs test temporarily

* Added processImageUpload test temporarily

* Aded files count test

* Minor warning fixes

* Updated placeholder text

* Added tests for TextInput and TextArea

* Removed un-required test file

* Removed un-required code

* Minor code cleaning
2023-06-23 16:08:27 +05:30
Mac Siri
35a2f8b026
Add Error handling to billboards.js (#19566) 2023-06-22 10:20:34 -04:00
Dhurba baral
4e1edc9225
allows super_admin user to remove super_admin role (#19590)
* Skips scheduled posts in featured post count

* Allows removing super_admin role

* adds namespace resolution op

* Adds pundit policy

* Adds rspec for role policy

* Fixes test cases and minor refactoring

* Removes dead code

---------

Co-authored-by: Lawrence <lawrence@forem.com>
2023-06-21 11:22:25 -04:00
Ben Halpern
f0e99c6279
Add Cloudflare to Images::Optimizer options (proof of concept) (#19574)
* Add cloudflare image option

* Add tests for cloudflare

* Update app/services/images/optimizer.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Avoid nested prefixes in cloudflare

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/optimizer.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Rebase

* Refactor optimizer and finalize tests

* Skips scheduled posts in featured post count (#19563)

* Add image title for comment (#19586)

* Add image title for comment

* Break out boolean logic

* Add organizations to onboarding follow suggestions (#19564)

* Prepare: relocate user suggestions

* Prepare: relocate users suggestion service -> query

* Organization query for orgs with above-average scores

* Rubocop

* Limit to last 3 weeks

* Tweak recent scope, limit to 5 orgs

* Onboarding routes are also always JSON

* Divide by zero makes NaN means

* Add Orgs suggester into suggestions

* Rubocop

* select distinct orgs

* Fix for weird edge-case with bad local data

* Include type_identifier in JSON payload

* Update follows API to allow org_ids as input

* Update onboarding front-end to distinguish users/orgs

* Fix: i18n issues

* Fix: type_identifier in json output

* Fix: distinct is weird

* Fix: JS linter

* Continue tweaking front-end

* Audit import order

* Cleanup @todo note

* Try renaming controller action

* Move Article average calculation to postgres and fix math

* Refactor decorated type_identifier

* Refactor SuggestProminent, return more orgs, fix spec math

* Use FeatureFlag for organization suggestions

* This might fix the jest

* Sort organization members and tag moderators by badge count (#19582)

* show tag moderators in descending badge count order

* show organization users in descending badge count order

* specs & docs for find_each_respecting_scope

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/optimizer.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Remove cloudflare typo

* Adjust cloudflare prefix line in tests

* Clean up test logic

* Update spec/services/images/optimizer_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/optimizer.rb

Co-authored-by: Mac Siri <mac@forem.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
Co-authored-by: Dhurba baral <dhurba87@gmail.com>
Co-authored-by: PJ <pj@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
2023-06-21 09:42:06 -04:00
Joshua Wehner
a4419a249a
Suggested follows copy changes (#19596)
* Suggested follows copy changes

* See if this makes codecov happier?

* Still trying to appease codecov

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-06-21 09:40:39 +02:00
depfu[bot]
8bdd0e1fa5
Update sidekiq to version 6.5.9 (#19572)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-06-20 13:48:32 -07:00
depfu[bot]
37ef5c88fd
[ruby] Update oj 3.14.3 → 3.15.0 (minor) (#19605)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <mac@forem.com>
2023-06-16 16:03:13 -04:00
depfu[bot]
7b9c03429c
[ruby] Update cloudinary 1.25.0 → 1.26.0 (minor) (#19593)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-06-16 15:52:08 -04:00
Rajat Talesra
150199e0d2
Add more visibility and control around reactions/flags into the Admin USERS page (#19558)
* Basic implementation without dropdown

* Dropdown functionality

* Partial i18n

* Nit fixes

* Nit fixes

* Flag count fix

* I18n fr.yml

* Nit design fix

* added external div to article_item

* added external div to article_item

* Code merge of article_item and individual_article

* Minor bug fix

* Extacted more common code

* Nit fix

* Optimised code

* Optimised code

* Ni fix

* Test fix

* Minor suggested changes applied

* Nit fix

* Nit fix
2023-06-15 22:08:45 +05:30
Mac Siri
165f0bbf1f
Revert "Restructure the way we render the feed + add billboard locati… (#19610) 2023-06-14 14:27:58 -04:00
Ridhwana
b98dbd4035
Restructure the way we render the feed + add billboard locations on signed in feed (#19533)
* feat: fix of there is no article

* feat: set the feed order in a data structure rather than in a view

* feat: update yarn.lock

* feat: push the items to the array

* feat: update feed to only show billboards if we have the correct length of items in the feed

* fix: organizedFeedItems.legth

* feat: rename 'featured' to 'image'

* feat: rename 'featured' to 'image'

* feat: rename 'featured' to 'image'

* feat: add some utilities for the feed that we can use in the FeedTest

* feat/WIP: the setup for the feed tests and a first working test

* test: imageItem

* fix: the podcasts can be passed through as an array of objects in the feedItems so that they can be grouped in one card

* feat: remove podcastEpisode state and the attribute in the object

* fix: check that the items exist before trying to slice them

* feat: setup the userdata and the podcast data in the test

* whoops - commit the podcast episodes

* feat: write soem more tests for the feed and including the podcasts

* feat: add some more tests

* feat: add more billboards tests to chcek the order of stuff

* feat: set the timeframe not empty

* feat: update the logic for organizaed feed by inserting the last on first

* doc: jsdoc for functions

* refactor: break the code up into smaller functions

* refactor: make the code more readable and easier to follow

* refactor: pull function out into a utlity

* feat: add specs to utility

* feat: chcek if pinned post

* test the latest timeframe correctly

* chore: update var name

* move the podcast items out of the object clause

* feat: update text

* feat: add a pack file that duplicates initializeDisplayAdVisibility

* feat: create callbacks that will help us to determine when the feed has been rendered so that we can observe the dsplay ads accordingly

* chore: rename to billboards instead of display ad
2023-06-14 12:29:56 -05:00
depfu[bot]
e5c7c8cecf
[ruby] Update knapsack_pro 3.11.0 → 5.1.0 (major) (#19606)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-06-13 14:03:45 -04:00
depfu[bot]
4cdcdab65a
Update sterile to version 1.0.25 (#19598)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Rajat Talesra <rajat@forem.com>
2023-06-12 17:33:18 -04:00
Ben Halpern
5d6dc64245
Add ability to mark billboard (display_ad) as "priority" (boolean) (#19599)
* Add ability to mark billboard (display_ad) as "priority" (boolean)

* Fix invocation

* Update spec/models/display_ad_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/models/display_ad_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/models/display_ad_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/models/display_ad_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-12 16:28:15 -04:00
PJ
6de70e3810
Sort organization members and tag moderators by badge count (#19582)
* show tag moderators in descending badge count order

* show organization users in descending badge count order

* specs & docs for find_each_respecting_scope
2023-06-09 15:30:46 +01:00
Joshua Wehner
c2a131e43d
Add organizations to onboarding follow suggestions (#19564)
* Prepare: relocate user suggestions

* Prepare: relocate users suggestion service -> query

* Organization query for orgs with above-average scores

* Rubocop

* Limit to last 3 weeks

* Tweak recent scope, limit to 5 orgs

* Onboarding routes are also always JSON

* Divide by zero makes NaN means

* Add Orgs suggester into suggestions

* Rubocop

* select distinct orgs

* Fix for weird edge-case with bad local data

* Include type_identifier in JSON payload

* Update follows API to allow org_ids as input

* Update onboarding front-end to distinguish users/orgs

* Fix: i18n issues

* Fix: type_identifier in json output

* Fix: distinct is weird

* Fix: JS linter

* Continue tweaking front-end

* Audit import order

* Cleanup @todo note

* Try renaming controller action

* Move Article average calculation to postgres and fix math

* Refactor decorated type_identifier

* Refactor SuggestProminent, return more orgs, fix spec math

* Use FeatureFlag for organization suggestions

* This might fix the jest
2023-06-09 10:32:03 +02:00
Ben Halpern
e573ba32d1
Add image title for comment (#19586)
* Add image title for comment

* Break out boolean logic
2023-06-08 17:11:20 -04:00
Dhurba baral
a345aabc2b
Skips scheduled posts in featured post count (#19563) 2023-06-05 19:32:10 -04:00
Joshua Wehner
afa74111a8
Fix mod notifications for draft posts (#19575)
* Fix mod notifications for draft posts

* Rubocop
2023-06-05 17:02:11 +02:00
Ben Halpern
4ffe7b0fab
Remove loading-ellipsis.svg and related code (#19569) 2023-06-01 10:41:53 -04:00
depfu[bot]
d162fee7f0
Update pg_query to version 4.2.1 (#19549)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-06-01 08:57:01 -04:00
Ben Halpern
0e5281cfb6
Fix cls with min-height for multiple reactions (#19570) 2023-06-01 07:39:51 +05:30
Tom Hughes
6d919acc63
fix: prevent dashboard following lists rendering stale content (#19397)
Co-authored-by: Lawrence <lawrence@forem.com>
Co-authored-by: Rajat Talesra <rajat@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Philip How <philip.j.how@gmail.com>
2023-05-31 17:52:12 -04:00
Kireeti
b35dbeecb4
Update multiple_reactions_engagement's alignment (#19484) 2023-05-31 17:42:31 -04:00
depfu[bot]
43db21508b
Update all development Bundler dependencies (2023-05-31) (#19552)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-05-31 11:02:43 -07:00
Joshua Wehner
abcd4ac3c8
Add ability to assign arbitrary segment ID to /display_ads API (#19529)
* DisplayAd audience_segment_id in API

* Rubocop

* Manual not valid if missing id

* manual-type requires an id

* Better audience_segment_type reader

* Use inclusion validation

* Swagger update

* Remove unnecessary
2023-05-31 18:11:35 +02:00
PJ
940921d46d
Skip reaction notifications for bookmarks (#19426) 2023-05-30 19:12:09 -04:00
Ben Halpern
2fe2c6c6bb
Patch: Fix too-long code in comment previews via appropriate truncation (#19540)
* Fix too-long code in comment previews

* Update app/javascript/articles/components/CommentListItem.jsx

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-05-30 10:02:09 -04:00
depfu[bot]
56414481ba
[ruby] Update metainspector 5.14.0 → 5.15.0 (minor) (#19524)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-05-26 16:39:07 -04:00
depfu[bot]
94e394edc2
[ruby] Update fog-aws 3.18.0 → 3.19.0 (minor) (#19537)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <mac@forem.com>
2023-05-26 15:55:45 -04:00
Mai Irie
282afaa6a2
Update PR template to include a11y checklist (#19538) 2023-05-26 12:37:48 -04:00
Mac Siri
67a65e0aa5
Temp disable flaky spec (#19547) 2023-05-26 11:56:28 -04:00
Ben Halpern
ca7c395bd9
Remove unique constraint from segmented users index (#19544) 2023-05-26 11:18:08 -04:00
PJ
453c2eeccb
Manual Audience Segments API read endpoints (#19542)
* getting and listing segments

* get list of users in segment

* docs???
2023-05-26 15:10:26 +01:00
Rajat Talesra
bbb9fd2e1e
Add more visibility to admins (part-2) (#19375)
* Basic thumbsup, thumbsdown and vomit

* Refined UI of flags and vomits

* If check

* Optimised code and added a method in article.rb

* Removed public keyword

* Nit fixes

* Section for flags and quality details

* Basic vomit item

* Quality item UI

* Separated code into partials

* UI changes and empty state added

* With correct implementation

* Fixed showing reaction items in all cases

* Dropdown visible

* Enabled click listerners and call functions for dropdown-button clicks

* Empty state UI fixed

* Tabs and divider UI

* Mark as valid/invalid conditions

* Nit fixes

* Logical fixes

* Added comments

* Partial item status update fix

* Reload page feature fixed

* Removed snackbar

* I18n strings

* Bug fix

* I18n strings

* Nit fixes

* Added date

* Added view details button

* Added view details test

* Sample test

* Test fixes

* Added tests for new article

* Flagged item tests added

* Added more tests

* Nit fix

* Suggested design changes

* Nit design fixes

* Tests with cy.intercept

* Nit fixes

* Nit fixes

* Hero Billboard Placement (#19467)

* init

* add option to swagger docs

* in_house validation

* filtered ad quesry changes

* styling and prioritizing home hero banner over campaign banner

* rubocop

* typo

* broken spec

* more spec fixes

* found the spec break culprit

* derp

* Update app/views/shared/_display_ad.html.erb

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

* Update app/controllers/stories_controller.rb

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

* remove immediate return

* styling feedback and moving banner to articles index

* remove nil

* updated styling

* add signed in bool

* add feature flag

* remove feature flag data scripts

---------

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

* Fix typo / erroneous word in Admin Section (#19488)

* Typo fixes

* Update admin_menu.rb

* Minor background and shadow change (#19501)

* Refresh audience segment for 'active' user (#19470)

* Refresh an individual user's segmentation

* Refresh segment if creating a published article

* Quick refactor

* Refresh segment if update publishing

* Quick refactor

* Refresh segment if update user settings

* Refresh segments after user update + role change

* Using latest_article_updated_at

* Sidekiq uses JSON for arguments, needs basic types

* Fix test issues with last_updated_at and sidekiq params

* Tests update continues

* Consolidate dependencies

* Method names acknowledging manual exclusive

* Fix test name copypasta

* Rubocop

* Try to clarify Creator#series

* Try to avoid naming predicate

* Remove erroneously included helper

* Improve onboarding “suggested tags” page design (#19475)

* Onboarding tags

* Logical design issue fixes

* Posts count added

* Checkbox design fixes

* Optimised css

* Nit fixes

* Test case added

* Reduced data

* Nit fix

* Added more tests

* Nit fix

* Tests updatedt

* Update @honeybadger-io/js to version 5.4.1 (#19479)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>

* Update sidekiq-cron to version 1.10.1 (#19473)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>

* Update nokogiri to version 1.15.0 (#19495)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>

* use tabindex instead of disabled to get proper keyboard nav on /onboarding tags (#19513)

* Add billboard to safe param list in Fastly vcl (#19515)

* Removed static article id from setup

* All tests passing

* Nit fixes

* Nit fixes

* Fixed tests with Joshua's help

* Added trusted user related tests

* Fixed few tests

* Added intercept and wait

* Removed tab and enter key

* Updated comment

* Updated tests

---------

Co-authored-by: Lawrence <lawrence@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Peter Frank <peter.kim.frank@gmail.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-05-26 19:15:12 +05:30
Mac Siri
a6a3417e5e
[CI] Move code-coverage upload into isolated process (#19532) 2023-05-26 09:09:39 -04:00
PJ
795cfc3da0
Manual Audience Segments API write endpoints (#19476)
* add composite index to segmented_users table

* bulk queries for segmented users

* create segment endpoint

* adding and removing users

* deleting segments 😪

* fix time precision in specs

* api docs 🎉

* pluck improvements that couldn't be cherry-picked

* better service objects; also introduce batch upserting

* docs???
2023-05-25 20:37:18 +01:00
Joshua Wehner
862cd54dc7
Refactoring onboarding (#19525)
* Quick refactor onboardings controller(s)

* Quick refactor onboardings controller(s), pt2

* Quick refactor onboardings controller(s), pt3

* Quick refactor onboardings controller(s), pt4

* Quick refactor onboardings controller(s), pt5

* Add test for checkboxes
2023-05-25 10:03:12 +02:00
anes
772f6cdd7b
Fix the org post count issue (#19503)
* Fix the org post count issue

* Add regression specs

* Move things around and sort them better

* Implement PR review

* Revert accidental changes

---------

Co-authored-by: Mac Siri <mac@forem.com>
2023-05-24 16:58:39 -04:00
Ben Halpern
e72160284c
Fix styling for long org promoted billboard (#19528) 2023-05-24 21:41:32 +05:30
Mac Siri
a5842bd779
Revert Uffizzi refactors (#19526) 2023-05-24 10:55:27 -04:00
Rajat Talesra
5829518f13
Fixed display ad index on home page (#19506) 2023-05-23 18:10:31 -04:00
Mac Siri
670dae96d5
Update experience_level's validation (#19487) 2023-05-23 14:10:32 -04:00
Joshua Wehner
6b80d99c1b
Update onboarding suggested tag logic (#19477)
* Onboarding suggested tags should include supported

* Migrate tags to add suggested boolean column

* Use new suggested attribute

* Sync Settings.suggested_tags with new form setting

* Better sort order

* Test logic update

* Add a little comment
2023-05-23 17:22:27 +02:00
Duke Greene
1798a1f845
notify mod on new user articles (#19478)
* update moderation notification view and message for articles

* update models to allow first published articles to notify mod after create

* update mod notifications worker and spec to support articles

* update mod notification send service and spec to support articles

* update helper and request spec to support article mod notifications

* update spec language to match updated notification message

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

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

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

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

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

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

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

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

* fix comment and refactor order of send_moderation_notification steps

* add fr.yml article mod notification config

* fix spacing around equal sign per rubocop

* fix spacing around equal sign per rubocop

* Update spec/workers/notifications/create_round_robin_moderation_notifications_worker_spec.rb

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

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-05-23 10:51:46 -04:00
Joshua Wehner
50a286fe75
Change order of organizations on /admin (#19499)
* Change order of organizations on /admin

* Rubocop
2023-05-23 10:41:18 +02:00
Ben Halpern
56c914cc8a
Add billboard to safe param list in Fastly vcl (#19515) 2023-05-22 12:04:10 -04:00
Ben Halpern
45a44a797f
use tabindex instead of disabled to get proper keyboard nav on /onboarding tags (#19513) 2023-05-22 17:27:19 +05:30