GithubHelp home page GithubHelp logo

cgko-week3's People

Stargazers

 avatar  avatar

Watchers

 avatar

cgko-week3's Issues

Accessibility

The site seems to have an accessibility score of 59...a few things you could do to bring this up easily are:

  1. Give the document a title tag
  2. Add labels to the forms.

Really great work other than that....love to be informed about crime.

More data

I'm sure you were thinking of this, but it would be nice to have more months available.

Great app feedback loop

Really like the touch to give user feedback if they click search without inputting a location.

Function.js

Lovely use of objects to create your functions within a single object here. You don't have to export each one individually then.

The only thing is that this function doesn't seem to do anything except return its argument right now

stringify: function (input) {
    return input;
  },

nice dropdown

you have a really nice styled dropdown.

<div id="dropdown" class="dropdown-content">
    <a href="#" class="jan">January 19</a>
    <a href="#" class="feb">Feburary 19</a>
    <a href="#" class="march">March 19</a>
</div>

you've used a div to render the dropdown, with the styling you want, with is nice since selects and options which are the inbuilt dropdown, can't actually be styled properly.

Visual design could stand out more

The clean, simple design makes sense for a serious website, but it could maybe be a bit more exciting ๐Ÿ™Š? (...purely for the sake of criticism)

No data available

Great app, such a clever idea. It seems for some postcodes the api doesnt return any info so perhaps a good solution would be to show some feedback to the user that there isn't any data for their area?

Really great apart from that.

Dynamic Content

There is dynamic content on the page that is updated by each API call

onClick

the onClick event can be a security risk because a user can go in to the html and edit it to do what they want.

<button onclick="dropDown()" class="dropbtn">Month selector</button>

it's generally more secure to use an event listener, so you want to avoid using onclick where you can.

Refactor code to use less for loops

Forgive me for this rather controversial issue. I love your code... but I think it could be slightly improved by replacing some of your for loops by using more forEach, map or reduce methods.

For example, the code below could be changed to categories.forEach(...)

for(let i = 0; i < categories.length; i++){
let newLine = document.createElement("li");
let parentCrimes = document.querySelector(".categoriesOfCrimes");
parentCrimes.appendChild(newLine);
newLine.setAttribute("class", "crimes");

   newLine.textContent = `${categories[i]}: ${numbers[i]}`;
  }

Here is an example of how we used for Each in a similar scenario:
// Function for creating list items
function listCreation(str) {
var listItem = document.createElement("li");
listItem.textContent = str;
recipeIngredients.appendChild(listItem);
}

// Function to add each ingredient
function addIngredients() {
recipeIngredients.textContent = "";
ingredients.forEach(c => listCreation(c));
}

Very clear README and User Journey

Well done!

Seems like you focused on User Journey early; made it the focus of your project; and stuck to it throughout.

It is also very clear how you worked together, what steps you took and what pitfalls you overcame because of your well-written README.
โญ

Cool tests!

Your tests are clear in their purpose and check some useful things.

Excellent job! ๐Ÿฅ‡

Release button after click

The search and month buttons stay highlighted when you've clicked them - I think it would be nice if the border disappeared..

Screenshot 2019-07-19 at 10 33 50

Nice testing.

pretty good test coverage for the project

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 98.75 66.67 93.75 98.68
functions.js 96.67 66.67 83.33 96.15 3
tests.js 100 100 100 100

good for keeping up with testing though, it's hard to keep on top of doing tests with such limited time.

REGEX

Love that regex...what a beast of a regex. Well done on sorting that out.

Screenshot 2019-07-19 at 10 22 22

Number of crimes not updated

I noticed a tiny bug: After searching for a valid postcode, when I type in an invalid postcode the list of crimes disappears but the number of crimes stays visible. See image below

Screenshot 2019-07-19 at 10 31 53

Your Stringify Function seems redundant

Stringify accepts a variable and returns that variable.

From functions.js, lines 10-12:

stringify: function (input) { return input; },

If you pass it a number it will return a number i.e. typeof(input) will return "number".

User experience

Love your app and will be using it for our flat hunt :)

As a user, it would be great if I can see the month that is currently selected, either by making the dropdown menu selection visible or displaying some text (maybe in the lines of Number of crimes in January 2019)

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.