Skip to content

Commit 04332bc

Browse files
committed
Merge branch 'main' into mobile-app/scoped-stylesheets
* main: Use decimals for ordered lists Update cached fragments Revert "Merge pull request #1865 from basecamp/public-avatar-caching" Show only public cards on public boards Swap order of avatar links Limit length of full name during signup Make layout bulletproof Serve own avatar from its own endpoint
2 parents 1f34608 + df9a6de commit 04332bc

9 files changed

Lines changed: 33 additions & 3 deletions

File tree

app/assets/stylesheets/web/rich-text-content.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@
2929
}
3030

3131
ol, ul {
32-
list-style: disc;
3332
padding-inline-start: 3ch;
3433
}
3534

35+
ol {
36+
list-style: decimal;
37+
}
38+
39+
ul {
40+
list-style: disc;
41+
}
42+
3643
li:has(li) {
3744
list-style: none;
3845

app/controllers/public/base_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def set_board
1111
end
1212

1313
def set_card
14-
@card = @board.cards.find_by!(number: params[:id]) if params[:board_id] && params[:id]
14+
@card = @board.cards.published.find_by!(number: params[:id]) if params[:board_id] && params[:id]
1515
end
1616

1717
def set_public_cache_expiration

app/models/signup.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Signup
88

99
validates :email_address, format: { with: URI::MailTo::EMAIL_REGEXP }, on: :identity_creation
1010
validates :full_name, :identity, presence: true, on: :completion
11+
validates :full_name, length: { maximum: 240 }
1112

1213
def initialize(...)
1314
super

app/views/cards/comments/_comment.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<% cache comment do %>
2+
<%# Helper Dependency Updated: avatar_image_tag 2025-12-15 %>
23
<%= turbo_frame_tag comment, :container do %>
34
<%# Cache bump 2025-12-14: action text attachment rendering changed for lightbox -%>
45
<div id="<%= dom_id(comment) %>" data-creator-id="<%= comment.creator_id %>" class="comment flex align-start full-width <%= "comment--system" if comment.creator.system? %>">

app/views/events/_event.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<% cache event do %>
2+
<%# Helper Dependency Updated: avatar_image_tag 2025-12-15 %>
23
<% if lookup_context.exists?("events/event/eventable/_#{event.action}") %>
34
<%= render "events/event/eventable/#{event.action}", event: event %>
45
<% else %>

app/views/notifications/_notification.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<% cache notification do %>
2+
<%# Helper Dependency Updated: avatar_image_tag 2025-12-15 %>
23
<%= notification_tag notification do %>
34
<%= render "notifications/notification/header", notification: notification do %>
45
<%= notification_toggle_read_button(notification, url: card_reading_path(notification.card)) %>

app/views/signups/completions/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<h1 class="txt-x-large font-weight-black margin-block-end"><%= @page_title %></h1>
55

66
<%= form_with model: @signup, url: signup_completion_path, scope: "signup", class: "flex flex-column gap", data: { controller: "form" } do |form| %>
7-
<%= form.text_field :full_name, class: "input txt-large", autocomplete: "name", placeholder: "Enter your full name…", autofocus: true, required: true %>
7+
<%= form.text_field :full_name, class: "input txt-large", autocomplete: "name", placeholder: "Enter your full name…", autofocus: true, required: true, maxlength: 240 %>
88

99
<p>You're one step away. Just enter your name to get your own Fizzy account.</p>
1010

test/controllers/public/cards_controller_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ class Public::CardsControllerTest < ActionDispatch::IntegrationTest
1818
get public_board_card_path(@board.publication.key, @card)
1919
assert_response :not_found
2020
end
21+
22+
test "not found if the card is drafted" do
23+
@card.update!(status: :drafted)
24+
get public_board_card_path(@board.publication.key, @card)
25+
assert_response :not_found
26+
end
2127
end

test/models/signup_test.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,17 @@ class SignupTest < ActiveSupport::TestCase
7272
assert_nil signup.user
7373
end
7474
end
75+
76+
test "#complete with name that is too long" do
77+
Current.without_account do
78+
signup = Signup.new(full_name: "A" * 241, identity: identities(:kevin))
79+
signup.expects(:create_tenant).never
80+
81+
assert_not signup.complete
82+
83+
assert signup.errors[:full_name].any?
84+
assert_nil signup.account
85+
assert_nil signup.user
86+
end
87+
end
7588
end

0 commit comments

Comments
 (0)