Commit graph

12731 commits

Author SHA1 Message Date
Anna Buianova
fbd2ca0453
Rename DisplayAdEventsController to BillboardEventsController (#19771) 2023-07-19 08:51:22 -04:00
depfu[bot]
d7b2f2e10f
Update preact to version 10.16.0 (#19761)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-18 09:21:59 -04:00
Rajat Talesra
f2cc2ae774
Admin Area: Bulk assign user roles (#19733)
* Bulk Assign Roles UI

* Renaming roles to role

* Added role to multiple users without using note.

* Role note added

* Role blank key fix

* Removed roles

* typo fix

* AuditLog Added

* Optimising code

* Good standing role issue

* Good standing role issue fix

* Minor PR changes based on review

* Added cypress tests

* Added spec tests for BulkAssignRole

* Minor fixes
2023-07-18 18:41:54 +05:30
depfu[bot]
20b643ac8f
Update i18n-js to version 4.3.0 (#19760)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-18 11:07:09 +02:00
Ben Halpern
8335a37315
Language detection with CLD3 (#19756)
* Language detection with CLD3 POC

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update app/models/article.rb

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

* Clean up tests

* Clean up tests

* Move language detection to service

* rubocop

* Update app/services/languages/detection.rb

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

* More linting cleanup

* Remove allow_any_instance_of

* Update tests to better exercise different paths

* Fix flaky spec

* Update spec/services/languages/detection_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/models/article_spec.rb

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

* Update spec/services/languages/detection_spec.rb

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

* Update spec/services/languages/detection_spec.rb

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

* Update spec/services/languages/detection_spec.rb

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

* Update spec/services/languages/detection_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-07-17 08:57:20 -04:00
Ridhwana
77148d8687
fix: lint rule https://github.com/facebook/react/issues/14920 (#19748) 2023-07-17 12:37:32 +02:00
Ridhwana
272aea6127
Allow admins to delete an organization (#19699)
* feat: update the layout for organizations

* feat: update the layout for an organization

* feat: organization logos are square

* feat: change the text on the org visit button

* feat: initialize the dropdown menu

* feat: trigger the  modal

* feat: update the text in the model

* feat: tweak wording

* WIP/feat: hook up a route with an action that calls an organization delete worker.

* feat: redirect after showing the notice

* feat: update the authorization required to be super admin

* feat: add the notice to localization

* spec: integration test

* spec: fix

* spec: delete worker

* chore: update the link

* feat: add safe navigation

* feat: make sure that we show an error if the organization has credits

* fix: error message for modal unspent credits

* feat add the spec for the helper

* fix: remove rspec preface

* fix: small fixes to tests and I18n

* fix: updated the number of orgs

* feat: update the message

* feat: update the message

* chore: remove inclusion of helper

* feat: change the name of the parameter

* chore: newline
2023-07-17 12:09:24 +02:00
Joshua Wehner
20c282df80
Still trying to fix notification caching when un/subscribing (#19754)
* Revert "Uncache subscribe to comments (#19739)"

This reverts commit 30500805ae.

* Tweak cache key for faster cache change on un/subscribe
2023-07-17 11:23:55 +02:00
Anna Buianova
be1e57d85c
Rename DisplayAdHelper to BillboardHelper (#19750) 2023-07-14 14:48:45 -04:00
Anna Buianova
ef5d126a0f
Rename display_ads API to billboards (#19749) 2023-07-14 14:22:52 -04:00
Rajat Talesra
ddf3e73164
Flaky test fix: commentModerationTools.spec.js (#19712)
Co-authored-by: Mac Siri <mac@forem.com>
2023-07-14 12:08:15 -04:00
Joshua Wehner
bd2e349d86
Fix bugs with article moderator notifications (and make tests less flaky) (#19688)
* Try to mitigate flaky spec by clearing mock space

* Fix for flaky article published spec

* Rubocop

* Tidy up the specs a bit, update the comment

* Modernize article factory (thanks, rubocop)

* Update update spec to use factory

* Use PublishWorker instead of callback

* nth_published_at -> from_newish_author

* Separate published/unpublished specs

* published_at is correct if unchanged

* Add spec for scheduled post
2023-07-14 17:29:45 +02:00
depfu[bot]
75fe9f6929
Update postcss to version 8.4.25 (#19753)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-14 09:29:52 +01:00
Ridhwana
314a1b3761
feat: apply focus styles to crayons-btn (#19751) 2023-07-14 10:26:42 +02:00
depfu[bot]
30e0ec4005
[js] Update all of babel7 7.18.10 → 7.22.5 (minor) (#19695)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-07-12 18:09:00 -04:00
depfu[bot]
730f976c08
[js] Update preact 10.12.1 → 10.15.1 (minor) (#19716)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: PJ <pj@forem.com>
2023-07-12 16:24:19 -04:00
depfu[bot]
7138b6e0d8
Update js-routes to version 2.2.6 (#19745)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-12 12:40:43 -07:00
PJ
cee84b49ef
Exclude manual segments from dropdown in billboard admin form (#19677)
* exclude manual segments from audience segments dropdown

* specs 🎉

* fix deleteDisplayAds specs

* add seed for display ad with manually managed segment

* moar specs
2023-07-12 20:23:50 +01:00
Mac Siri
e98b00b45f
Update search result rendering for Organization (#19740) 2023-07-12 11:53:08 -04:00
Joshua Wehner
30500805ae
Uncache subscribe to comments (#19739)
* Subscribing to notifications should bust caches

* Unsubscribing to notifications should bust caches

* 'Normal' subscription toggle should also bust caches

* Cache busting can work with object or identifier

* Delete cached notification views for article and comment

* Simplify guard clauses

* And update the test expectation
2023-07-12 17:02:19 +02:00
depfu[bot]
cae678e0e6
[js] Update @cypress/code-coverage 3.10.7 → 3.10.8 (patch) (#19741)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-12 10:18:19 -04:00
Anna Buianova
7c1721675c
Rename DisplayAdsController to BillboardsController (#19738) 2023-07-12 09:42:46 -04:00
Mac Siri
290b9bd775
[CI] Add branch specific rule for codecov upload (#19736) 2023-07-12 09:08:50 -04:00
depfu[bot]
0b7545b2a4
Update ahoy.js to version 0.4.3 (#19715)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-12 01:45:15 +05:30
Josh Klar
10e4fe4d6c
infra: Automatically build and push base container image when Ruby versions are updated. (#19657) 2023-07-11 12:23:49 -07:00
Mac Siri
8b307db9c7
Add missing notify_mailer_preview (#19714) 2023-07-10 16:35:57 -04:00
depfu[bot]
58abc5c30a
Update strong_migrations to version 1.5.0 (#19729)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-10 11:42:10 -07:00
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
depfu[bot]
2a9d64171e
Update field_test to version 0.6.0 (#19730)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-10 09:15:34 -04:00
depfu[bot]
1c72c4d974
Update sanitize to version 6.0.2 (#19731)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-10 08:08:09 -04:00
PJ
b0b1ace7d9
Prevent comments by the staff account from being hidden (#19698)
* don't show hide/unhide on comments made by staff account

* block staff account comments from being hidden on the backend as well

* moar specs
2023-07-10 11:46:46 +01:00
zhangted
5fe3a04287
fix scroll when popstate from a full screen code block (#19674) 2023-07-07 15:54:24 -04:00
Anna Buianova
4632c6bbf4
Fixe deprecation message in specs (#19694) 2023-07-07 15:39:09 -04:00
Dhurba baral
8d78d80da0
Fix select dropdown not working (#19672)
Co-authored-by: Rajat Talesra <rajat@forem.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: PJ <pj@forem.com>
2023-07-07 14:39:19 -04:00
Dhurba baral
f3453b0d24
Skips newline when validating character count (#19646)
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Philip How <philip.j.how@gmail.com>
Co-authored-by: Mai Irie <mai@forem.com>
2023-07-07 14:35:29 -04:00
Kireeti
982d629fdf
Change Onboarding's button styling (#19654)
Co-authored-by: PJ <pj@forem.com>
2023-07-07 12:46:46 -04:00
depfu[bot]
a170e87ade
[js] Update autoprefixer 10.4.13 → 10.4.14 (patch) (#19691)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-07 12:06:52 -04:00
depfu[bot]
07e348f1b2
[js] Update @etchteam/storybook-addon-css-variables-theme 1.4.0 → 1.5.1 (minor) (#19696)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-07 12:06:26 -04:00
Ben Halpern
b14f8c2325
Change feed billboard font size to fs-base and link embed adjustments (#19697) 2023-07-07 09:13:11 -04:00
Anna Buianova
8cc6f37a2d
Rename Admin::DisplayAds controller to Billboards (#19687) 2023-07-07 08:11:35 -04:00
Mac Siri
cd9d5df963
Set hash_digest_class to SHA256 (#18364) 2023-07-06 17:38:56 -04:00
Ben Halpern
f88e18c2de
Fix Windows tweet schrinking phenomenon (#19686) 2023-07-06 17:25:04 -04:00
Helio Cola
c7bb3be603
Upgrade ruby 3.0.6 (#19651)
Co-authored-by: Josh Klar <jklar@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-07-06 16:42:20 -04:00
depfu[bot]
41de245b8e
[js] Update postcss 8.4.21 → 8.4.24 (patch) (#19692)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-06 12:55:28 -04:00
Ridhwana
ccacf0bc3a
Refactor the home feed + add user tag filtering on in-feed billboards (#19600)
* 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

* feat: abstract out a function that will work for any tagged resource and also limit the article tags within a scope of the article_id

* feat: update the spec for the previous changes

* feat: write tests for the user_tags

* feat: add user_tags to for_display adn the query

* feat: add user_tags to the endpoint where we query the tags to send it through to for_display

* feat: pass through the suer tags to the async request

* feat: update the user_tags fiter query + tests

* feat: update the admin view to show targeted tags on the new feed option billboards too

* feat: add tests for targeted tags field on admin

* refactor: consolidate all of the options into one

* feat: move comment close to attribute

* feat: use a helper method

* feat: include helper on ads query

* feat: move the query from the frontend to live on the backend

* feat: first pass at some error handling whilst maintaining the order of the items

* test: for feed error

* feat: abstract out some code

* update the feed items for errors

* chore: comment

* feat: update the variable names

* feat: update honeybadger message

* feat: update the name of the variable

* refactor: do not conflate the duty of the untagged_ads

* refactor: rename the variables + add note for clarity

* fix: update var
2023-07-06 16:47:08 +02:00
depfu[bot]
5410f6f92c
[js] Update @cypress/code-coverage 3.10.0 → 3.10.7 (patch) (#19690)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-06 08:02:26 -04:00
depfu[bot]
8a578a1b37
[ruby] Update counter_culture 3.3.0 → 3.3.1 (patch) (#19684)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-05 16:31:11 -04:00
Rajat Talesra
b397292a33
Admin comments page with flag and quality reaction details. (#19647)
* Created separate comments page

* Optimised code for single comment and multiple comments

* Indifual comments poage added

* Minor header change

* Created show method

* Full implementation with eager loading error

* Temporarily suppress Bullet from Admin::CommentsController

* Minor fixes

* Minor fixes

* Added table

* Added french translations

* Added reaction stats / summary

* Tests added fore empty comments

* Added seed data and few more tests

* Updated test

* Added model tests for comment and article

* Nit test fix

* Applied changes as per PJ's review

---------

Co-authored-by: Joshua Wehner <joshua@forem.com>
2023-07-05 22:05:35 +05:30
Ben Halpern
7ecb72413d
Allow LOW_IMPRESSION_COUNT and related values set by ENV (#19678)
* Allow LOW_IMPRESSION_COUNT and related values set by ENV

* Update app/models/display_ad.rb

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

* Update app/models/display_ad.rb

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

* Update app/models/display_ad.rb

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

* Adjust test and move methods to non-private

* Change fallback numbers to constants

* Add global config fallbacks

* Update spec/models/display_ad_spec.rb

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

* Update app/models/display_ad.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-07-05 08:45:14 -04:00
Ben Halpern
01e1557583
Move max-height and overflow auto to proper billboard child (#19683) 2023-07-04 08:52:34 -04:00