-
Notifications
You must be signed in to change notification settings - Fork 57
Conversation
Attempting to visit
And the problem is in Is this a MariaDB issue? I'm not familiar with the |
Looks like it might have to do with how you're using the |
fixed by simply adjusting the scope and text to include reservations that begin in the date range instead of ending in it. it's too bad rails doesn't have a UNION operator for active record; it looks like my monkey patch direct-sql wasn't going to fly anyway. |
Tested locally, looks pretty good although I might recommend having the total numbers in the filter buttons / headings (e.g. |
@default = false | ||
# if no filter is defined | ||
return unless @reservations_set.nil? | ||
@default = true if AppConfig.first.request_text.empty? |
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.
What was this?!
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.
Haha, you should do a pull (or depending on how old your branch is, delete and re-pull because I rebased off master)
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.
No, I meant what does the request text have anything to do with it?
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.
Oh wait that's old code. And yes. I hope I didnt break anything but what would the resevation index method have anything to do with request 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.
Ha I think it's a major typo from when I was cleaning up the Reservations controller for rubocop
(see 05212fa). I'm not sure where it came from!
Alright, the code looks good. I'd still recommend updating the filter button text to include the total counts, otherwise nice job! |
The only issue with that is that (at least on my 1366px monitor) it doesn't really fit lol. The total counts are reflected by the date selector, which was my compromise; I also think it's a little confusing. Thoughts? |
wow the build passed! latest changes include some more refactoring since I realized the entire |
What about a multiline label? Something like
or something along those lines? I know it's a little clunky but otherwise the counts are really confusing, I think. |
The total count isn't correct anymore, it's just saying |
<div id="date_range" class="row"> | ||
<div class="span2"> | ||
<h4>Filter By Date:</h4> | ||
<p><%= filter_message(@reservations_set, @filter, @view_all) %></p> |
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.
should you be using @reservations_source
instead?
Ok, I'll fix that in a sec. What if we just remove the counts completely from the buttons? @mnquintana? |
Hmmm... we could remove the counts from the buttons, but maybe we could have them show up on mouseover? I guess they're not critical, but it would be nice to have them somewhere. |
Hmmm those really shouldn't be buttons at all – they should be tabs or pills: http://getbootstrap.com/2.3.2/components.html#navs (The benefit of pills is that they can be vertically stacked, which might be necessary to make them fit) EDIT: Looking at it more I feel like vertically stacked pills/tabs in the left-hand column under the "Filter By Date" box might be the way to go |
<%= render :partial => "reservations_list", locals: {reservations_set: @reservations_set} %> | ||
</div> | ||
</div> | ||
|
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.
One too many newlines here
That makes so much more sense! Agreed about the second one, navigation skills are a higher priority than date selection. @squidgetx, how does it look to you? |
Finished! |
I'll quickly review later and will let you know when we can squash / merge :-) |
One last thing - @squidgetx can you make the parentheticals (e.g. |
I think visually it would work better if you made the active tab badge |
Also, the spacing is a little tight – I think you could safely make that a (It won't look as good, but it's very possible that the badge could overlap "Checked Out" if any of the numbers are big enough – mine almost are) |
<%= form_tag update_index_dates_path, method: :put do %> | ||
<%= hidden_field_tag "list[filter]", @filter %> | ||
<%= label_tag :start_date, 'Begin' %> | ||
<%= text_field "list", "start_date", class: "date_start_no_min span2", value: @start_date.strftime('%m/%d/%Y') %> |
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.
I think these look a little less awkward in the wider column if you change them to span3
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.
Agreed, even though they'll be long for dates it will still fit with the rest of the column.
Alright, looks good! Just make that one change and we should be good to squash and merge. |
Looks good to me too. The only thing I can think of is if you want to add a few extra tests for any of the methods you wrote? Nominally these would have been written in advance, but it can't hurt to expand our test suite a little :-). Up to you! |
@@ -0,0 +1,3 @@ | |||
.count { |
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 class is redundant – Bootstrap already provides a .pull-right
utility class for this! 😃
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.
Ah, I thought there might be something like that
Implement date filtering for reservations#index method as well as general refactoring of the #index method and controller tests for added functionality basic functionality prettify frontend fix test fix rubocop offenses rubocop2 and spec rubocop3 bs typo bs typo simplify scope adjust scope remove confusing comment refactor + rubocop fix spec fix bugs with default views add view all button cop routes and typo remove @default from spec fix filter message implement table and links for eq objects rubocop offenses badges refactor bad smells cosmetic changes rubocop fix span of date boxes tests fix tests remove unnecessary class
Definitely should add tests for new functionality |
Resolves #708 and includes #1071 so be sure to merge that one first