Code Monkey home page Code Monkey logo

weather-time-machine's People

Contributors

erl67 avatar njscholfield avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

weather-time-machine's Issues

History Servlet returning same entry many times

When I call the history servlet it just returns the last entry saved in the database for the user over and over again.

[
  {"UID":-1,"Title":"Pittsburgh, PA 15213, USA","Latitude":"40.4379259","Id":130,"Longitude":"-79.9556424","Date":"Sun Apr 16 00:00:00 EDT 2000","Name":"TestAccount"},
  {"UID":-1,"Title":"Pittsburgh, PA 15213, USA","Latitude":"40.4379259","Id":130,"Longitude":"-79.9556424","Date":"Sun Apr 16 00:00:00 EDT 2000","Name":"TestAccount"},
  {"UID":-1,"Title":"Pittsburgh, PA 15213, USA","Latitude":"40.4379259","Id":130,"Longitude":"-79.9556424","Date":"Sun Apr 16 00:00:00 EDT 2000","Name":"TestAccount"}
]

It returned more than 3 copies though. I think it is returning the right number of things, but they are all identical...

Obviously it should be returning each of the elements the elements in the database for the user instead.

Make the graph show real data

We need to connect the graph to the Dark Sky API data so that it shows real data.

Steps

  • Get needed data from API return (high and low temps)
  • Put that data into an array that the graph can understand
  • Make arrays for the axis labels based off of the years queried

Clicking on previous search adds it to the database again

I tried to fix it in the facade by checking the history object against the database via:
try {
if (em.find(WxHist.class, history) == null) {
em.persist(history);
return true;
}
}
But that prevented anything including new searches to be added, it always returned false with this:
$rootScope.displayError('Unable to add query to your history');

But that didn't work and keeps returning an error. Not sure why the objects are the same.
There should be away to change the JS where clicking on a previous search doesn't call /HistoryServlet

Make login and registration pages show errors

Right now the page just reloads if something is unsuccessful, it would be better if they could display an error message - either generic or specific to what actually went wrong.

Steps

  • Submit form data via AJAX instead of native browser form
  • Add error message banner to login/register page
  • Have servlet response with error message

Graph Questions

This isn't necessarily an issue but just some stuff to think about.

  1. Do we want to show the exact temperatures for each point on the graph? You can hover over the dots to get the temperature already. It looks a bit crowded, especially when two of the lines are close together.
  2. If we don't want to show all the temperatures, can we just show the high/low temps ones or is it all or nothing? We could try making the text transparent for the others...
  3. The graph is almost unreadable on mobile. Do we want to worry about that, or not?
    img_3693

Add a title to the saved query

This might not be an option but I thought it would be helpful if the user can enter a title to include with their search to give it meaning. Like if I look up April 15, 1947 and Brooklyn, NY, USA, I would like to give it the title something like "Jackie Robinson Debuts for the Dodgers."

User logout doesn't work

Clicking to log the user out doesn't actually delete the cookie needed to successfully log them out.

Show query history for logged in users

Show the user's previous queries that were stored in the database.

Steps

  • Add box into page that shows the query history
  • Hide box if no user is logged in
  • Do AJAX call to get query history
  • Maybe add a link to view results of each query again

Logout doesn't refresh page

Also after I did a search and logged out the page didn't change. It should probably reload to a clean page for security reasons.

Registration Page fields should restrict to 20 characters

On database side, the username and password are both limited to 20 characters, so if you try to register with more it will fail, however the failure will only return null and a good registration returns the User Object, so I'm not sure how to pass those Exceptions. It would probably involve reworking the whole method.

Is there a way you restrict the length of those fields to 20 on the JS side?

Problems fetching historical events

Occasional CORS issues when fetching historical events. To fix this we would need to make a servlet that gets the historical events like the WeatherServlet.

Not super high priority because it usually works and only requires a page refresh to fix when it doesn't.

Steps

  • Create an EventServlet that returns the historical events. Could essentially copy the WeatherServlet
  • Switch call to get historical events in JS

Shorten the height of the cloud image area

Maybe it's just me but on the desktop the container for the input is really tall and takes most of the screen when I think it would be better for it to be narrow so that the user doesn't have to scroll down to see the history and graph. I started looking around to see how to adjust it but so far I'm not sure how.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.