Commit graph

465 commits

Author SHA1 Message Date
Philip How
021213b841
Redo: New badge display logic on user's profile (#20944)
* new badge display

* fix cypress

* fix cypress

* Fit grid to exact number

* change point at which badges shown on profile header to 7

* remove  accidentally added objects

* remove  accidentally added objects

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2024-05-10 17:45:18 -04:00
Mac Siri
3fccdcb507
Revert "New badge display logic on user's profile (#20936)" (#20941)
This reverts commit 149ae12dd1.
2024-05-09 15:44:18 -04:00
Philip How
149ae12dd1
New badge display logic on user's profile (#20936)
* new badge display

* fix cypress

* fix cypress

* Fit grid to exact number

* change point at which badges shown on profile header to 7

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2024-05-09 11:48:07 -04:00
Ben Halpern
55701f4303
Fix Twitter/X consistency (#20918)
* Fix Twitter/X consistency

* Adjust tests

* Adjust test regex
2024-05-03 12:24:06 -04:00
Philip How
3ceb9a178a
Allow some badges to be awarded multiple times (#20876)
* Add migration, update badgeachievements model and admin view to set flag on badges

* Show multiple badges on profile

* update factory

* badge model validation

* safe navigation to badge?

* add null: false to migratrion
2024-04-23 16:33:43 -04:00
Philip How
b0086c9171
Add mark as spam button on user profile for admins (#20794) 2024-03-25 10:30:16 -04:00
Anna Buianova
f572275c9d
Admin access for spammers profiles and articles (#20721)
* Allow admins to visit spammers profiles and articles pages

* Added spam label to user profile and articles

* Unset cache control headers when providing admin access to spam content

* Removed unused comment
2024-03-12 13:25:59 -04:00
Gabriel Quaresma
02459941a5
Profile bio does not recognize line breaks (#20572)
Co-authored-by: Mac Siri <mac@forem.com>
2024-03-04 20:37:16 +00: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
473594f192
Match spam role with existing suspended actions (#20477)
* Started matching spam and suspended roles

* Match spam and suspended roles in most cases

* Fixed check_suspended for unauthenticated users
2023-12-27 20:12:50 +00:00
ktmouk
bbf2719582
Update OAuth removal instructions (#20036) 2023-10-04 14:43:20 -04:00
Joshua Wehner
c91a652245
Allow trusted users to see whether a user is suspended (#20061)
* Async append user suspended status pill

* Rubocop

* Relocate JS tests, for build & coverage

* Better error-handling for this controller

* Refactor HTML to render pill outside h1

* Continuing to tweak design

* JS class prepended
2023-09-15 08:44:31 -04:00
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
Narender Singh
358a9a4b8f
add id attr settings extensions (#20006)
* add id attr settings extensions

* Update _api_keys.html.erb

* fix typo  extensions keys

* update id for github extension

* Update comment response template extension

* Update web monetization extension
2023-08-29 13:15:20 -04:00
Duke Greene
288206a2b4
speed up organization creation by removing some presence validations (#19952)
* remove presence validation for summary/url/proof, update UI

* simplify everything! use AR validation syntax

* Update app/models/organization.rb

revert reordering of url validation arguments. I had overcomplicated the work with a custom validation, and then upon resetting it, I changed the order unnecessarily
2023-08-22 06:36:16 -04:00
Rajat Talesra
15e3c5ec7c
Burst cache for user profile page (#19868) 2023-08-02 17:58:26 +05:30
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
Jerin K C
6c2c1660db
Fix blank user's name (#19723) 2023-07-21 09:55:41 -04:00
Duke Greene
f163e2c14e
Dukegreene/moderator notifications copy change (#19775)
* update copy for moderator notifications

* use helper to display mod notification in the view

* add missing translate call
2023-07-19 14:02:39 -04:00
Joshua Wehner
862cd54dc7
Refactoring onboarding (#19525)
* Quick refactor onboardings controller(s)

* Quick refactor onboardings controller(s), pt2

* Quick refactor onboardings controller(s), pt3

* Quick refactor onboardings controller(s), pt4

* Quick refactor onboardings controller(s), pt5

* Add test for checkboxes
2023-05-25 10:03:12 +02:00
Ben Halpern
177e973259
Do not show link to welcome thread if it doesn't exist (#19460) 2023-05-12 21:25:43 +05:30
Dhanujha R
857dd285d5
Remove Dark and Light Nav Logo Image from Organization (#19309) 2023-05-08 17:01:03 -04: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
Ridhwana
42b392906b
Migrate initializeUserProfilePage to webpack (#19241) 2023-03-28 12:20:49 -04:00
Joshua Wehner
b812ca5955
(Really) Enable multiple reactions on #index (#19202) 2023-03-22 10:20:00 -04:00
Joshua Wehner
8086ef68ac
Fix bullet issue with includes commentable (#19145)
* Fix bullet issue with includes commentable

* Flatten view logic

* Restore user comment section logic (but bullet-friendly)

* Try fixing podcast_episode -> podcast

* Add test that would have caught the logic bug

* View specs need describe to specific the path

* Remove unnecessary _comments argument

* Ooops, missed saving this
2023-03-20 16:08:03 +01:00
Joshua Wehner
230e77e5cd
Update FilteredAdsQuery and user settings for opting-out of Billboards (#19208)
* Users can only opt-out of external ads

* Move random sampling out of FilteredAdsQuery

* Refactor filtered_ads_query_spec

* Add test for new permit_adjacent setting

* Rubocop

* Use permit_adjacent_sponsors on article sidebar and post-comments

* Remove, unused

* Update copy

* type_matched -> type_of_ads

* Remove non-applicable test

---------

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-03-16 15:23:02 +02:00
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
Gabriel Quaresma
575852f940
feat: update organization slug max limit (#18911) 2023-01-04 21:13:34 +02:00
Fernando Valverde
3170c06077
Fix connect account bug from settings (#18824)
* Fix connect account bug from settings

* Adds a controller concern test for after_sign_in_path_for

* Styling tweaks

* Merge uri query_values and only ignore i=i param

* remove unused stored_location_for and rename path var

* Reintroduce stored_location_for :p

* Reorder path origin priority
2022-12-09 09:58:04 -06: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
Mac Siri
43829bdb96
Change requirement for response_template (#18601) 2022-11-02 12:16:17 -04:00
Rajat Talesra
f458823523
Badges design fixes as suggested by Anuj (#18667)
* Main page design changes

* Changed modal to use own close icon

* Badge main page all designs done

* Design changes

* Badges design fixes

* Nit fix
2022-11-02 16:37:38 +05:30
Thomas Bnt
b482c4215e
💄 Added cursor:pointer to div of badges and mt-4 to btn (#18550)
Co-authored-by: Zerg <rajattalesra4914@gmail.com>
2022-10-25 07:11:56 -06:00
Rajat Talesra
f339ec99d1
Removed unused modal (#18614) 2022-10-24 23:05:34 +05:30
Rajat Talesra
7b0f8b6011
Design fixes for badges (#18445)
* Design fixes for badges

* Badges UI fixes

* Shifted styles to scss file

* Removed gray functionality for badge
2022-09-23 23:32:28 +05:30
Rajat Talesra
5559067e34
Revert "Revert "Entire profile badge redesign" & "Badges page redesign" (#18446)" (#18447)
This reverts commit d7f70eb85b.
2022-09-13 22:06:37 +05:30
Rajat Talesra
d7f70eb85b
Revert "Entire profile badge redesign" & "Badges page redesign" (#18446)
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-09-13 11:39:46 -04:00
Ridhwana
162ddb81e2
Fix the profile page of other users (#18443)
* fix: lonely div

* chore: whitespace
2022-09-13 17:12:31 +05:30
Rajat Talesra
f1176900f0
Badges page redesign (#18419)
* Badges homepage redesign

* badges.scss

* Attempt at solving badge ci check

* Added badge prompt

* Merged with main

* Removed /badge/.. related code

* Revert removing badge page

* Fixed Safari design issue

* Removed not-requried css property

* Trying to remove /badge/

* Updated profile badges

* Fixed userprofile badge

* Accessibility changes + removed failed tests

* Tests passed
2022-09-13 03:07:59 +05:30
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
Joshua Wehner
4e17649e15
Remove generated social images, except for articles#show (#18118)
* Prefer main_social_image (except on articles#show)

See https://github.com/forem/forem-internal-eng/issues/485

* Cleanup social media helpers no longer in use
2022-07-18 12:29:21 +02:00
Joshua Wehner
5dee4a11c1
Allow trusted user to access response templates (#17978)
* Allow trusted user to access response templates

* Add request specs for trusted user templates

* WIP: was just investigating...

* Move permission check to authorizer

* Revert "WIP: was just investigating..."

This reverts commit c38c60f7ab19ce43c174729c2542a9041e9322e2.

* Improved accessibility

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-12 11:37:59 +02:00
Andrew Bone
04ebdbab1c
Typo (#18046)
Yikes, I made a typo
2022-07-06 09:25:34 +01:00
Andrew Bone
4489b9a23f
Truncation long text on profile screen (#18038)
* Allow truncation

* Allow truncation

* Allow truncation
2022-07-05 12:59:15 -06:00
Josh Puetz
77a00d242a
Move API keys from Account tab to Extensions tab in settings (#17862) 2022-06-09 09:44:50 -05:00
yheuhtozr
aa7e5d45fc
i18n keys update for new profile decorator (#17684) 2022-05-18 10:51:06 -04:00
Jeremy Friesen
ca7228084a
Ensuring we don't render call to action when unauthorized (#17640)
Prior to this commit, if the Forem limitted article creation only to
admins, when a new user would sign-up their call to action was to
"Create a Post".  If that new user clicked on the button, they would get
an action unauthorized error.

With this commit, the call to action for Creating a Post is hidden to
that user.

The `users/onboardings/_task_card.html.erb` is rendered as part of the
home page.  The home page, due to our [EdgeCacheSafetyCheck][1], does not
allow us to access attributes of the current user (e.g. are they an
admin); which means we can't add a `if policy(Article).create` to the
HTML erb.  We must instead use the [`application_policy_content_tag`][2]
as well as the [AsyncInfo][3] to help inform the
[applyApplicationPolicyToggles.js pack][4] of the conditional rendering.

Closes forem/forem#17638
Related to forem/forem-internal-eng#347

[1]:8160089f3d/app/controllers/concerns/edge_cache_safety_check.rb
[2]:8160089f3d/app/helpers/application_helper.rb (L390)
[3]:8160089f3d/app/models/async_info.rb (L52-L61)
[4]:8160089f3d/app/javascript/packs/applyApplicationPolicyToggles.js
2022-05-11 15:26:24 -04:00
Arit Amana
41acd673d0
Make Follow Buttons in User, Org and Tag Embeds "secondary" (#17602)
* complete implementation

* Make PR review changes
2022-05-10 16:37:39 -04:00
Suzanne Aitchison
d897dedf6b
move pack declaration outside of cached area (#17588) 2022-05-06 08:57:12 -04:00