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

Projectorville #30

Merged
merged 67 commits into from
Apr 7, 2016
Merged

Projectorville #30

merged 67 commits into from
Apr 7, 2016

Conversation

michaelpelletier
Copy link
Contributor

Will close #29 when it is done.

First looked like this:

screen shot 2016-01-17 at 9 55 43 pm

Then a style overhaul happened when I had the idea to make it look like a News Broadcast:

screen shot 2016-01-20 at 10 08 53 pm

And continuing with progress.

screen shot 2016-02-06 at 2 23 15 pm

"change" => countries_income_change[country]
}

@countries_data.push(this_country)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been a long damn time since I've written Ruby and I was never particularly versed in it so I'm not super confident on this being the best way to do this. It also no doubt has broken some tests that I still need to address.

@FifthSurprise
Copy link
Contributor

@michaelpelletier Just a reminder to give me a ping on either on Slack or on Github when you are done with this so I can review.

@michaelpelletier
Copy link
Contributor Author

@FifthSurprise Will do! You can always start reviewing it early if you would like.

@@ -3,10 +3,15 @@
<head>
<title>WatchTheSkiesDashboard</title>
<%= stylesheet_link_tag 'application', media: 'all'%>

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular.js"></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Figure out why Bower stopped playing nicely with Angular.
It's probably fine to use this CDN approach, but if that's the case, let's rip the logic out elsewhere.

@FifthSurprise
Copy link
Contributor

Not sure why but it looks like you can lose countries from the dashboard. What I think is happening is on page load, you try to fit all of the tickers into one line but if there's no space, additional countries get pushed below visible window height and then do not appear even after manipulating resizing the window.

<ul>
<li>
<div ng-repeat="country in countries" class="country">
<span>{{country.name}}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I like Country Name, Amount, then Glyphicon. I think maybe a | as a delimiter would be a good idea between countries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, easy fix.

@FifthSurprise
Copy link
Contributor

Oversight on my part but let's update the README to also bower install

@FifthSurprise
Copy link
Contributor

I discovered a bug in the api_controller.rb that was affecting you.

income_change = if previous_income.empty?
should be:
income_change = if previous_income.nil? or previous_income.empty?

I will make this change in PR #40 but you can also just put in the above change if you need it. It handles not being able to compare previous income in the opening round against current income since there is no previous income.

@michaelpelletier
Copy link
Contributor Author

@FifthSurprise Yeah I need to fix the bower install thing and figure out why it's being an asshole with Angular. And good catch with the nil thing!

$interval(function() {
$scope.getStatus();
}, 3000);
}
]);
]).animation('.slide-animation', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this stuff is for animating left to right scroll for the ticker? Some comments could be useful here to that effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for the news itself, not the stock ticker thing, which definitely means it needs comments.

@FifthSurprise
Copy link
Contributor

@michaelpelletier Done looking at this for now.

I'd be interested in maybe throwing a small error image somewhere if the API call gets something other than a 200 response just to make it obvious that something weird happened with the API call. Currently, the dashboard API call will have errors but still try to deliver what it can. So you can use that 200 status message as a healthcheck and just display somewhere on the dashboard a small icon if something is going wrong. Or I guess, throw a javascript error if it sees a 500 but that seems more painful.

Otherwise, the ticker resize thing seems to be the only weirdness.

If you figure that out, I'd like to take another look as sanity check before I merge it in.

unless previous_income_list.empty?
previous_income_list.each do |pair|
countries_calculations[pair[0]] -= pair[1]
income_change = if previous_income.empty?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Derp, realized I can't fix this in #40 since bug is right here.

Anyway, please fix haha.

FifthSurprise and others added 7 commits March 31, 2016 07:45
added migration for games to have a localized time zone
add control for time zone in set of new time edit
next step is to add a user preference for time zone display
@michaelpelletier
Copy link
Contributor Author

Left to do:

  • Rebase and fix merge conflicts.
  • Add small icon somewhere for if the API explodes.
  • Switch away from the Angular CDN.
  • Add more comments in the JS
  • Add | between countries on the news ticker.
  • Fix weirdness with ticker sizing / resizing.

@michaelpelletier
Copy link
Contributor Author

@FifthSurprise I think this is ready for review now.

I ended up not being able to get bower to play nicely with Angular and Angular-Animate, and per our discussion previously, I don't think a CDN is a good way to go either, so what I did was create a lib folder inside the JS folder and just include the files that way. With Angular's upgrade path to 2.0 being risky (at best), we wouldn't simply want to use Bower to handle any such upgrade anyway (nor have it be a "oh let's just do it" thing). This method also allowed me to easily specify that I wanted to specifically use the minified versions, so we should get a nice little performance gain there, too! I am still not certain that we use Boostrap's JS for anything, but I didn't want to remove it and risk breaking things. I did also replace it with the minified version, though. Small victories.

I added a bunch more comments to the JS, which I hope clear some things up. The dashboard.js file has been almost entirely rewritten, so please do review it and make sure that everything makes sense. Likewise, I think you saw this already, but I did modify the api_controller to give us back some more information about the countries income. It's been ~3 years since I've written any Ruby on Rails and I was never that proficient in the first place, so this could use a good review, too.

FINALLY, I adjusted the get request within the dashboard.js file to have a degree of error handling, so there's now an icon on the dashboard for if there happens to be a connection problem. It may well be a little bit large, but I'm not sure how close you guys typically are to the projector itself, and I wanted to make sure that it would be visible.

screen shot 2016-04-02 at 10 51 41 am

@FifthSurprise
Copy link
Contributor

Initial look seems like everything is fine. I am going to work on automated testing on rails side in the nearish future so hopefully that will be less of a concern. Also the icon is perfect.

I'm going to poke around a bit more to see if there's anything weird I don't understand but will merge it in soonish.

@FifthSurprise FifthSurprise merged commit 1c22c2e into develop Apr 7, 2016
@michaelpelletier
Copy link
Contributor Author

Yay! 😄

@michaelpelletier michaelpelletier deleted the projectorville branch April 7, 2016 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ch-Ch-Changes (Dashboard overhaul)
3 participants