Commit graph

1392 commits

Author SHA1 Message Date
depfu[bot]
5793f71f40
Update cypress and add cypress-multi-reporters (#20085)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <mac@forem.com>
2023-09-12 12:37:24 -04:00
PJ
3f922921e5
Admin setting to control enabled countries for billboard geotargeting (#20083)
* use instance setting for enabled target geolocations

* add validation for enabled geolocations setting

* a start on the UI?

* backend tweaks for UI

* proper crack at autocomplete component

* fix region targeting toggle

* e2e spec
2023-09-12 12:06:00 -04:00
Ben Halpern
eb17b73690
Add new countries to edge cache dictionary (#20084) 2023-09-12 12:05:34 -04:00
Duke Greene
bf4c34636e
display tag moderation history in article's mod panel (#20041)
* logic and markup to display tag adjustment history on article mod panel

* add tag adjustment reason to markup

* add specs for article's tag adjustment association and ordered tag adjustments

* style tag adjustment history

* sketch out cypress test for visible tag moderation history

* tweak spacing and sizing of adjustment history heading

* adjust cypress tests, tag adjustments still coming back empty in spec

* get past first cypress snag by waiting for request and reloading

* add spec for viewing multiple tag adjustments in a post history

* restore defer: true in actions panel js packs call

* add e2e tests for remaining mod views with tag adjustment UI
2023-09-12 07:08:44 -04:00
Juanito Fatas
e1c91d2a64
Fix typo of configuring redis at datadog initializer (#20016) 2023-09-11 10:40:04 -04:00
PJ
3f7d1fbc1a
Create feed impression and click events (#20043)
* getting started: model setup

* basic controller action & spec

* somewhat working click events

* pick up on impressions

* there was an attempt at batching without duplicates

* (better) bulk upsert service

* fix specs?

* touch up feed events JS

* end-to-end specs??

* workers wip

* fix failing user delete spec
2023-09-11 13:32:36 +01:00
Ridhwana
f4a9c192c0
Follow and Hidden Buttons on /tags page (#20005) 2023-08-30 14:29:00 +02:00
Anna Buianova
2d6b740940
Renamed DisplayAd model to Billboard (#19993)
* Renamed Resource Admin: DisplayAd to Billboard

* Renamed DisplayAd to Billboard

* Added a data update script for roles
2023-08-28 08:09:36 -04:00
Ridhwana
5266dd1afb
Showing and hiding tags in the Following and Hidden Tags Pages (#19954)
* feat: remove updated weights

* feat: click on following on the following tags page

* feat: add and listen for the following button click

* fix: dropdowns

* feat: handle hide button click

* feat: update the nav link for following tags

* feat: handel the 'unhide button' on the hidden tags page

* feat: add the styling for the buttons

* feat: add localization

* feat: remove the brand from the card

* feat: add some styling to the page

* feat: init scrolling

* chore: update the name of the file

* feat: abstract out the comment fetch code

* fix: close the attribute

* feta: make some adjustments to where the tag adn the follow show up

* rename class from plural to singular

* feat: updae the comment

* feat: add a mutation observer to initialize the dropdown

* test: follow_craete

* chore: remove irrelevant test

* feat: update the cypress seeds

* feat: update the cypress seeds

* spec: write soem initial tests for the following tags page

* spec: update the unfollow cypress spec

* spec: update the hide cypress spec

* spec: update the posts published spec

* note to add test for pagination

* spec: hidden tags page

* feat: remove aria pressed attributes

* fix: ordering by explicit points gets the page params confused and returns the incorrect and not all results on pagination

* fix: use explicit points

* feat: remove the message at the top of the following and hidden tags page

* chore: remove comment and rather add it to the PR itself

* refactor: do all the actions on success

* feat: refactor the dashboard tag file

* refactor: only show the tagId and followId dataset attributes on the dashboard__tag__container

* feat: disconnect the observer

* chore: add some documentation

* feat: add fr localization

* chore: empty line

* fix: update the dashboardTags page to first declare the observer"
"
"

* fix: update the rails test

* Empty commit

* fix: because I added more tags, the dropdown was longre and covering the body of the editor hence it could not find the text, so I've escaped after selecting my tags
2023-08-25 14:49:39 +02:00
Rajat Talesra
5ef0f43636
Added limited role (#19969)
* Added limited role

* Nit fix

* Updated tetss

* Added spec tests

* Attempt at 100% code coverage

* Rollback DB migration

* Revert timestamp
2023-08-25 14:41:17 +05:30
Rajat Talesra
992ced1908
Tag moderation UI changes (#19906)
* Basic add remove functionality with few tests

* Updated cypress test and added more unit tests

* Rename display ads vars in the views (#19877)

* Renamed display_ads vars to billboards

* Rename local vars in the feed view

* Renamed display-ad in the comment

Co-authored-by: Rajat Talesra <rajattalesra4914@gmail.com>

* Renamed variables in the views

---------

Co-authored-by: Rajat Talesra <rajattalesra4914@gmail.com>

* Update js-routes to version 2.2.7 (#19883)

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

* add field for billboard target geolocations, with unit and e2e tests (#19855)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Duke Greene <dukegreene@gmail.com>
Co-authored-by: PJ <pj@forem.com>
Co-authored-by: Anna Buianova <lightallloy@gmail.com>
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: zhangted <tedcbook@gmail.com>
Co-authored-by: Josh Klar <jklar@forem.com>

* Added autocomplete value off (#19882)

* Bust cache of organization page when new member is added (#19861)

* Remove unused freezeScrolling (#19808)

* Remove unused freezeScrolling

* chore: try see if this helps to skip the flakey test that wasn't being skipped

* chore: try see if this helps to skip the flakey test that wasn't being skipped

* oops: revert the gemfile changes

---------

Co-authored-by: Mai Irie <mai@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>

* ci: Allow workflow_dispatch runs to log in to GHCR. (#19885)

* ci: Fix base image builder... the right way... (#19889)

* Update postcss to version 8.4.27 (#19888)

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

* Replace uses of toBeDefined with toExist  (#19862)

* Replaced toBeDefined with toExist

* Revert db changes

* Rename display ads to billboards: css and js code (#19887)

* Renamed js vars/css names

* Renamed display_ads to billboards in js functions, variables, components

* [ruby] Update sidekiq-unique-jobs 7.1.29 → 7.1.30 (patch) (#19902)

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

* Update oj to version 3.15.1 (#19901)

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

* Updated failing cypress test

* Removed commented code

* Attempt at fixing tests

* Fixed failing tests

* Added more tests

* Basic color and design changes part -1

* Disable/Enable buttons correctly

* Various design updates in Tag adjustement mod UI

* I18N and documentation

* Updated mod panel

* Fixed mod related cypress tests

* Minor design fixes

* Dark mode designs

* Test update

* Mod UI with some bugs

* Updated/simplified code fully-working

* Updated tests

* Added more tests

* Accessibility improvements

* hr line code fix

* Close mod icon bug fix

* Nit fixes

* Design fixes as suggested by Anuj.

* Design fixes

* Dark mode file usage

* Design fixes

* Nit fixes

---------

Co-authored-by: Anna Buianova <lightallloy@gmail.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Duke Greene <dukegreene@gmail.com>
Co-authored-by: PJ <pj@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: zhangted <tedcbook@gmail.com>
Co-authored-by: Josh Klar <jklar@forem.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
Co-authored-by: Mai Irie <mai@forem.com>
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-08-24 00:31:21 +05:30
Ben Halpern
ec7adf56fe
Allow admins to set cover image height configs (#19936)
* Initial basic work

* Bulk of related work, including find/replace on the inputs

* Adjust some tests

* Adjust some specs

* Fix a few more tests

* Clean up tests

* Adjust tests

* Test fiddle

* Adjust crop back to be a param

* Update tests

* Set proper defaults

* Fix some styling

* Adjust enrichment logic and tests

* Adjust form JS

* Update test snapshot

* Clean up formatting

* Fix spec name

* Adjust some css and defaults

* Adjust translation for image provider options

* Switch from fill to fill-down

* Proper fallback image

* Fix tests

* Update app/services/images/optimizer.rb

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

---------

Co-authored-by: Mac Siri <mac@forem.com>
2023-08-21 13:25:16 -04:00
yheuhtozr
c95636ce09
Resync and restore i18n keys (#19899) 2023-08-18 12:48:12 -04:00
Ben Halpern
5c92f886ce
Add feed experiment for Aug 14 (#19937)
* New feed variant for Aug 14

* Update config/field_test.yml

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

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-08-15 10:01:08 -04:00
Ridhwana
991472e4d6
Update vcl list with query params (#19918)
* chore: update list  with the new query parameters added. Fastly ignores stuff we don't add to that list.

* Skip problematic comment spec (#19919)

---------

Co-authored-by: Mac Siri <mac@forem.com>
2023-08-11 00:06:24 +02:00
Anna Buianova
2a1e3d9496
Renaming display ads to billboards: locales keys + UI language (#19908)
* Renamed locale keys and ui language display_ads => billboards

* Revert locale and role name for display ad roles

* Revert locales related to locales to DisplayAd

* Fixed billboards cypress test
2023-08-10 17:23:31 +03:00
Ridhwana
87526453b8
Update following_tags page and create hidden_tags page (#19873)
* feat: add a hidden tags route + controller + view

* refactor: make a re-useable template for hidden_tags and following_tags

* chore: add some  jsdocs to document/help follow the code

* chore: add some  jsdocs to document/help follow the code

* feat: add soem comment changes

* refactor: use more readable string concatenation

* refactor: use more readable string concatenation

* fix: whoops error in template literal

* feat: potential solution to being able to query the paginated hidden tags whilst using the existing following_tags functionality

* feat: typo

* chore: add comment

* update the count for the dashboard sidebar

* feat: add the correct count on the mobile action menu

* spec: update the request spec to ensure that we have the correct tags being displayed

* refactor: query for hidden tags

* chore: update initscrolling language in comments

* refactor: prioritize readability

* refactor: update where clause

* chore: add more clarifying comments

* feat: make sure that we only rename if action exists in initScrolling

* feat: update the styling for the update weights section

* feat: include followable on tag page

* feat: update points to explicit_points in the followings_controller

* feat: abstract out the uncommon UI elements and move them to the top level template

* feat: remove unused html

* chore: remove the antispam tag

* feat: update the tags template and corresponding localization keys

* chore: update the comment

* feat: update the following_tags spec

* spec: update accordingly

* refactor: use URLSearchParams

* feat: update the follow and antifollow/hidden tags

* feat: use a range

* fix: use explicit points

* Empty commit

* feat: update the pagination styles

* update localization
2023-08-10 15:53:04 +02:00
PJ
c202afdec6
Show billboards to users by location (async requests) (#19886)
* use HTTP_CLIENT_GEO in billboards show action

* limit targeting to signed in users

* re-add cypress test

* simplify billboards request spec

* fix header problems hopefully?

* whoops

* Squash filleduchaos/caching-billboards-by-location

* export ISO 3166-2 regions
* wip
* remove ISO 3166-2 regions
* finally, a VCL config that...works?
* update billboard controller & specs

* fix specs

* clean up and document VCL some more

* remove vcl_init sub

* remove billboard fragment caching
2023-08-09 19:07:57 +01:00
Ridhwana
399a0158da
Tag Page partial UI updates (#19866)
* feat: remove the top card color branding

* feat: update the heading

* feat: remove the rotation on the badge

* feat: remove rotation and justify-between the badge

* feat: add number_with_delimiter to the tag count

* feat: change the follow button to be 'primary'

* feat: add a flex column so that the buttons row sticks to the card bottom

* feat: add the posts to the right hand side on the header

* refactor: move the styles to teh css page

* feat: spacing

* fix: tests

* fix: test

* Exclude Page from ReservedWords checks (#19853)

* move initializeSettings to webpack (#19737)

* move initializeSettings to webpack + add tests

* add initializeSettings to InstantClick change block

* dont use classes, use modules

---------

Co-authored-by: PJ <pj@forem.com>

* Renamed leftover @hero_display_ad => @hero_billboard (#19874)

* Reorganize devDependencies & revert strong_migrations (#19870)

* ruby: Upgrade to v3.1.4 (pt. 1, base image only) (#19871)

In #19776 we discovered that basing both the base container *and* the
app container off of `.ruby-version` causes a chicken-and-egg problem
wherein upgrading Ruby versions requires a few stop-and-gos. Let's make
those stops reviewable as separate chunks instead: use a new
`.ruby-version-next` for building base images, not the `.ruby-version`,
thus allowing GitHub Actions to fire off an automated build (which, when
complete, we can take the SHA sum from and use it to open a second PR
updating the app image to use it, and `.ruby-version` can be updated to
match `.ruby-version-next`).

* feat: add the bullet unused_eager_loading query

* feta: update the seeds

* feat: add a smaller gap and make the grid-col 4 on large screens

* feat: do not let the button take the height of the container

* sway the search with the following tags

* feat: keep the description at font size 14px

* tweak elements to ensure an ideal card height of 195px

---------

Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: zhangted <tedcbook@gmail.com>
Co-authored-by: PJ <pj@forem.com>
Co-authored-by: Anna Buianova <lightallloy@gmail.com>
Co-authored-by: Josh Klar <jklar@forem.com>
Co-authored-by: Duke Greene <dukegreene@gmail.com>
2023-08-08 18:57:14 +02:00
Rajat Talesra
d1a2fd1e6c
Move footer to sidebar on home/post index page (#19784)
* Rebased with main

* Footer visibility bug fix

* Minor fix

* Added tests

* Removed initializeFooter as it is not working as expected

* JS code updated as per suggestion

* Updated cache details

* Rebased with main

* Minor fixes

* Minor fixes

* Update .github/ISSUE_TEMPLATE/-core-team-only---new-approved-feature.md

* Update .github/ISSUE_TEMPLATE/-core-team-only---new-approved-feature.md

* Update .github/ISSUE_TEMPLATE/-core-team-only---new-approved-feature.md

* Update .github/ISSUE_TEMPLATE/-core-team-only---new-approved-feature.md

* Update .github/ISSUE_TEMPLATE/-core-team-only---new-approved-feature.md

* Update .github/ISSUE_TEMPLATE/-core-team-only---new-approved-feature.md

* Removed JS logic

* Nit fix
2023-08-02 19:13:10 +05:30
PJ
a9fbb83be0
Add VCL snippet for client geo header (#19780)
* add VCL snippet for client geo header

* update snippet with docs + covering more edge cases
2023-07-31 14:15:40 +01:00
PJ
9754d14182
Fix intermittently broken reaction images on home feed (#19779)
* move reaction icons to base layout

* fix reactions count specs??

* also fix article specs
2023-07-27 19:48:07 +01:00
PJ
7be865b295
Feature-flagged support for filtering billboards by location (#19834)
* add migrations

* add countries gem?

* first pass at location model

* specs 

* add location to filtered ads query

* feature flag and nicer errors

* cosmetic fixes

* more tweaks (remove unnecessary index, add initializer)
2023-07-27 18:13:26 +01:00
Anthony Nguyen
2208d2329c
Handle nil author_id on note on admin member manager view (#19830) 2023-07-26 11:22:42 -04:00
Dhurba baral
84b2f0145a
Displays better name for Admin roles (#19819)
* Displays better name for Admin roles

* Updates translations in fr

* Capitalize role label
2023-07-25 10:46:55 -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
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
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
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
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
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
Anna Buianova
ef5d126a0f
Rename display_ads API to billboards (#19749) 2023-07-14 14:22:52 -04:00
Anna Buianova
7c1721675c
Rename DisplayAdsController to BillboardsController (#19738) 2023-07-12 09:42:46 -04: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
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
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
Ridhwana
8003691b37
Restructure the way we render the feed + add billboard locations on signed in feed (#19652)
* 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: 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
2023-07-03 15:00:44 +02:00
Mac Siri
d183f8c670
Disable DD's log_injection in development (#19660) 2023-06-30 10:11:52 -04:00
Rajat Talesra
bc2d7702ee
Standalone "admin" page for each comment (#19644)
* Created separate comments page

* Optimised code for single comment and multiple comments

* Indifual comments poage added

* Minor header change

* Created show method

* Applied review changes

* Removed like button from admin comments page
2023-06-30 00:31:07 +05:30
Rajat Talesra
28b8980c76
Organisation members page to show all users (#19611)
* Basic implementations

* Working implementation

* See all button added

* Added tests for See All Members button

* Added click test

* Grid design

* Nit fix to trigger build failure

* Applied design changes

* Nit design fixes

* Revert limit

* Applied Ben's suggestion

* Removed fixed hight

* Grid layout changes

* Updated test

* Indentation fix

* Added members page test
2023-06-28 12:35:15 +05:30
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
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
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
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
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