HedvigM Project GitHub Tracker#8
Conversation
annatbg
left a comment
There was a problem hiding this comment.
Your Github tracker looks great on all devices and everything works just fine!
I'm very impressed with how clean and structured your code is Hedvig! Your comments were really helpful to me as well. There really wasn't anything I would have changed, except minor details such as cleaning up some comments (if they are not there on purpose, in that case: maybe change them to english?).
You have definitely met the requirements for the project.
There is always the opportunity to go back and improve the styling later, as you mentioned you would like to.
Very impressive work this week Hedvig, you should be really proud of yourself!
| /* TODO: | ||
| 1. få ut infon om commits på sidan | ||
| 2. få ut commitsen i den rätta rutan | ||
|
|
||
|
|
||
| 3. titta på hur Max hanterade "dates" från lektionen | ||
| */ | ||
|
|
There was a problem hiding this comment.
Clever to include a to-do list in the actual code like this, I will try that! 👍🏻
|
|
||
| <canvas id="chart" class="canvas"></canvas> | ||
| </div> | ||
| <footer><h1>Hedvig Mejstedt 🦁</h1></footer> |
| @@ -0,0 +1,108 @@ | |||
| const USER = ''; // !!! Place your user over here !!! | |||
There was a problem hiding this comment.
Is this another version, for practice? Thats a great idea! 💯
|
|
||
|
|
||
| document.getElementById(`commits-${repo.name}`).innerHTML = `Number of commits: ${fetchedCommits.length}`; | ||
| //Funktionen skall gå ner en nivå till och bara visa commits_URL |
There was a problem hiding this comment.
Minor detail, but perhaps change this to english? Or remove if it's not meant to be there.
| //This fetch is fetching all the pulls at the technigo user, so we have to sort everyone exept my user out "of the bag". Only my pulls for each project will show after this "hedvigsPulls" function. | ||
|
|
||
| document.getElementById(`pull-${repo.name}`).innerHTML = `Pull request was made ${new Date (hedvigsPulls[0].created_at).toLocaleDateString()}`; | ||
| //allt som skrivs inom parentesen efter get ElementById är en del av ID:t. |
There was a problem hiding this comment.
Perhaps this note is a work in progress-note to yourself, and something that can be removed?
| //^^^^^^^^^^^^^^^^^^^^^^ REPOS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^// | ||
|
|
||
| const repos = `https://api.github.com/users/${userName}/repos` | ||
| fetch(repos) | ||
| .then(response => response.json()) | ||
| .then(data => { | ||
| console.log(data) | ||
| //Fetching only the forked repos and the ones starts with "project" from my GitHub account. | ||
| const forkedRepos = data.filter(repo => repo.fork && repo.name.startsWith('project')) | ||
|
|
||
|
|
||
| //Username and userpic | ||
| profileContainer.innerHTML+= ` | ||
| <img class="img" src="${data[0].owner.avatar_url}" alt="profile picture"> | ||
| <a href="${data[0].owner.html_url}"><h2>${data[0].owner.login}</h2></a> | ||
| ` | ||
|
|
||
| // Repos and fetched pulls from the functions down under. | ||
| forkedRepos.forEach((repo) => projects.innerHTML += ` | ||
| <div class="repos" id="repos"> | ||
|
|
||
|
|
||
| <a href="${repo.html_url}"><h3>${repo.name.substring(8).replace("-"," ")}</h3></a> | ||
|
|
||
|
|
||
| <p>The default branch is: ${repo.default_branch}</p> | ||
| <p>The latest push: ${new Date(repo.pushed_at).toLocaleDateString()}</p> | ||
| <p id="pull-${repo.name}">No pull request is yet made 🤷 </p> | ||
| <p id="commits-${repo.name}">There are no commits yet...</p> | ||
| </div> | ||
| `) | ||
|
|
||
|
|
||
| drawChart(forkedRepos.length) | ||
| getPullRequests(forkedRepos) | ||
| }) | ||
|
|
There was a problem hiding this comment.
I really appreciate how clean and structured your code is, the comments are very helpful. Great work!
No description provided.