Commit graph

12750 commits

Author SHA1 Message Date
depfu[bot]
4e8fc84f76
Update cld3 to version 3.6.0 (#19821)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-25 09:52:38 -04:00
depfu[bot]
4d9a9439c6
[ruby] Update pundit 2.3.0 → 2.3.1 (patch) (#19825)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-25 09:32:06 -04:00
Peter Frank
b39b4642fe
Add "bug" label to bug issue template (#19814)
Just adding a label
2023-07-24 14:55:04 -04:00
Duke Greene
129628b2c2
render left sidebar billboards ('display ads') asynchronously (#19797)
* render left sidebar billboards ('display ads') asynchronously

* remove request spec expectations for ads that are now rendered async

* don't set up path helper for old name style

* refactor from global to imported observeDisplayAds call

* revert refactor attempt, bad export syntax, may fast follow
2023-07-24 13:21:13 -04:00
Ridhwana
03905ce9cf
fix: move the setup dropdown to the callback because ot exists at that point (#19803) 2023-07-24 10:56:35 -04:00
Anna Buianova
963eea8126
Aliased DisplayAdEvent.display_ad_id to billboard_id (#19805)
* Aliased DisplayAdEvent.display_ad_id to billboard_id

* Allow :display_ad_id instead of :billboard_id for billboard_events in case of cache
2023-07-24 17:54:39 +03:00
depfu[bot]
c28bafccfe
[ruby] Update all development Bundler dependencies (2023-07-24) (#19820)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-24 09:31:10 -04:00
Dhurba baral
3493c12ad2
Returns an error code when validation fails (#19734)
* Returns an error code when validation fails

Minor fixes

* Adds unit test
2023-07-24 17:01:50 +05:30
Anna Buianova
3adeb14ea0
Take :display_ad_event params as well as :billboard_event (#19810) 2023-07-21 10:53:28 -04:00
Jerin K C
6c2c1660db
Fix blank user's name (#19723) 2023-07-21 09:55:41 -04:00
Joshua Wehner
1f202c6a9a
Try to fix scrolling bug (#19801) 2023-07-21 09:42:50 -04:00
Anna Buianova
e659dbfc00
Renamed display_ad_events variables and associations (#19788)
* Renamed stuff related to display_ad_events (except the model)

* Updated user billboard_events association spec

* Fixed display_ad_event factory
2023-07-21 14:59:28 +03:00
Duke Greene
9a6f04bd37
api v1 endpoint for creating an organization (#19778)
* api v1 endpoint for creating an organization

* address failing specs, regenerate swagger docs

* remove old comment in destroy now that woreker call takes third argument

* refactor our services for profile images into images folder
2023-07-21 07:43:56 -04:00
Ridhwana
88f8a84c4e
Refactor VerifyAndDismissFlashMessage within Cypress tests (#19768)
* refactor: make verifyAndDismissFlashMessage to be more general

* feat: update the shared admin utility

* refactor: manageCredits

* refactor: manageOrganizations

* refactor: manageRoles

* refactor: manageUserOptions

* feat: remove adminUtilities

* chore: update the path name
2023-07-21 12:55:04 +02:00
depfu[bot]
0af707f026
[ruby] Update counter_culture 3.3.1 → 3.4.0 (minor) (#19782)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-20 08:18:35 -04:00
Mac Siri
fa31b5fc60
Revert Yarn dependencies update & tighten CI settings (#19781) 2023-07-19 17:35:40 -04:00
Duke Greene
f163e2c14e
Dukegreene/moderator notifications copy change (#19775)
* update copy for moderator notifications

* use helper to display mod notification in the view

* add missing translate call
2023-07-19 14:02:39 -04:00
depfu[bot]
2205182a7e
[js] Update all development Yarn dependencies (2023-07-17) (#19693)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-07-19 13:37:03 -04:00
Duke Greene
dd7e34ac53
define api v1 routes for organizations (#19681)
* define api routes and create controllers, sketch out index and create actions

* add api v1 organizations CRUD spec and docs spec, need to run swagger

* swagger dry run on admin organizations routes, typo fix in api.rb

* flesh out specs and sketch out admin actions

* move actions out of concerns/include pattern and into v1 inline

* remove private constant call

* add v1 accept header to doc spec, fix syntax in a before block

* update controllers to address failing specs

* simplify controller and clarify route config

* flesh out tests for errors

* fix long line

* add missing commas

* return username show route to v0 concern controller

* create separate show route and action name, remove nesting from create/update params requirement

* clean up syntax in controller params and update show path in specs; move routes

* fix up syntax in params permit

* create organization in index spec

* one more syntax tweak for org params

* refactoring to one show route that handles username or id

* tweak spec syntax to expect the right array

* tweak controller and specs, simplify routing to show

* remove create route, action, and specs from this branch

* add clarifying comment in show controller action

* add explicit not found return to show route

* fix controller formatting causing 404 errors

* remove comment, update specs

* remove commment and fix id show response and specs

* fix show route and request spec for username param

* update unauthorized user specs to use put for now instead of post, regenerate swagger docs

* adjust update 422 spec to break org validity

* fix admin update spec, rerun swagger

* reorganiza controller actions, update specs, ensure authorized update and delete

* improve spec, handle finding one org more gracefully, delete via worker

* copy routes into api namespace instead of moving them from general namespace

* update param in v0 show route to fit more general naming

* regenerate v1 swagger docs

* use profile image url getter in update controller response

* update swagger docs and remove unneeded comment from org' model

* configure organizations destroy action for super admins only (for now)
2023-07-19 09:51:05 -04:00
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