-
Notifications
You must be signed in to change notification settings - Fork 16
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
WIP: User flow redesign #736
Conversation
New /tea_times (TeaTimes controller, index action) page showing the month's tea times. Old /tea_times path moved to /tea_times/list. Homepage updated so the CTAs on the homepage now lead to /tea_times.
…login After selecting a tea time at /tea_times, save the tea time they selected in Devise's stored location in the session and redirect to it after signup/login.
If the user's home city is blank and they sign up for a tea time, set their home city to that tea time's city.
before_action :authenticate_user! | ||
before_action :authorized?, only: [:new, :edit, :create, :update, :cancel, :destroy, :index] | ||
before_action :set_tea_time, except: [:index, :list, :new, :create] | ||
before_action :authenticate_user!, except: [:index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/tea_times
is accessible publicly now.
before_action :use_new_styles, except: [:create, :update, :cancel, :destroy] | ||
|
||
# GET /tea_times | ||
# GET /tea_times.json | ||
def index | ||
@tea_times = TeaTime.this_month.order(start_time: :asc).includes(:city).all | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are converting a list of tea times into a hash like:
{
"San Francisco": [TeaTime, TeaTime, ...]
"NYC": [TeaTime, TeaTime, ...]
}
along with a list of names in @cities
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return an array of TeaTime
, not a hash. Additionally, this_month
isn't a standard AR Scope and it's not defined on the TT model, so you'll need something like where(:created_at => Time.now.beginning_of_month..Time.now.end_of_month)
instead I think. Might want to make the span a rolling 4 week period too so it doesn't weirdly cut over towards the end of a month?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: array: Whoops, my bad for not being clear. I meant this comment to 'introduce' the following lines of code which are doing the process of converting that list to a hash.
Re: scope: I added a custom scope in the model, let me know if it looks right: https://github.com/TeaWithStrangers/tws-on-rails/pull/736/files#diff-c0448cf921e60c620dcf5c85c1718605R35
Re: rolling period: This was something Ankit requested in the spec - I think the idea was to have tea times come out in "batches" at the beginning of the month.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: rolling period — Mark is right on what I suggested in the spec. We discussed having following month's tea times be available with the click of a "Show Next Month's Tea Times" button. Not sure if we landed on a conclusion there. @markbao Do you remember?
@@ -70,8 +70,20 @@ | |||
</button> | |||
<% end %> | |||
<% end %> | |||
<% elsif (no_signin_button ||= false) # No signin button; don't show signin CTA text %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the /tea_times
page with the new flow, we only want to display "Count Me In" and "Join Waitlist" buttons. We don't want to display "Sign in" buttons, so we have a special branch for the /tea_times
page.
<% else %> | ||
<%= link_to new_user_session_path do %> | ||
<%= link_to new_user_session_path(redirect_to_tt: tea_time.id) do %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/signup
page now accepts a ?redirect_to_tt=123
querystring parameter which is saved in the session as the tea time to redirect to.
app/views/tea_times/index.html.erb
Outdated
@@ -0,0 +1,50 @@ | |||
<% next_month_name = Date.today.next_month.strftime("%B") %> | |||
|
|||
<div class="cover-photo" style="background-image: linear-gradient(to bottom, rgba(247, 191, 77, 0.87), rgba(247, 191, 77, 0.87)), url('<%= image_path("missing-city-image.jpg") %>'); margin-bottom: 50px;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styles are inline because @ankitshah811 will do the CSS and I don't want to create classes that might be rewritten later.
app/views/tea_times/index.html.erb
Outdated
</div> | ||
<% @tea_times_by_city.each do |city, tts| %> | ||
<div class="tt-set-container"> | ||
<div class="tt-container tt-city-name" style="border: 5px solid #EF6236; color: #EF6236; font-weight: bold; height: 200px; padding: 20px; font-size: 30px; text-transform: uppercase; text-align: center;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above (Styles are inline because @ankitshah811 will do the CSS and I don't want to create classes that might be rewritten later.)
app/views/tea_times/index.html.erb
Outdated
<% end %> | ||
</div> | ||
<div> | ||
<button>Email me in <%= next_month_name %></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet implemented.
app/controllers/static_controller.rb
Outdated
# to redirect to after signup | ||
# See https://github.com/plataformatec/devise/wiki/How-To:-Redirect-back-to-current-page-after-sign-in,-sign-out,-sign-up,-update | ||
if params[:redirect_to_tt] && TeaTime.find(params[:redirect_to_tt]) | ||
store_location_for(:user, '/tea_times/' + params[:redirect_to_tt].to_i.to_s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the param should be coerced to a string automatically when you concatenate it to the result of store_location_for
- does it not work without the to_i.to_s
that way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was a bit of a weird design decision. I was thinking that it was possible that params[:redirect_to_tt]
might not be a string containing an integer, so here I was ensuring that it was an integer, but if we do TeaTime.find(params[:redirect_to_tt])
(which I added later) that already checks if it's an integer. I'll remove this.
Button on /tea_times to remind next month now goes to signup page. Shows alert that they will be reminded next month after singup. Signup page now has home city selector. Clicking a tea time as a logged-out user and going to the signup page will fill in the home city automatically. Updated redirect paths to remove city pages from user flow.
Previously, pages navigated to via Turbolinks did not cause modals to be attched.
@markbao Misc q's —
Assuming this directs to http://www.teawithstrangers.com/signup. If user clicks link to go to http://www.teawithstrangers.com/signin from that page, does the
Assuming this also redirects to Sign Up page?
At least, we want to wrap this selector in the drop down markdown/style used in settings page (see screenshot). If it's trivial, would love to use the Standard Select option here (https://harvesthq.github.io/chosen/) but with our styles. Other: "Sign up for a tea time" and "Join tea time" currently direct to home city page. Not sure what happens if no home city is selected. Regardless, these should point to |
Yes, remove them. Redirect all city page references to /tea_times
Working on this now and will commit changes
WIP @me
Same logic as /tea_times
Link to see next month's tea times. Will design into /tea_times
Don't understand this. Can you clarify @markbao ?
Remove 'set home city' button. All CTAs should be to (1) register for tea time > (2) sign up so we can tell you about tea times next month
No. If I understand correctly, this PR is still showing past tea times, right? / This needs to be changed
Redirect to /tea_times after signing up. Logging in should also redirect to /tea_times |
Update 05/29/18: New tea time page design
Ideal design for city anchor links: To be done by AS 05/30/18:
@markbao TODO:
|
New commit 05/31/18 06:34 PM: Also I apologize for dirty SCSS and markup. Eventually this will be cleaned up. Rush job. |
Summary of TODOs:Note: @markbao I'm reasonably confident you can use this comment as a final to do list for the June push. Also, unless indicated otherwise, these are all assigned to you. Email UI
Tea time flow
Double checking
Notes
To do later (nonurgent)
|
…angers/tws-on-rails into mb/user-flow-redesign
…angers/tws-on-rails into mb/user-flow-redesign
Redesign the user flow so a listing of the month's tea times in all cities (at
/tea_times
) is the central place where people will interact with the application.Todo
/tea_times
page that displays tea times scheduled in the current month./tea_times
./tea_times
is publicly viewable, and the CTAs for signing up for tea times will go to signup/login pages if not logged in./tea_times
page.Waiting for
/tea_times/123
page should be redesigned./tea_times
page needs additional styling./cities
)/tea_times
(probably not)Copy (marked with
COPYTODO
)views/tea_times/index.html.erb
Stuff for the future