Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update web3version branch to latest forem/main #9

Open
wants to merge 1,171 commits into
base: web3dev-version
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
1171 commits
Select commit Hold shift + click to select a range
67c4897
Fix: copy to clipboard message (#20898)
IasmimCristina May 1, 2024
63fa1ee
Pick winner in header field test (#20911)
benhalpern May 1, 2024
b62ef2b
Updated the twitter icon to X icon - solved icon issue #20356 (#20910)
Darshan-Padia May 1, 2024
1b216d5
Add field test for Digest article list design (#20912)
benhalpern May 1, 2024
1cc59e0
Include cached user in select (#20913)
benhalpern May 2, 2024
7c3e5b2
update style for new follower email (#20908)
PhilipHow May 2, 2024
c32663f
Fix #19037 (#20917)
PhilipHow May 3, 2024
55701f4
Fix Twitter/X consistency (#20918)
benhalpern May 3, 2024
37c2fb1
Fix support for adding social image to the Pages API (#20916)
PhilipHow May 6, 2024
b3b0eaf
Implement MVP frontend for Algolia search (#20909)
benhalpern May 6, 2024
f3d09a2
[ruby] Update request_store 1.5.1 → 1.6.0 (minor) (#20738)
depfu[bot] May 6, 2024
2ed8c44
Update pg to version 1.5.6 (#20930)
depfu[bot] May 7, 2024
2f0fa89
Update rouge to version 4.2.1 (#20931)
depfu[bot] May 7, 2024
2ee84c6
Update terser to version 1.2.2 (#20932)
depfu[bot] May 7, 2024
34df26c
Put Algolia frontend behind feature flag (#20935)
benhalpern May 9, 2024
f77e348
Update omniauth-google-oauth2 to version 1.1.2 (#20933)
depfu[bot] May 9, 2024
149ae12
New badge display logic on user's profile (#20936)
PhilipHow May 9, 2024
3fccdcb
Revert "New badge display logic on user's profile (#20936)" (#20941)
May 9, 2024
40804ee
Remove unnecessary volume mount (#20945)
May 10, 2024
021213b
Redo: New badge display logic on user's profile (#20944)
PhilipHow May 10, 2024
f8df0e5
New Digest field test (#20939)
benhalpern May 10, 2024
b8dd675
Fix margin (#20946)
benhalpern May 10, 2024
d4747ba
Small search index modifion (#20947)
benhalpern May 13, 2024
c845a84
Tweak functionality of digest field test (#20948)
benhalpern May 13, 2024
3b7db20
Further search tweaking (#20949)
benhalpern May 13, 2024
e4ba9b8
Update fastimage to version 2.3.1 (#20938)
depfu[bot] May 13, 2024
5f0af3b
Update devise to version 4.9.4 (#20950)
depfu[bot] May 13, 2024
3e2fc33
Add search typeahead if enabled (#20955)
benhalpern May 16, 2024
8f3799b
Finalize optional Algolia indicator (#20957)
benhalpern May 16, 2024
f4a04bd
Fix Unable to Preview a Reply for a Comment Before Publishing it (#20…
joaoGabriel55 May 16, 2024
eca6d68
Update rexml to version 3.2.8 (#20958)
depfu[bot] May 17, 2024
a8ffeff
Display correct comments count in 'view full discussion' link (#20960)
lightalloy May 20, 2024
65b6ffb
Frontend style tweaks (#20964)
benhalpern May 20, 2024
832b30c
Update field tests (#20965)
benhalpern May 20, 2024
6868320
Add reaction categories to searchable (#20966)
benhalpern May 20, 2024
0c11abe
Removed showing and updating users payment pointers (#20963)
lightalloy May 21, 2024
3b71d65
Tweak site width (#20969)
benhalpern May 21, 2024
e799f2d
Create dependabot.yml (#20968)
benhalpern May 21, 2024
a9c94c0
Fix Algolia infinite loop (#20999)
benhalpern May 21, 2024
9d89be7
Actual proper fix for Algolia loop (#21000)
benhalpern May 21, 2024
42df8d7
Added spec for articles in the users profile (#21047)
lightalloy May 22, 2024
8a19b42
Remove user payment_pointer validation and related code (#21042)
lightalloy May 22, 2024
9921fa9
Update profile cache (#21050)
benhalpern May 22, 2024
f08ed31
Bust profile header cache on assigning/removing spam role (#21068)
lightalloy May 23, 2024
426668e
Add Media Store (#21070)
benhalpern May 23, 2024
fe1ffa8
Add browser/device context to billboards (#20953)
benhalpern May 23, 2024
86801b4
Do not nest cloudflare image results (#21088)
benhalpern May 24, 2024
6c1d9e6
Use safe navigation on user profiles (#21094)
benhalpern May 28, 2024
e0c7bb0
Simplify adjacent billboard logic (#21095)
benhalpern May 28, 2024
bc4c291
Rubocop fixes (#21091)
lightalloy May 28, 2024
d9bf847
Add tweaks to make onboarding tags more relevant (#21096)
benhalpern May 28, 2024
41f4f47
Remove Staccato gem and attempt to get fallback recording to work wit…
benhalpern May 29, 2024
b7886b0
Refactor billboard styles (#21101)
benhalpern May 29, 2024
4696cfc
Fix sidebar over-caching (#21102)
benhalpern May 30, 2024
494c21b
Tweak org ordering in admin (#21103)
benhalpern May 30, 2024
8c54bc2
Add tag moderators on users page (for admins) (#21090)
lightalloy May 30, 2024
123e612
Add safe nav to profile (#21100)
benhalpern May 30, 2024
6a4cb91
Noindex/Not found for spam orgs (#21105)
benhalpern May 30, 2024
cadf249
Add final email CTA to onboarding (#21109)
benhalpern Jun 2, 2024
b5d1b52
Bump Rails version (#21110)
benhalpern Jun 3, 2024
e84c335
Bump digest field test (#21107)
benhalpern Jun 3, 2024
3c367d6
Fix bottom margin on stats (#21114)
benhalpern Jun 3, 2024
b9c1b56
Add augmented content preferences and role (#21113)
benhalpern Jun 3, 2024
c5d11ac
Adjust digest email smarts (#21115)
benhalpern Jun 3, 2024
3bc748c
Update feed field tests june 4 (#21116)
benhalpern Jun 4, 2024
e48d16a
Safe nav on profile (#21118)
benhalpern Jun 4, 2024
07650db
Split up tasks to send DEV Digest (#21119)
benhalpern Jun 4, 2024
8cd64e6
Track billboard impressions and clicks in Digest (#21121)
benhalpern Jun 5, 2024
c45943e
Fix possible sending of Digest twice in day (#21122)
benhalpern Jun 5, 2024
7512b13
Upgrade Rails (#21123)
benhalpern Jun 5, 2024
23b7e18
Update billboard data when click occurs for digest (#21125)
benhalpern Jun 6, 2024
960810f
Record feed events for email (#21126)
benhalpern Jun 6, 2024
5090931
Catch format problem edge cases with exif strips (#21129)
benhalpern Jun 7, 2024
89517b7
Add new-only bucket for billboards (#21131)
benhalpern Jun 10, 2024
21bfe66
Tweak active discussions to include recently viewed posts (#21132)
benhalpern Jun 10, 2024
9077bc4
Adjust EmailDigestArticleCollector to provide more relevant fallback …
benhalpern Jun 11, 2024
4fa900d
Test number of active discussion threads to show (#21134)
benhalpern Jun 11, 2024
86d8370
Prefetch key resources on home page (#21135)
benhalpern Jun 11, 2024
161f647
Adjust EmailDigestArticleCollector query picker logic (#21137)
benhalpern Jun 12, 2024
582e6f7
Add card embed (beta) (#21139)
benhalpern Jun 12, 2024
2c1ec06
Patch popover-billboard style (#21140)
benhalpern Jun 12, 2024
01129cc
New feed test june 16 (#21142)
benhalpern Jun 16, 2024
ecb9a54
Fix experiment name (#21144)
benhalpern Jun 17, 2024
bcb0aab
New digest article ordering (#21145)
benhalpern Jun 17, 2024
713f983
Add index for organic_page_views_past_month_count (#21146)
benhalpern Jun 17, 2024
6842a67
Add rescue in send_periodic_digest_email (#21147)
benhalpern Jun 17, 2024
b94ae04
Article collector fallback (#21148)
benhalpern Jun 18, 2024
0c1070b
Order onboarding tags by hotness (#21151)
benhalpern Jun 18, 2024
7b102aa
Create profile if doesn't exist (#21150)
benhalpern Jun 18, 2024
94c61dd
Add aspect ratio config to logo (#21152)
benhalpern Jun 18, 2024
433b309
Adjust field tests for sidebar active discussions (#21155)
benhalpern Jun 24, 2024
547b0cf
Add new email feed event goal and new test (#21158)
benhalpern Jun 25, 2024
6272c6d
Fix wikipedia link (#21159)
benhalpern Jun 25, 2024
10193f2
New feed experiment (#21166)
benhalpern Jul 1, 2024
7d43af4
Add debounce to search (#21167)
benhalpern Jul 2, 2024
3a3bb14
Add algolia to tag search (#21168)
benhalpern Jul 3, 2024
359bb9d
Algolia index tweaks (#21170)
benhalpern Jul 3, 2024
2be2590
New active discussion tests (#21171)
benhalpern Jul 3, 2024
cbd630a
Add x.com to embed registry (#21172)
benhalpern Jul 3, 2024
731259e
Add target blank to outbound links (#21173)
benhalpern Jul 5, 2024
f4c42cf
Remove deprecated payment pointer and update other payment config/fun…
benhalpern Jul 9, 2024
dd1b353
Allow pages to have + symbol (#21175)
benhalpern Jul 9, 2024
2b387d5
Allow admin to optionally set score cap on post (#21177)
benhalpern Jul 10, 2024
e28ab8b
Update rexml (#21180)
benhalpern Jul 16, 2024
dfecd50
Algolia Insights tracking (#21179)
benhalpern Jul 17, 2024
d64f629
Finalize some field tests (#21181)
benhalpern Jul 18, 2024
d601c61
Add stripe logging (#21183)
benhalpern Jul 24, 2024
e7af2d0
Ben/stripe events 2 (#21184)
benhalpern Jul 24, 2024
5bcc6a4
Adjust stripe event listener (#21187)
benhalpern Jul 30, 2024
767e394
Modify key syntax (#21188)
benhalpern Jul 30, 2024
7ff071b
Add algolia recommendations (#21189)
benhalpern Jul 31, 2024
8523c54
Add footer billboard (#21190)
benhalpern Jul 31, 2024
a30cbd2
Fix top bar cache (#21191)
benhalpern Aug 1, 2024
0228303
Add baseline article score for base subscriber (#21192)
benhalpern Aug 2, 2024
ef54f8e
New feed winner (#21198)
benhalpern Aug 5, 2024
be0138b
Add user role names to body class (#21199)
benhalpern Aug 9, 2024
2a898e9
Add alias for billboard events (#21201)
benhalpern Aug 12, 2024
3398389
Adjust billboard event retabulation throttle (#21202)
benhalpern Aug 13, 2024
e624f65
Allow admins to set max score for some users (#21203)
benhalpern Aug 15, 2024
b31d34c
Require authentication for subscription (#21204)
benhalpern Aug 17, 2024
a19ff35
Add billboard conversion event (#21207)
benhalpern Aug 19, 2024
70d5dc4
Add subscription icon behind feature flag (#21208)
benhalpern Aug 19, 2024
352c89a
Update organic page views tabulator job logic (#21209)
benhalpern Aug 20, 2024
ffc8f8f
Add subscription option to task card (#21210)
benhalpern Aug 20, 2024
2628142
update support email address for coc, readme, and bug report template…
jessleenyc Aug 21, 2024
18ff794
Add subscription email (#21213)
benhalpern Aug 21, 2024
5be61e8
Fix subscriber icon (#21217)
benhalpern Aug 22, 2024
2b8d959
Add some flexibility in auth (#21223)
benhalpern Aug 23, 2024
a6cccf0
Check for nil list edge case (#21225)
benhalpern Aug 23, 2024
0353866
Update cache key for user profile (#21226)
benhalpern Aug 23, 2024
cac02b9
Add logging and tweaks to auth (#21227)
benhalpern Aug 23, 2024
135bfaa
Create mediastore async for articles (#21229)
benhalpern Aug 26, 2024
5d7c614
Add media store to synchronous detail detection (#21230)
benhalpern Aug 26, 2024
84aef58
Put sync detail detection mediastore behind feature flag (#21231)
benhalpern Aug 26, 2024
b983ab1
Rescue RecordNotUnique for reactions handler (#21233)
benhalpern Aug 27, 2024
53ca475
Rescue ActiveRecord::RecordNotUnique for profile (#21234)
benhalpern Aug 27, 2024
bf12426
Add 90-day option to /admin analytics dropdown (#21157)
pkfrank Aug 27, 2024
781f298
Add new Stripe code option (#21236)
benhalpern Aug 27, 2024
422db30
Add terms to stripe (#21237)
benhalpern Aug 27, 2024
ddef9ae
Add cancel subscription functionality and points tweaks (#21238)
benhalpern Aug 28, 2024
d9e8dfb
Add subscriber icon to feed cards (#21247)
benhalpern Aug 30, 2024
9ebeb51
Fix style bug (#21248)
benhalpern Aug 30, 2024
cb84808
Fix bug in reacting to user (#21249)
benhalpern Aug 31, 2024
bd8e87f
Add color to billboards (#21256)
benhalpern Sep 2, 2024
432b8d1
Return email if blank (#21257)
benhalpern Sep 2, 2024
982947a
Add specific statement timeout for rollup (#21258)
benhalpern Sep 2, 2024
009954b
Make fixed billboard not show up for internal nav (#21259)
benhalpern Sep 2, 2024
23fd46a
Allow multiple recent billboard clicks to count for conversion (#21260)
benhalpern Sep 3, 2024
40ea6f3
Make throttle time integer (#21262)
benhalpern Sep 3, 2024
de53043
Make notification send query more efficient (#21264)
benhalpern Sep 4, 2024
8e6b88a
Add distinct for followers query (#21265)
benhalpern Sep 4, 2024
fc9dc22
Adjust safe params list (#21266)
benhalpern Sep 5, 2024
ceacc24
More throttling for billboard tabulating (#21263)
benhalpern Sep 9, 2024
6e66500
Do billboard rollup in batches (#21272)
benhalpern Sep 9, 2024
466de28
Add role targeting to billboards (#21270)
benhalpern Sep 9, 2024
0772f2d
Add role names to sidebar (#21273)
benhalpern Sep 10, 2024
16dfc13
Wrap billboard rollups into transactions (#21274)
benhalpern Sep 10, 2024
0f53f56
Fix delayed billboard logic (#21275)
benhalpern Sep 10, 2024
d425fdc
Add bb param to billboards after save (#21279)
benhalpern Sep 11, 2024
9947b56
Add events to billboard (#21281)
benhalpern Sep 12, 2024
5f0ba60
Add proper self-serve subscription cancel flow (#21284)
benhalpern Sep 17, 2024
45537e5
Fix tags on sidebar of pages (#21287)
benhalpern Sep 17, 2024
e2b7d28
Actually fix sidebar tags with proper logic (#21289)
benhalpern Sep 18, 2024
a3bc6aa
Track external email clicks via redirect (#21294)
benhalpern Sep 27, 2024
39c9bff
Allow cloudflare directory to be set via variable (#21301)
benhalpern Oct 2, 2024
c687dab
Fixed Bug 21280 - Allow Complex Markdown Structure with 3+ Ticks (#21…
yousefmarey12 Oct 3, 2024
5d1ffb9
Conditionally load javascript optimization (#21303)
benhalpern Oct 3, 2024
dc5e987
Add optional backup cache store (#21304)
benhalpern Oct 4, 2024
39bd603
Add full functionality for redis multicache (#21305)
benhalpern Oct 4, 2024
677c8fd
Explicitely require multstore cache (#21306)
benhalpern Oct 4, 2024
1d2529e
Use monkeypatch to write to secondary redis (#21307)
benhalpern Oct 4, 2024
ff42776
Revert Redis Monkeypatch (#21308)
benhalpern Oct 4, 2024
c49e1c9
Render liquid variables as plain text instead or raising error (#21309)
benhalpern Oct 4, 2024
1b30b15
Add stripe billing portal (#21313)
benhalpern Oct 7, 2024
4f12568
Fix codeblock liquid tag parsing error (#21315)
benhalpern Oct 7, 2024
e9a2bc3
Revert code block rendering change (#21316)
benhalpern Oct 7, 2024
981f4c5
View all posts and comments (#21317)
jessleenyc Oct 9, 2024
580ca5e
Allow admin to reward base subscriber role via admin (#21318)
benhalpern Oct 9, 2024
58c6b2e
Adjust signed-out comments-to-show count (#21319)
benhalpern Oct 10, 2024
9b9546e
Allow cache max age to be set via application config (#21320)
benhalpern Oct 10, 2024
3820f78
Remove legacy social image functionality (#21321)
benhalpern Oct 10, 2024
01e0afb
Allow admins to change emails (#21322)
jessleenyc Oct 10, 2024
086a6a2
Make dashboard sidebar render async and adjust dashboard pagination (…
benhalpern Oct 11, 2024
99d0828
Roll up HTTP Clients in datadog tracing (#21326)
benhalpern Oct 14, 2024
e04390c
feat: implement previewPhoto handler (#21323)
joaoGabriel55 Oct 14, 2024
5511dfb
Consolidate dedicated redis tracing (#21327)
benhalpern Oct 14, 2024
31a0b0e
Conditionally include scripts (#21330)
benhalpern Oct 15, 2024
7d6cc44
Make tracing log injection available via env var (#21331)
benhalpern Oct 15, 2024
5803033
Add bots to vcl (#21332)
benhalpern Oct 15, 2024
88336eb
Clean up unnecessary logs (#21333)
benhalpern Oct 16, 2024
f87ca82
Add custom emails to admin area (#21340)
benhalpern Oct 25, 2024
94d7229
Make processed_html_final step to allow final html mods (#21341)
benhalpern Oct 25, 2024
8bafc4e
Adjust roll up logic to step through billboards for the day (#21344)
benhalpern Oct 29, 2024
545bedd
Remove outer transaction from billboard rollup (#21345)
benhalpern Oct 30, 2024
3b56790
Add report abuse dropdown for organizations (#21335)
kkrypt0nn Oct 31, 2024
89e46d0
Fix: X (Twitter) icon not visible in dark mode (#21329)
danielmbrasil Oct 31, 2024
b578ee8
Roll up old data (#21346)
benhalpern Oct 31, 2024
84ab303
Send new_reply_email failure to honeybadger (#21348)
benhalpern Nov 1, 2024
7afc086
Remove superfluous content from article show page (#21349)
benhalpern Nov 5, 2024
c4a1f3d
Adjust vscode settings (#21352)
benhalpern Nov 5, 2024
14dc4ac
Add drip emails functionality (#21354)
benhalpern Nov 6, 2024
9ce5f5c
Pass auth token with secret keybase (#21356)
benhalpern Nov 6, 2024
6ea8b63
Generate session for iframe (#21357)
benhalpern Nov 7, 2024
a05cf1f
Adjust for dynamic secondary domains if they exist (#21358)
benhalpern Nov 7, 2024
f3cf62c
Set seconday domain on remember user token (#21359)
benhalpern Nov 7, 2024
069a86e
Set remember cookie properly (attempt 2) (#21360)
benhalpern Nov 7, 2024
ab6fef6
Allow for "quickie" posts as experimental beta (#21362)
benhalpern Nov 12, 2024
0de840b
Small tweaks for quickies (#21363)
benhalpern Nov 12, 2024
95a21e7
Adjust for presence of InstantClick (#21364)
benhalpern Nov 12, 2024
0630a6f
Tweak style bug for feed card (#21365)
benhalpern Nov 13, 2024
efd41d0
Truncate super long slugs (#21369)
benhalpern Nov 13, 2024
0eb1197
Truncate long title in social image card (#21371)
benhalpern Nov 13, 2024
cf76433
Allow other host in forward_to_app_config_domain (#21370)
benhalpern Nov 13, 2024
933b27b
Fix legacy pagination issues (#21372)
benhalpern Nov 13, 2024
033c1de
Remove erroniously included word (#21373)
benhalpern Nov 13, 2024
82aa036
Small markup fix (#21374)
benhalpern Nov 13, 2024
b0ccf13
Tweak card design (#21376)
benhalpern Nov 14, 2024
6568754
Remove simple format article show (#21377)
benhalpern Nov 14, 2024
ec1fef7
Add following feed tab (#21381)
benhalpern Nov 20, 2024
8fa945e
Simplify following tab (#21383)
benhalpern Nov 20, 2024
9966cfe
Adjust following query to fetch all (#21384)
benhalpern Nov 20, 2024
620eaa8
Fix pathname issue (#21385)
benhalpern Nov 20, 2024
211928f
Fix typo and small style tweaks (#21386)
benhalpern Nov 21, 2024
12e872f
Prefer settings domain to app config domain (#21387)
benhalpern Nov 21, 2024
d2e4e41
Add underlying magic link functionality (#21388)
benhalpern Nov 21, 2024
d405896
Tweaks to magic link underlying functionality (#21389)
benhalpern Nov 21, 2024
6052d86
Add token to vcl safe params (#21390)
benhalpern Nov 22, 2024
0b6e864
Finalize magic link (#21391)
benhalpern Nov 25, 2024
50afd8f
Allow merge tags in custom emails (#21393)
benhalpern Nov 25, 2024
6430e3f
- Fix lint errors causing CI pipeline to fail (#21382)
patHyatt Nov 25, 2024
aec77c3
Clean up flakey specs (#21394)
benhalpern Nov 25, 2024
b22e78e
Max 18 day look back for inactive returning user (#21396)
benhalpern Nov 26, 2024
a2ed32f
Boost posts via quickie (#21397)
benhalpern Nov 27, 2024
75111c1
Ben/tweak share styles (#21398)
benhalpern Nov 27, 2024
ee86abd
Only include form when published (#21399)
benhalpern Nov 27, 2024
5e47b65
Fix unsubscribe and other bug (#21400)
benhalpern Nov 27, 2024
8f78aa5
Include partial instead of liquid render (#21401)
benhalpern Nov 27, 2024
39401f1
Fix typos and grammatical errors in README.md (#21395)
The-Best-Codes Nov 27, 2024
4b49fb8
Small fixes to quickie posts (#21402)
benhalpern Nov 28, 2024
5be0fcd
Add email history and draft to internal emails (#21409)
benhalpern Dec 4, 2024
09b978b
Adjust from email based on type (#21412)
benhalpern Dec 6, 2024
f806ce7
Update email to properly send content (#21414)
benhalpern Dec 6, 2024
d891a9e
Small email editor copy adjustments (#21413)
benhalpern Dec 6, 2024
b169777
Add test emailing to custom emailer (#21416)
benhalpern Dec 9, 2024
7a3e4d0
Set remember token in token login (#21417)
benhalpern Dec 9, 2024
1a93903
Add forem_user_signed_in to edge cache check (#21418)
benhalpern Dec 9, 2024
14d6cdd
Make remember_cookie_values more dynamic (#21419)
benhalpern Dec 9, 2024
e2a5e9f
Use request host instead of domain (#21420)
benhalpern Dec 9, 2024
958c7db
Do not include name in welcome email in some cases (#21421)
benhalpern Dec 9, 2024
991a492
HTML classes refactor (#21423)
benhalpern Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Redo: New badge display logic on user's profile (forem#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>
PhilipHow and benhalpern authored May 10, 2024
commit 021213b841063cceecb15462ad07b8347e2a8f2f
8 changes: 7 additions & 1 deletion app/assets/stylesheets/config/_generator.scss
Original file line number Diff line number Diff line change
@@ -161,7 +161,13 @@
'3': repeat(3, minmax(0, 1fr)),
'4': repeat(4, minmax(0, 1fr)),
'5': repeat(5, minmax(0, 1fr)),
'6': repeat(6, minmax(0, 1fr))
'6': repeat(6, minmax(0, 1fr)),
'7': repeat(7, minmax(0, 1fr)),
'8': repeat(8, minmax(0, 1fr)),
'9': repeat(9, minmax(0, 1fr)),
'10': repeat(10, minmax(0, 1fr)),
'11': repeat(11, minmax(0, 1fr)),
'12': repeat(12, minmax(0, 1fr))
),
(),
true
11 changes: 1 addition & 10 deletions app/controllers/stories_controller.rb
Original file line number Diff line number Diff line change
@@ -207,16 +207,7 @@ def handle_user_index

assign_user_github_repositories

# @badges_limit is here and is set to 6 because it determines how many badges we will display
# on Profile sidebar widget. If user has more badges, we hide them and let them be revealed
# by clicking "See more" button (because we want to save space etc..). But why 6 exactly?
# To make that widget look good:
# - On desktop it will have 3 rows, each row with 2 badges.
# - On mobile it will have 2 rows, each row with 3 badges.
# So it's always 6. If we make it higher or lower number, we would have to sacrifice UI:
# - Let's say it's `4`. On mobile it would display two rows: 1st with 3 badges and
# 2nd with 1 badge (!) <-- and that would look off.
@badges_limit = 6
@grouped_badges = @user.badge_achievements.order(id: :desc).includes(:badge).group_by(&:badge_id)
@profile = @user.profile.decorate
@is_user_flagged = Reaction.where(user_id: session_current_user_id, reactable: @user).any?

21 changes: 12 additions & 9 deletions app/views/users/_badges_area.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<div class="crayons-card crayons-card--secondary">
<header class="crayons-card__header">
<h3 class="crayons-subtitle-3"><%= t("views.badges.heading") %></h3>
</header>
<% if defined?(show_heading) ? show_heading : true %>
<header class="crayons-card__header">
<h3 class="crayons-subtitle-3"><%= t("views.badges.heading") %></h3>
</header>
<% end %>

<div class="crayons-card__body">
<div class="grid gap-4 grid-cols-3 s:grid-cols-4 m:grid-cols-2 align-center items-center js-profile-badges">
<% achievements.group_by(&:badge_id).each_with_index do |(badge_id, badge_achievements), i| %>
<% grid_class ||= "grid-cols-3 s:grid-cols-4 m:grid-cols-2" %>
<div class="grid gap-4 <%= grid_class %> align-center items-center js-profile-badges">
<% grouped_badges.each_with_index do |(badge_id, badge_achievements), i| %>
<% achievement = badge_achievements.first %>
<div role="button" onclick="window.Forem.showModal({size: 'medium', showHeader: false, contentSelector: '#badge-<%= achievement.badge_id %>', overlay: true})"
title="<%= achievement.badge_title %>"
class="js-profile-badge <% if i >= limit %>hidden<% end %> relative">
<img src="<%= optimized_image_url(achievement.badge_image_url, width: 180) %>"
alt="<%= achievement.badge_title %>"
class="mx-auto max-w-75 h-auto align-middle"
style="object-fit: contain; cursor: pointer; width: 100%; aspect-ratio: 1 / 1;"
class="mx-auto w-75 h-auto align-middle"
style="object-fit: contain; cursor: pointer; width: 100%; aspect-ratio: 1 / 1; max-width: 80px;"
loading="lazy" />
<% if badge_achievements.length > 1 %><div class="badge-indicator" title="<%= t("views.badges.indicator", user: @user.name, number: badge_achievements.length) %>"><%= badge_achievements.length %></div><% end %>
</div>
@@ -24,9 +27,9 @@
<% end %>
</div>

<% if limit > 1 && count > limit %>
<% if limit > 1 && grouped_badges.size > limit %>
<button type="button"
class="crayons-btn crayons-btn--ghost-brand crayons-btn--s w-100 js-profile-badges-trigger">
class="crayons-btn crayons-btn--ghost-brand crayons-btn--s w-100 mt-3 js-profile-badges-trigger">
<%= t("views.badges.all", count: count) %>
</button>
<% end %>
16 changes: 9 additions & 7 deletions app/views/users/_sidebar.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<div class="m:gap-4 hidden m:grid js-user-info">
<% cache "user-profile-sidebar-additional-#{@user.id}-#{@user.github_repos_updated_at}-#{@user.badge_achievements_count}-#{@user.organization_info_updated_at}", expires_in: 2.days do %>
<% if @user.badge_achievements_count.positive? && @user.badge_achievements_count <= 6 %>
<%= render partial: "users/badges_area", locals: {
grouped_badges: @grouped_badges,
count: @user.badge_achievements_count,
limit: 6,
show_heading: true,
grid_class: "grid-cols-3 s:grid-cols-4 m:grid-cols-2"
} %>
<% end %>
<% if @user.organizations.present? %>
<div class="crayons-card crayons-card--secondary crayons-layout__content">
<header class="crayons-card__header">
@@ -22,13 +31,6 @@

<%= render partial: "users/github_repositories_area", locals: { repositories: repositories } %>

<% if @user.badge_achievements_count.positive? %>
<%= render partial: "users/badges_area", locals: {
achievements: @user.badge_achievements.order(id: :desc).includes(:badge),
count: @user.badge_achievements_count,
limit: @badges_limit
} %>
<% end %>
<% end %>

<% cache "user-profile-sidebar-profile-details-#{@user.id}-#{@user.profile_updated_at}", expires_in: 10.days do %>
15 changes: 13 additions & 2 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -123,9 +123,20 @@

<%= render "users/metadata" %>

<div class="p-3 pt-0 block m:hidden js-user-info-trigger-wrapper">
<button type="button" class="crayons-btn crayons-btn--outlined w-100 js-user-info-trigger"><%= t("views.users.more", user: @user.username) %></button>
<% if @user.badge_achievements_count >= 7 %>
<%= render partial: "users/badges_area", locals: {
grouped_badges: @grouped_badges,
count: @user.badge_achievements_count,
limit: 12,
show_heading: false,
grid_class: "grid-cols-#{[@user.badge_achievements_count, 6].min} s:grid-cols-#{[@user.badge_achievements_count, 8].min} m:grid-cols-#{[@user.badge_achievements_count, 12].min}"
} %>
<% end %>

<div class="p-3 block m:hidden js-user-info-trigger-wrapper">
<button type="button" class="m-3 crayons-btn crayons-btn--outlined w-100 js-user-info-trigger"><%= t("views.users.more", user: @user.username) %></button>
</div>

</header>
</div>
</div>
14 changes: 7 additions & 7 deletions cypress/e2e/seededFlows/profileFlows/userProfile.spec.js
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ describe('User Profile', () => {

cy.get('.js-user-info').contains('Organizations').should('be.visible');

cy.get('.js-user-info').contains('Badges').should('be.visible');
cy.get('.js-profile-badges').should('be.visible');

cy.get('.js-user-info')
.contains('posts published')
@@ -35,25 +35,25 @@ describe('User Profile', () => {
});

describe('toggle profile badges', () => {
it('should show 6 badges by default if there are more than 6', () => {
it('should show 12 badges by default if there are more than 12', () => {
cy.get('.js-profile-badges')
.findAllByRole('button')
.should('have.length', 6);
.should('have.length', 12);
});

it('should show a button to show all the badges if there are more than 6', () => {
cy.findByRole('button', {
name: 'Show all 7 badges',
name: 'Show all 13 badges',
}).should('be.visible');
});

it('should show 7 badges when the button is clicked', () => {
it('should show 13 badges when the button is clicked', () => {
cy.findByRole('button', {
name: 'Show all 7 badges',
name: 'Show all 13 badges',
}).click();
cy.get('.js-profile-badges')
.findAllByRole('button')
.should('have.length', 7);
.should('have.length', 13);
});
});
});
2 changes: 1 addition & 1 deletion spec/support/seeds/seeds_e2e.rb
Original file line number Diff line number Diff line change
@@ -1014,7 +1014,7 @@
##############################################################################

seeder.create_if_none(Badge) do
7.times do |t|
13.times do |t|
Badge.create!(
title: "#{Faker::Lorem.word} #{rand(100)} #{t}",
description: "#{Faker::Lorem.sentence} #{rand(100)}",
1 change: 0 additions & 1 deletion spec/views/users/main_feed_spec.rb
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
allow(view).to receive(:feed_style_preference).and_return("basic")
end
assign(:user, user)
assign(:badges_limit, 6)
assign(:stories, [])
assign(:comments, [])
assign(:pinned_stories, [])