Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added app/assets/images/jf-avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/jf-signature.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/stylesheets/_global.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
--z-tooltip: 50;
--z-bar: 60;
--z-tray: 61;
--z-welcome: 62;

/* OKLCH colors: Fixed */
--lch-black: 0% 0 0;
Expand Down
27 changes: 27 additions & 0 deletions app/assets/stylesheets/welcome-letter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@layer components {
.welcome-letter {
position: relative;
view-transition-name: welcome-letter;
z-index: var(--z-welcome);

h2, p {
text-wrap: pretty;
}
}

.welcome-letter__close {
inset: var(--block-space) var(--block-space) auto auto;
position: absolute;
}

.welcome-letter__signature {
background-color: currentColor;
block-size: 3em;
display: inline-block;
inline-size: 8em;
mask-image: url("jf-signature.svg");
mask-position: center;
mask-repeat: no-repeat;
mask-size: 8em 3em;
}
}
2 changes: 2 additions & 0 deletions app/controllers/landings_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
class LandingsController < ApplicationController
def show
flash.keep(:welcome_letter)

if Current.user.boards.one?
redirect_to board_path(Current.user.boards.first)
else
Expand Down
1 change: 1 addition & 0 deletions app/controllers/signups/completions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def create
@signup = Signup.new(signup_params)

if @signup.complete
flash[:welcome_letter] = true
redirect_to landing_url(script_name: @signup.account.slug)
else
render :new, status: :unprocessable_entity
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/controllers/dialog_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ export default class extends Controller {
static targets = [ "dialog" ]
static values = {
modal: { type: Boolean, default: false },
sizing: { type: Boolean, default: true }
sizing: { type: Boolean, default: true },
autoOpen: { type: Boolean, default: false }
}

connect() {
this.dialogTarget.setAttribute("aria-hidden", "true")
if (this.autoOpenValue) this.open()
}

open() {
Expand Down
2 changes: 2 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<%= render "notifications/tray" %>
</div>
<% end %>

<%= render "layouts/shared/welcome_letter" if flash[:welcome_letter] %>
</footer>
</body>
</html>
28 changes: 28 additions & 0 deletions app/views/layouts/shared/_welcome_letter.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div data-controller="dialog" data-dialog-auto-open-value="true" data-dialog-modal-value="true">
<dialog class="welcome-letter panel panel--wide shadow dialog" data-dialog-target="dialog">
<button class="welcome-letter__close btn txt-x-small" data-action="dialog#close">
<%= icon_tag "close" %>
<span class="for-screen-reader">Close dialog</span>
</button>

<div class="txt-align-center margin-block-end">
<span class="welcome-letter__avatar txt-xx-large avatar center"><%= image_tag "jf-avatar.jpg", size: 36%></span>
</div>

<h2 class="txt-medium margin-none txt-tight-lines">Welcome, and thanks for signing up for Fizzy.</h2>

<p></p>

<p>To get you started, we set you up with a Fizzy board called <em>Playground</em>. It’s got a few cards designed to help you learn Fizzy itself. Open each card, go through the simple steps, and you’ll be an expert in Fizzy in no time. You’ll see the <em>Playground</em> when you close this message.</p>

<p>If you ever need a hand, please contact me directly at jason@37signals.com. I'm here for you, we’re all here for you.</p>

<p>Thanks again and all the best,</p>

<span class="welcome-letter__signature"></span>

<p><strong>Jason Fried</strong>, jason@37signals.com<br>
<em>CEO &amp; co-founder of 37signals, makers of Fizzy, Basecamp, and HEY</em>
</p>
</dialog>
</div>
12 changes: 12 additions & 0 deletions test/controllers/signup/completions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ class Signup::CompletionsControllerTest < ActionDispatch::IntegrationTest
assert_response :redirect, "Valid params should redirect"
end

test "shows welcome letter after signup" do
untenanted do
post signup_completion_path, params: {
signup: {
full_name: @signup.full_name
}
}
end

assert flash[:welcome_letter]
end

test "create with blank name" do
untenanted do
post signup_completion_path, params: {
Expand Down