Commit graph

1265 commits

Author SHA1 Message Date
Rajat Talesra
1d60c5ff77
Added dropdown to display ads / billboards (#19106)
* Initial setup work with error

* Dropdown working with error fixed

* Removed repition

* Home page billboard dropdowns added

* Created common file for dropdown

* Complete display ad dropdown usage

* Minor indentation fix

* Minor UI updates

* Minor test update

* Dropdown for billboard optimisation

* Added anchor tags

* Display ad unified code

* Design changes

* Design changes

* Changes to display ad click tracking

* Style changes

* Design change to admin display ad

* Nit fix

* Nit fix

* Updated test
2023-02-27 22:57:01 +05:30
Lawrence
0c8f301227
init commentPreview migration (#19090) 2023-02-10 12:38:13 -06:00
Lawrence
3186f7ae2d
CommentDate Migration to Pack tag (#19025)
* migration init

* create an initializers directory

* remove console log

* migrate localDateTime functions and remove comment date from asset pipeline

* add unit test

* add one more

* year test
2023-02-03 13:40:17 -06:00
Fernando Valverde
605ebbfa3b
Bump localstorage key for podcast player (#19057) 2023-02-03 12:03:39 -06:00
Fernando Valverde
8341c5a5dd
Fix JS error when window.Forem.runtime is not available yet (#19007)
* Add retry with timeout if window.Forem.runtime is not available

* Refactor asset pipeline initializer into webpack bundle

* Remove leftover comment

* Fix CodeQL issue

* Revert Regexp interpolation

* Revert regexp interpolation without verify

* Remove problematic Regexp marked as dangerous by CodeQL
2023-02-03 05:57:49 -06:00
Lawrence
df678d2c03
baseTracking Initializer Migration (#19016)
* baseTracking pack

* Define dataLayer

* disable unused var

* disable another unused var

* remove initializer call from base of asset pipeline

* remove asset pipeline baseTracking file
2023-02-02 13:15:36 -06:00
ktmouk
151a118f57
Fix the last line of editor is not visible (#19023)
Co-authored-by: Lawrence <lawrence@forem.com>
2023-02-02 06:10:24 -06:00
Rajat Talesra
7c6f269b14
Onboarding dark mode fixees (#18996) 2023-01-25 10:53:59 +05:30
Joshua Wehner
30c0485507
Frontend for multiple reactions (v1) (#18808)
* Remove extraneous comment (see 9361d2 and 5c18f8)

* Flexible, multiple reaction types

* Fix reaction counts

* Re-use svg for active state for now

* Update yml, update spec

* Possible temp fix for failing tests

* Colorize reaction icon svgs

* Reaction engagement above post title

* Index reactions engagements (for logged-out)

* Maybe readinglist is special

* Try using crayons' dropdown as a drawer?

* readinglist isn't really public now

* feat: update the styles for the reaction drawer

* Grey background highlight, turn off border/shadow

* Read our feature flag docs, saw this was recommended

* Missed fifth emoji: party/tada

* Fix JS test errors

* Update test with tada

* Suppress flashing engagements when no public reactions

* Liberate jump-to-comments from unicorn replacement

* 'Add reaction' on tooltip

* Don't show reaction emoji on index unless it's been used

* rubocop

* Update heart+ total count when toggling

* Do not include 'readinglist' in drawer/public counts

* Fix semi-public readinglist so that icon is badged for current user

* Tweak heart-plus svg

* Style tweak: border on active reaction

* Show reacted icon on drawer trigger for 1.5 sec

* Tweak styles for engagements bar

* Style tweaks for multiple engagements (#index)

* Trying to get size working through crayons/inline_svg

* Sparkle hearts

* Restore unicorn

* Make heart-plus-active work when user has an active reaction

* Try 'hoverdown' a dropdown that activates with hover

* Long touch?

* Tap *outside* the drawer to close

* Mobile reaction drawer is also supposed to be columns

* More reaction count cleanup

* Final emoticons maybe?

* Fix reaction bug when feature disabled

* Remove readinglist from public reaction counts

* Update specs for new reaction categories

* Shuffle makes specs flaky

* Order does not matter

* rubocop

* Update to preserve readinglist analytics

* Shuffle makes specs flaky

* Fix flickering images, remove icon highlight for now

* Don't update total for readinglist

* reactions_by_user_id

* Try renaming this observer function

* Try unid ids for SVGs

* Remove local test file

* Simplistic test for the unique svg transform

* Fix javascript for current SVG

* Signifcant string literals in this case, rubocop

* Use the right expected output

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-01-23 16:00:50 +01:00
Rajat Talesra
497f494ef3
Removed nav related classes from feedback tabs (#18924)
* Removed bootstrap from listing_categories, listings, navigation_links

* Removed not-used bootstrap classes from admin/tags

* Removed bootstrap from admin/settings

* Fix collapse glitch in profile-fields

* Feedback partial progress

* Feedback partial progress

* Removed form-control

* Replaced card with crayons-card

* Fixed profile field UI

* Removed collapse hide and show classes

* Removed collapse hide and show classes

* Removed collapse hide and show classes

* Nit height fix

* Nit width fix

* Updated tests

* Removed nav related classes from feedback tabs

* Remove btn-classes from commets too.

* Removed row and col-12 classes

* Removed bootstrap classes from Authentication

* Removed bootstrap classes from Mascot

* Removed bootstrap classes from Onboarding

* Removed bootstrap classes from lock/unlock discussions

* Notes design changes

* Removed bootstrap classes from Organization

* Removed bootstrap classes from Organization

* Remove alert bootstrap class from admin.html.erb

* Fixed tab_pane related code

* Enable click listener on notice

* Enable click listener on notice

* Applied suggested changes

* close bootstrap class removed

* Removed element completely
2023-01-09 20:18:28 +05:30
Adarsh Bhadauria
876638194c
Fix search bar disappears on mobile (#18909) 2023-01-09 10:51:40 +02:00
Rajat Talesra
ad16987d7a
Remove bootstrap from admin/comments, admin/data-update-scripts, admin/response_templates and admin/tools and use Crayons (#18869)
* Removed bootstrap from admin/response_template

* Nit fix

* Removed bootstrap from admin/tools

* Removed bootstrap from /admin/tools/feed_playground

* Removed bootstrap from admin/data_update_scripts

* Updated d-none and d-inline

* Applied suggested changes

* Removed forem-group from image_upload_controller.js

* Update app/javascript/admin/controllers/image_upload_controller.js

Co-authored-by: Fernando Valverde <fernando@fdo.cr>

Co-authored-by: Fernando Valverde <fernando@fdo.cr>
2022-12-21 22:26:07 +05:30
Ridhwana
6cb97eeb01
Async Hamburger Menu Implementation + Caching Optimizations (#18818) 2022-12-20 20:00:08 +02:00
Mac Siri
f13a1ec0c2
Actually get buildpulse to work with rspec and jest (#18859)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-19 14:31:29 -05: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
Anna Buianova
1262054a40
Add missing onInput for canonical_url (#18724)
Closes undefined
2022-11-14 09:16:15 -05:00
Eevis Panula
09e327b7c2
Add more descriptive accessible names for save/bookmark-buttons (#18583) 2022-11-10 09:48:13 -05:00
Ridhwana
f070c3d87d
feat: trim the targeted tag (#18704) 2022-11-08 09:04:40 -05:00
Rajat Talesra
b6d90a65b4
Replace comments box on non-signed-in User profile page with signup CTA #18608 (#18635)
* Basic implementation of CTA in place of Recent Comments

* Updated & Added Tests

* Nit fix

* Test fixes

* I18n strings

* Changed UI in main feed too

* Fixed tests

* Nit fix

* Initialised tracking
2022-11-05 02:27:06 +05:30
Rajat Talesra
96d67abf50
Resolve minor UI bug in Admin-Config (#18668) 2022-11-04 16:13:24 -04:00
Moeki Kawakami
7e270452bf
feat: display card HTML for loading during search (#18674) 2022-11-04 13:11:59 -06:00
Joshua Wehner
14ddbc49ec
Tweak image upload validation experience (#18675)
* Restore file control when image upload is invalid

* Tweak invalid file type message when type empty
2022-11-04 11:06:16 +01:00
Jeferson S. Brito
17bedfee55
Fix: onboarding profile bio textarea length (#18611)
Co-authored-by: Fernando Valverde <fernando@fdo.cr>
2022-11-01 17:25:38 -06: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
Rajat Talesra
8b13c755c1
Removed sloan word (#18634) 2022-10-28 01:26:41 +05:30
Ridhwana
cae4c929ec
Save selected tags to the display ad model (#18633)
* 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
2022-10-27 20:22:29 +02:00
Ridhwana
3f9b7c073c
Add a MultiSelect Autocomplete component to the Display Ads Page (#18560)
* 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
2022-10-26 16:24:31 +02:00
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
0a0e2b0a7f
Ensure super moderator actions Note & AuditLog (#18569)
* Specs - before including changes requires

* Include AuditLog Subscribe listen/forget directives

* Ensure Notes (w/ default content) + AuditLog

* Remove old spec - no longer needed
2022-10-12 09:36:41 -06:00
Rajat Talesra
47ec373f16
Updated story book annotations (#18562)
* Updated story book annotations

* Updated story book annotations

* Storybook code updated for css

* Nit fix
2022-10-11 19:43:40 +05:30
Rajat Talesra
895c40c2a7
Updated storybook (#18559) 2022-10-11 12:54:50 +05:30
Anna Buianova
9d755a9d2f
Save list of previously-published articles when user is subject to an "un-publish all" action (#18535)
* Moved logging and deleting comments to Moderator::UnpublishAllArticlesWorker

* Added logging for admin action (unpublish_all_articles)

* Extracted code from UnpublishAllArticlesWorker to the service

* Make it possible to add a note while unpublishing all via admin action

* Added ability to add notes for unpublishing all from moderator action panel

* Fixed setting slug for the AuditLog on unpublishing + spec
2022-10-06 14:17:20 +03:00
Rajat Talesra
9baef6f20c
Fixed quotations issue (#18536) 2022-10-05 15:18:15 +05:30
Fernando Valverde
a36e7027af
Snackbar error message in comments image upload (#18504)
* Snackbar error message in comments image upload

* Shorter inline comment
2022-09-29 14:07:11 -06:00
Ridhwana
b6b9087bfb
Refactor: no need to pass through the ahoy event name dynamically. (#18498)
* refactor: the name does not need to be passed through dynamically

* refactor: the name does not need to be passed through dynamically

* chore: remove name from the js doc
2022-09-28 19:21:38 +02:00
depfu[bot]
76f3b34db0
[js] Update all Yarn dependencies (2022-09-23) (#18421)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-09-23 15:25:03 -04:00
Ridhwana
9dee48dbc2
Add tracking for the registration flow - "Clicked on Create Account" (#18459)
* refactor: move trackEvents to a utilities folder so that it can be re-used

* feat: add a function called trackCommentClicks and use it on the articlePage

* feat: update the auth widget to take the correct properties

* feat: add create account tracking method for hamburger

* feat: add create account tracking method for sidebar left

* feat: whoops, sidebar tracking info added

* feat: add the feed card create account tracking

* feat: whoops add the id to the dom

* feat: add top nav create account tracking

* feat: create account tracking for the registration modal

* fix: callback instead of invoking + rename class

* fix: js-prepend

* feat: some showLogin event tracking

* use the tracking propert

* x - feed.jsx

* fix: oops I removed hidden

* track from the search login

* feat: add tracking for follow button

* fix: main_stories is only being called in view/articles and both are including the FollowButtons pack

* comments track

* feat: remove punc (.)

* chore: cahnge working

* chore: remove tracking-id from modal

* feat: remove ecmascript features

* refactor: rename some events

* feat: referrer page

* feat: add a secondary source for the follow buttons

* feat: remove file that is not used

* chore: rename key

* feat: use @utilities

* feat: add spec for create account clicks

* feat: add key referrer

* fix: tests

* fix: oops

* chore: add commented test

* test for tracking

* feat: update the change by 1

* feat: aggregate_failures

* feat: add data-no-instant back

* feat: try a different way of testing

* refactor: change secondary_source to referring_souce

* feat: change ahoy event test

* feat: add a version number to ahoy tracking

* feat: change the href to pathname

* feat: reply comment tracking

* fix: to be present syntax

* feat: use href instead of pathname

* chore: do not track tags and podcasts follow and remove referrer

* feat: add readinglist

* fix: remove referrer from test

* feat: fail gracefully in instances where there is no tracking data
2022-09-22 16:03:49 +02:00
Anna Buianova
e432c06312
Modified the misleading comment (history was removed) (#18455) 2022-09-19 11:37:24 +03: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
Fernando Valverde
3ab05aafcc
Fix most propTypes in Onboarding components (#18416) 2022-09-06 10:02:10 -06:00
Anna Buianova
6ef1968377
Made published_at immutable after an article has been published once (#18384)
* Don't change published_at for articles that have already been published (even if unpublished later)

* Removed unused code related to changing published_at

* Added specs for updating published_from_feed articles, fixed specs

* Removed old validation

* Added specs for article validation published_from_feed

* Added and reorganized specs for the Article model (setting published_at)

* Remove the commented code, added a spec

* Added specs for unpublishing

* Removed unused update_published_at from article attributes spec

* Fixed nullifying published_at seconds when republishing from rich editor
2022-08-30 11:32:06 +03:00
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
Jeferson S. Brito
e0638d391c
Replace article's save button with bookmark (#17893) 2022-08-19 12:03:57 -04:00
depfu[bot]
34cd4e3675
[js] Update all Yarn dependencies (2022-08-17) (#18343)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-08-18 12:28:43 -04:00
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
Fernando Valverde
60319212ce
Fix jest datetime tests with regex (#18347) 2022-08-17 11:12:09 -04:00
Rajat Talesra
9e0310987e
Adds drag/drop image uploading function to comment editor (#18290)
* Image drag&drop upload in comment area imple

* Removed one line
2022-08-12 19:23:26 +05:30
dependabot[bot]
a1e41daca2
Bump i18n-js from 3.9.2 to 4.0.2 (#18254)
* Bump i18n-js from 3.9.2 to 4.0.2

Bumps [i18n-js](https://github.com/fnando/i18n) from 3.9.2 to 4.0.2.
- [Release notes](https://github.com/fnando/i18n/releases)
- [Changelog](https://github.com/fnando/i18n/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fnando/i18n/commits/v4.0.2)

---
updated-dependencies:
- dependency-name: i18n-js
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* update import of i18n

* fix incorrect setting of locale

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-08-10 16:32:57 -04:00