Commit graph

406 commits

Author SHA1 Message Date
Anna Buianova
8cc6f37a2d
Rename Admin::DisplayAds controller to Billboards (#19687) 2023-07-07 08:11:35 -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
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
Mac Siri
8bce9f006d
Skip flaky specs (#19665) 2023-06-30 11:51:32 -04:00
PJ
90780fd97a
Fix comment moderation's UI bugs (#19554) 2023-06-23 09:56:24 -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
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
Lawrence
93a70815b3
TimeFixer Initializer Migration (#19268)
* init

* remove from asset pipeline and add tests

* add utc date conversion test

* try removing last tests

* add some more tests

* add tests for more coverage

* add yet more tests

* separate descibe statments

* add dt test back

* more test cleanup

* include pack js files

* add jest back

* Include /packs/ in code coverage metric

* derp

* revert jest

* reformat some of the test accordingly

* try e2e

* fix cypress test

---------

Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-04-27 20:54:39 -05:00
PJ
800ff397e0
Migrate initializeArticleDate and initializeArticleReactions to Webpack (#19377)
* feat: tests for series list on article page

* feat: test for jump to comments button (needs fix)

* feat: tests for reaction drawer on article page

* feat: test for full date on hover??

* feat: add full date on hover tests for all pages with publish dates

* fixed jumping to comments test

* move initialisers to packs

* fix coverage issues

* fix flaky login modal spec

* switch back to using onclick instead of addEventListener
2023-04-25 18:33:43 +01:00
Joshua Wehner
dc1ab81401
Allow DisplayAd to target users via audience segmentation (#19284)
* Trying some models for audience segmentation

* AudienceSegment basics

* Attach AudienceSegment to DisplayAd

* Possibly use a DUS to populate AudienceSegments

* Add to display ad form UI

* Add to display ad API

* Refresh strategy for audience segments

* Add user_id to async ads query

* Maybe :testing -> :manual, for no-refresh segment

* Test & tweak segment refresh

* Testing audience_segment#refresh logic

* Coverage: testing human_readable

* Scope segment refresh to recently active users

* Tweak logic for when to refresh

* Tweak experience levels to match SettingsHelper

* Test for front-end logic

* Fix test, hope this helps coverage?

* Better test names

* One worker for all, many workers for each, perform_bulk

* Fix audience segment UI, needs to use id, not enum

* cron/schedule should RefreshAll

* Singular id in RefreshWorker
2023-04-25 08:41:10 -04:00
fille du chaos
bef1c4a1e0
Migrate initializeDrawerSliders and initializeHeroBannerClose to Webpack (#19324)
* feat: tests for tag page sidebar drawers on mobile

* feat: tests for hero area/banner on home feed

* refactor: move ui interaction initialisers to packs

* remove old filter select implementation
2023-04-17 10:55:02 +01:00
Lawrence
56e10f1306
Notifications Initializer Migration to Pack tag (#19124)
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Lawrence S <lboogie@Lawrences-Air.attlocal.net>
Co-authored-by: Rajat Talesra <rajat@forem.com>
2023-04-14 17:50:07 -04:00
Joshua Wehner
5188ca8138
Cleanup multiple reactions feature flag (#19257)
* Update notifications_helper

* Update notification decorator

* Removed old notifications views

* Remove flag check from _actions partial

* Remove feature flag from views

* Remove flag from model

* Update logic in reaction drawer button

* Missed this somehow

* Update app/assets/javascripts/initializers/initializeArticleReactions.js

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

* Update these tests to multiple reactions

* Adjust logged-out test to account for multiple reactions

* Removed unused

* Try to boost coverage

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-04-07 17:14:10 +02:00
Mac Siri
88108b3037
Implement code coverage for Cypress (#19250) 2023-03-29 15:37:50 -04:00
Ridhwana
42b392906b
Migrate initializeUserProfilePage to webpack (#19241) 2023-03-28 12:20:49 -04:00
Mac Siri
670d82ac3b Fix homeFeed flaky spec 2023-03-02 12:50:45 -05:00
Mac Siri
627cb203f6
Address flaky specs (#19188) 2023-03-02 09:40:06 -05:00
Mac Siri
b7b9e69721
Update Cypress's loginUser command (#19141) 2023-02-20 11:06:21 -05:00
depfu[bot]
624240a348
[js] Upgrade cypress: 10.11.0 → 12.5.1 (major) (#19119)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <mac@forem.com>
2023-02-16 17:06:25 -05:00
Mac Siri
83dbca39ff
[CI] Capture Cypress logs on failure (#19114) 2023-02-14 09:53:47 -05:00
Mac Siri
cb2477a991
Prefer remote_ip in GaEventsController (#19074) 2023-02-06 18:38:00 -05:00
Rajat Talesra
93f73636c7
Post bootstrap changes - remove headings from admin.scss (#19019)
* h1 and h2 design fixes

* h2 redesign fixes

* Removed incorrect code

* Revert incorrect test code

* h3 heading redesign

* h4,h4,h5 headings redesign

* Minor design fixes

* Fixed all heading styles

* Test case fix

* Revert incorrect if condition

* Revert incorrect if condition

* Removed non required div
2023-02-02 15:52:35 +05:30
Mac Siri
2218a14fff
Refactor/Improve addTagsToArticle specs (#19006) 2023-01-24 14:48:01 -05:00
Mac Siri
14b28a1a9c
Use upload-artifact in CI (#18980) 2023-01-19 07:30:59 -05:00
Ridhwana
83afd9f882
Standardize (but also add consistent) headers on the admin (#18936)
* feat: update rubocop to fix some erb_lint errors

* standardize and add headers

* feat: update gemfile

* feat: revert change

* feat: rename gdpr delete requests to gdpr actions

* feat: remove the margin for consistency

* feat: add a skeleton for the api/v1/followers/users spec

* feat: add the operation block

* feat: add two global schema parameters

* feat: add a 'sort' parameter

* feat: add a successful response

* feat: add an unauthorized response

* feat: generate the json

* fix: indentation

* fix: oops remove the spec
2023-01-17 17:07:09 +02:00
Fernando Valverde
d73548a711
Attempt short delay after cypress loginUser failed attempt (#18885) 2023-01-05 15:38:06 -06:00
Ridhwana
790870b459
Add Footer Links (#18886) 2022-12-22 20:33:02 +02:00
Mac Siri
619bce5993
Recreate yarn.lock (#18776)
* Recreate yarn.lock

* Fix lint

* Address failing spec
2022-11-30 07:45:49 -05:00
Ben Halpern
24cf767c9c
Show tag dropdown for Sidebar Right (Individual Post) location (#18779) 2022-11-28 14:16:27 -05:00
Fernando Valverde
271c596a76
Fix human readable name of display ad placement in Cypress (#18767) 2022-11-22 12:33:44 -05:00
Ridhwana
0cfa984b7b
Remove display_ad_tags Feature Flag (#18710)
* chore: remove feature flags

* chore: unstub test
2022-11-21 17:06:29 +02:00
Ridhwana
45e0ea046d
Only show the "Targeted Tags Field" when the selected placement area is "Below the comment section" (#18644)
* feat: Add a pack file that pulls in the MultiSelect Component

* feat: move the tags to its own component

* save tags

* refactor: create a getCSRFToken function in the packs files so that it can be used in the admin

* feat: import the new module in request.js

* feat: remove unnecessary id

* feat: first pass of csrf token test

* chore: update the test

* fix: csrf token

* feat: hide the enw functionality behinda  feature flag

* fix: loading form twice

* refactor: import for csrftoken

* chore: update the description of the function

* feat: use acts_on_taggable to craete a relationship between display_ad and tag

* feat: add a tag field to the display_ad form

* feat: add the selected tags from the multiselect autocomplete component to the input text field that references the tag_list

* feat: add the tag_list to the controller so that we can save it to the db with the display ad parameters

* feat: pull out the tag validation from the article and the display_ads into a concern

* feat: write soem tests for validating the tag on the display_ads model

* feat: add the tag_list as a hidden field

* feat: set the selected tags on edit

* feat: add a js class for the placement area

* feat: use the change in the dropdown to determine whether we show the tags field dropdown

* refactor: rename and brak up fucntions

* feat: show the tags field if the value of the placement area is already set

* fix: move if statement out of the change event

* feat: hide tags field and clear the tag list

* refactor: delete the display ads

* tests: ensure that we test the toggle

* fix:ensure that the tags on the hidden field show up as a string in the input field

* feat: update the jsdoc

* fix: no need to replace space with comma since we showing as string in form

* feat: update the name of the label

* fix: add hidden back
2022-10-31 17:25:57 +02:00
Rajat Talesra
cc4f3556cf
Use preact-modal in adminModal (#18613)
* Commented test

* Removed User subscription related modal code

* Fixed test case

* Updated tests

* Added more tests
2022-10-29 23:58:28 +05:30
Fernando Valverde
d7b5365e6f
Remove old cypress test (#18629) 2022-10-25 16:55:18 -04:00
Rajat Talesra
926d9f2125
Show org stats on organisation page (#18618)
* Add org details

* Added org stat test

* Nit fix
2022-10-25 20:27:54 +05:30
Rajat Talesra
9cc455a38d
Used preact modal for userSubscriptionLiquidTag (#18623)
* Used preact modal for user-subscription

* Updated test cases

* Nit fix
2022-10-25 02:01:52 +05:30
Fernando Valverde
d14d882b13
Make reason for adjustment optional in moderator tag adjustment (#18606)
* Makes reason for adjustment optional for mod tag adjustments

* Makes reason for adjustment in notification conditional on adjustment reason

* Fix cypress element lookup by placeholder text
2022-10-20 09:54:52 -06:00
Fernando Valverde
9ab6edb0b8
Opt in settings for Ahoy Tracking (#18575)
* Opt in settings for Ahoy Tracking

* Typo tweak
2022-10-17 10:11:27 -06:00
VISHAL DEEPAK
b84fa1da08
Sort comments reopen (#18349)
* Sort comments in articles page

* Clickable area in sort comments article is now more approriate

* Comments subtitle is now responsive in articles page

* Consider comments sort order for cache in articles page

* On selecting sort option the refreshed page lands to comments section
2022-09-13 11:37:48 -06:00
Ridhwana
172dfef4bf
Add logged-in vs. logged-out targeting option for Display Ads #18390 (#18400)
* feat: add a migration that creates a display_to column on the display_ads table

* feat: add an enum for display_to

* feat/WIP: add rough draft of the field to the UI and permit it in the controller

* feat: take into account on whether an ad needs to be shown on logged in or out or both + update cache keys on sign in

* fix: if a user is not signed in then we want to display all and logged out

* fix: display_for spec in model

* feat: add some tests for display_to

* feat: style the label

* feat: show the display_to on the index page

* feat: add a seed for e2e

* chore: force true
2022-09-07 17:21:27 +02:00
Julianna Tetreault
de4acd4fa5
Remove Community Emoji from Admin Config 🌱 (#16902)
* Removes all community_emoji-related code

* Removes community_emoji-related specs from codebase

* Updates communitySection.spec.js to test for member_label

* chore: merge conflicts

* feat: remove data update script

* chore: add file back

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-08-30 17:16:58 +02:00
Rajat Talesra
f482e60581
Removed unused brand color field from Profile (#18370)
* Minimal changes for removing brand-color-2

* Removed brand color 2 only for profile

* Updated test
2022-08-30 16:48:48 +05:30
Rajat Talesra
8fa4f8f7b0
Image uploading progress in comments editor + post editor (#18369)
* Image upload loading all cases covered

* Image upload failure added to EditorBody

* Created imageUploadHelpers file

* Minor changes

* Nit fixes

* Error fix

* Added documentation

* Added/Updated tests
2022-08-29 16:01:40 +05:30
Joshua Wehner
3f6cc95f79
Try context-based sorting for username search (#18311)
* Try context-based sorting for username search

* Use the search

* Comment cleanup

* Working on specs for new context behavior

* Front-end provides context

* Try refactoring away from class-level methods

* Comments don't always have context

* Try refactor query to avoid joins and get under timeout

* If we stub the request, the tests might work

* Cleanup unused join fragments
2022-08-18 17:08:46 +02:00
Suzanne Aitchison
fd690982cf
Hide like text if no likes on comment (#18322)
* set label to empty if no likes

* update spec

* fix styling issues when text is removed

* fix missed test text
2022-08-12 15:19:53 +01:00
Jhonatan Hidalgo
d4b71dd89b
Change all tooltip texts on heart/like reactions to like (#18135)
* Change all tooltip text on heart/like reactions icons

All texts of like reactions were changed to 'Like' instead of 'Heart' as well as the style used to display these tooltips.

Some tooltip styles have been changed to maintain consistency in the style between new 'Like' reaction tooltip style

* Add button accessible name

* Append new Like tooltip hasn't been added

Append the missing tooltips and refactored the code. The related E2E test has been updated

* Remove unnecessary tooltips

the new non-required tooltips that were aggregated were deleted

* Fix error code

* Refactoring code

* Adjust hover media queries
2022-08-03 12:44:36 +01:00
Jhonatan Hidalgo
998d39cd4c
Focus comment box when entering by "comments" button from home feed (#18132) 2022-07-28 14:17:46 -05:00
Arit Developer
450af1cd45
Redeploying the Flag/Unflag User functionality (#18235)
* building again

* still building

* still building

* stuck

* Suzanne Holmes on the case

* make report content a button not a link

* revert to link

* add tests

* revert changes made trying to get ModCenter to work

* hide nonworking actions_panel btns in Mod Center

* nudge Travis

* incorporate PR comments

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-28 09:03:37 -04:00
Arit Developer
3fa350c7f2
Revert "Relocate and Refactor "Flag User" Action (#18182)" (#18232)
This reverts commit 8f544ab6ed.
2022-07-27 12:10:22 -04:00
Suzanne Aitchison
898898a46f
Add a new template to custom pages (#18212)
* add nav bar included page template

* add a test, add random seeds with new template
2022-07-27 16:56:59 +01:00