Commit graph

398 commits

Author SHA1 Message Date
Ben Halpern
2f9769a89d
Add new sidebar billboard locations and remove legacy campaign area (#20562)
* Add new sidebar billboard locations

* Remove some specs

* Remove campaign tests

* Adjust tag-allowed billboards

* Fix up targeting functionality

* Fix sidebar third render
2024-02-08 16:55:48 +00:00
Mac Siri
2746586eea
Fix flaky cypress specs (#20579) 2024-02-01 17:54:19 -05:00
Mac Siri
afa73e06e3
Replace Webpacker with Esbuild (#20470)
* Migrate to esbuild WIP

* Add exclude

* Remove redundant file

* Move file

* Move to javascript_include_tag

* Lint fix

* WIP

* WIP

* Add watch mode to esbuild WIP

* Get jest working

* Remove babel

* Revert "Remove babel"

This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73.

* More WIP

* Got image to load

* WIP

* Resolve audit

* Lint fix

* WIP

* Fix jest spec

* [CI] Remove asset-restore for test build stage

* Production compliant

* Temp disable sourcemap

* Update glob

* Add esbuild helper to stimulus

* Import fragment

* Temp disable coverage to see failing tests

* Fix broken spec

* Address lint

* Set proper es6 target

* Use esbuild for everything

* wait what

* Revert "Set proper es6 target"

This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf.

* Revert "Use esbuild for everything"

This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3.

* Replace uglifier with terser

* New compiled assets version

* Remvoe honeybadger-io/webpack

* Remove cypress coverage checks for now

* Update jsconfig.json

* Update docker-compose

* Remove public/packs-test from ci cache
2024-01-25 20:29:21 +00:00
Anna Buianova
e0ba90d60a
Allow to remove suspended role (#20439)
* Allow to remove suspended role

* Fixed the cypress spec for removing suspended role
2023-12-12 11:57:03 +00:00
Ben Halpern
9eaff67318
Update styling and refine features for analytics page (#20410)
* Update styling and refine features for analytics page

* Remove follower reference from js

* Update html

* Adjust test
2023-11-30 16:07:16 -05:00
Ben Halpern
a4a1de964d
Move features along in deprecation status ✂️ (#20315)
* Move features along in deprecation status

* Remove unnecessary tests
2023-11-07 09:50:08 -05:00
ktmouk
ddf045ac68
Fix flaky Cypress test (#20232) 2023-10-09 07:35:03 -04:00
Mac Siri
f73ee949c4
Fix flaky cypress spec (#20185) 2023-10-03 13:09:15 -04:00
Ben Halpern
456a5e61d2
Add filters to /mod (#20179)
* Add filters to /mod

* Adjust cypress to look for proper text

* Adjust cypress to be less sensitive
2023-10-02 11:47:49 +07:00
depfu[bot]
952ffaac4e
[js] Update eslint-plugin-cypress 2.12.1 → 2.15.1 (minor) (#20168)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: dukegreene <duke@forem.com>
2023-09-28 11:52:47 -04:00
Ridhwana
ae9d1b5ace
Hide the buttons on the tag page (#20148)
* feat: step 1 - add the buttons to the html template

* refactor: renamed the class to be prepended with js-

* feat: add the js-tag-card class to the entire tag-card div

* feat: add the relevant data elements and tag-id to the tag-card div

* feat: add the required data elements for the top level js-tag-card

* feat: use @tag instead of tag

* refactor: rename the tag pack file

* refactor: rename the Tag file component

* feat: add a snackzone so that the snackbar can be added there

* feat: remove the follow-actions-button and the hide-actions-button from the tag pages so that it doesn't conflict with the 'followButtons' pack whne we need to add it

* spec: update the specs for tags

* chore: follow-action-button renamed to follow-tag-button and hide-action-button to hide-tag-button

* refactor: js-classes

* chore: add some comments

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-09-26 19:49:57 -04:00
Rajat Talesra
5fb94d372b
Reset password design and Signup page update for invite-only forems. (#20145)
* Private forem signup issue fix

* Minor design fixes

* Added click on logo

* Reset password design

* UX fix

* Updated dynamic contact

* Padding fix and test fix

* Complete translations

* Skipped flay test 'should show Feature Post button on an unfeatured post'
2023-09-22 14:49:31 +05:30
PJ
90944bb36b
Skip feed events e2e specs (#20124) 2023-09-15 17:36:08 +01:00
Duke Greene
7d1d0ff80b
comment out flaky specs and add comments for exploration/refactor (#20103)
* comment out flaky specs and add commments for exploration/refactor context

* comment out only the specs which call reload for now

* use it.skip rather than commenting out
2023-09-14 06:25:27 -04:00
Rajat Talesra
a679486572
Redesign sign-up and login pages (#20065)
* Signin Signup screen update

* Design for signin signup finished

* On hover effect

* Fixed few tests

* Fixed rSpec tests

* Minor design fixes

* Design changes suggested by Anuj

* Test fixes

* Updated test

* Nit fixes

* Path changes and footer and topbar hidden

* A bit simplified css

* Removed custom css

* Updated tests

* Nit css fixes

* Updates as per Ridhwana's review

* CSS fixes

* Used js-registration
2023-09-13 21:46:57 +05:30
Narender Singh
da7c25c987
add new org button in settings (#20014)
* add new org button in settings

* add support for mobile view

* remove varible for new org check

* fix design suggestions

* fix org settings test

* remove the settings for test since this text does not exists in user settings

* remove un-used copy

* Update class name

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

* Fix follow user spec

* fix the rspec test case

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-09-13 11:52:57 +02:00
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
PJ
95ca9d37c5
Record feed events for public reactions (#20079)
* create feed event on feed reaction

* move feed event creation to feed event model

* tiny whoops

* fix failing specs

* slightly less flaky e2e spec (maybe)

* tiny fixes (couldn't resist)
2023-09-12 08:36:10 -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
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
789907d289
Tags Dashboard Error Handling (#20051)
* feat: add an error modal for the dashboard page tags

* spec: add the tests for the tags dashboard pages

* spec: add the tests for the hiding tags dashboard pages
2023-09-11 11:41:56 +02:00
Ridhwana
3c34de120b
Add snackbars to /tags (#20046)
* feat: add snackbars to /tags

* chore: update the props for the component"

* feat: update snackbar for following

* feat: add tests for snackbars

* feat: add error handling and show error on snackbar

* chore: tweaks to syntax

* refactor: abstract out the details

* fix: check for null explicitly

* refactor: use hidden instead of assigning a var
2023-09-07 12:03:41 +02:00
Ridhwana
4a8dc9abf6
Unhiding a tag should unfollow it too (#20040)
* feat: update the logic for hiding adn unhidng a tag on /tags

* feat: update the logic for hiding and unhidng a tag on /dashboard/following_tags|hidden_tags

* spec: update the tests for the /tags dashboard

* spec: removes the nav item count spec
2023-09-07 10:35:17 +02:00
Ridhwana
f4a9c192c0
Follow and Hidden Buttons on /tags page (#20005) 2023-08-30 14:29:00 +02:00
Joshua Wehner
d227e1d285
Suppressing articles negative-follow tags from appearing in the "relevant" feed (#19948)
* Try suppressing all negative-follow tags

* userData isn't always available

* Bolster test coverage for tag filter scenarios

* Antitags for the non-basic 'strategy'

* Rename antitags -> hidden_tags

* Rename 'anti_tags' -> 'hidden_tags' as well

* Use userData.followed_tags to derive hidden_tags
2023-08-28 10:11:20 -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
Anna Buianova
9c9663a5b5
Renamed display_ads to billboards: variables and descriptions in tests (#19920)
* Renamed display ad variables and descriptions in tests

* Renamed api docs display_ads => billboards

* Updated billboard cypress seeds

* Fixed api billboards specs

* Update db/schema.rb

Co-authored-by: Duke Greene <dukegreene@gmail.com>

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Duke Greene <dukegreene@gmail.com>
2023-08-11 15:00:07 -04: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
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
Duke Greene
1ef88365c4
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>
2023-08-03 10:16:19 -04:00
Joshua Wehner
cf13879211
Remove feature-flag for subscribe-to-comments (#19774) 2023-07-27 10:31:55 -03: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
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
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
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
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
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
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