Github Tracker Technigo Week 7 - Amanda Tange#88
Github Tracker Technigo Week 7 - Amanda Tange#88amandatange wants to merge 5 commits intoTechnigo:mainfrom
Conversation
…retrieving the data from api
…bonus that the page loads much quicker
| ## The problem | ||
|
|
||
| Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next? | ||
| I used fetch to get the user data, which required 3 fetches - user data, pull requests, and commits. The styling was kept simple since the focus was to be able to display all the different data that was required. The biggest problem was data retrieval and getting it to actually show up on the site. The second biggest problem I had was that I had set up the fetches to all finish before moving on to displaying the data so the site took a very long time to load. That has been slightly remedied by splitting up the code into separate fetches but it still takes a fairly long time for the site to load. |
There was a problem hiding this comment.
This project was so intense and I am glad you managed to find the right solutions to the problems.
|
|
||
| //"Draw" the chart here 👇 | ||
|
|
||
| const myChart = (numberOfProjects) => { |
There was a problem hiding this comment.
This is a clear, short and simple code of the chart coded compared to the template they showed us from the site. Easy to follow!
|
|
||
| //Global variables | ||
| const usrName = 'amandatange'; | ||
| let forkedRepos = []; // will contain filtered list of repos that have been forked |
There was a problem hiding this comment.
Good and clear explanation of the the different variables.
| .then((dataPR) => { | ||
| //filter for every PR to match my profile (or in the case of the weather app, to michael's profile and id for the PR) | ||
| const pull = dataPR.filter(pr => pr.url.includes(repo.name) | ||
| && (pr.user.login === repo.owner.login || pr.user.login === "michaelchangdk" && pr.id === 856976386)) |
There was a problem hiding this comment.
Adding another user here is impressing!
|
|
||
| // since not all projects have a PR I don't have access to the commits from the PR API for all of them | ||
| // so I chose to use the commits api from the first fetch | ||
| // but I think this way the number of commits includes those made by the technigo team before I forked the project? |
There was a problem hiding this comment.
I think you are right here since looking at this repo, you made 5(?) commits and in total there are nine. Also, doing this was a good idea to actually add some commits for the project. Maybe you could have added further information through innerHTML like "commits from other user"(?)". Anyway, the result was simply great!
| <p id='numberCommits' class='number-commits'>Number of commits: <span>${numberOfCommits}</span></p> | ||
| </section>`; | ||
| //If the repo doesn't have a PR it won't add this data | ||
| if (pull.length !== 0) { |
There was a problem hiding this comment.
Good use of the "not equal to" operator.
|
|
||
| // the tags have classes that aren't used right now | ||
| // but I would like to try using them to style the layout with a more a advanced grid layout | ||
| main.innerHTML += ` |
There was a problem hiding this comment.
It was a lot of struggle with coding this week with fetching APIs and using them in functions. In the end you really did managed to fetch 'em all according to blue requierments. Be proud, you are amazing. It was really nice analyzing your code. Thank you, Amanda.
No description provided.