Skip to content

project-github-tracker#96

Open
idanaslund wants to merge 29 commits into
Technigo:mainfrom
idanaslund:main
Open

project-github-tracker#96
idanaslund wants to merge 29 commits into
Technigo:mainfrom
idanaslund:main

Conversation

@idanaslund

Copy link
Copy Markdown

No description provided.

Comment thread README.md
Replace this readme with your own information about your project.

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
This week the project was to fetch information from Github about my repositories and pull requests and display the information on a page. We were also supposed to compare data in a chart.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice and to the point project brief!

Comment thread code/chart.js
};

const config = {
type: 'bar',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I really like that you used a bar chart to showcase your projects and your progression. Also that you put it on top of the page! The chart is also responsive which is great :)

Comment thread code/script.js
Comment on lines +10 to +21
// Fetching profile info
const addingProfile = () => {
fetch(`https://api.github.com/users/${username}`)
.then((res) => res.json())
.then((profileInfo) => {
profile.innerHTML += `
<img src="${profileInfo.avatar_url}">
<a class="userlink" href="${profileInfo.html_url}" target="_blank">${profileInfo.login}</a>
<p>${profileInfo.bio}</p>
`
})
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I really like how you wrote your code here. Clean, good naming and nice that you made a link to your profile on github! :)

Comment thread code/script.js
Comment on lines +36 to +37
let updated = new Date(repo.updated_at).toLocaleDateString() //Turning date and time into date
let upperCase = `${repo.name[0].toUpperCase()}${repo.name.slice(1)}` //Making first letter of string to uppercase

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great with the comments and nice to know how you wrote the code to make the first letter uppercase (I'm taking that with me since I tried that too but I didn't get it to work) :)

Comment thread code/script.js
Comment on lines +42 to +47
<ul>
<li><span class="title">Most recent update:</span> ${updated}</li>
<li><span class="title">Default branch:</span> ${repo.default_branch}</li>
<li><a class="repo-link" href=${repo.html_url} target="_blank">Link to repository</a></li>
<li id=commit-${repo.name}><span class="title">Number of commits:</span> </li>
</ul>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Smart that you used an unordered list here!

Comment thread code/script.js
Comment on lines +52 to +53
findingPulls(forkedRepos) // Bringing all filtered repos to the next function
callingChart (forkedRepos.length) //Bringing all filtered repos to the chart

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Once again, good naming and I can really see that you made these comments for you to be able to understand what you're doing and that is so great, so helpful.

Comment thread code/script.js Outdated

const findingPulls = (repos) => {
repos.forEach((repo) => { //For all filtered repos I fetch each pull request
fetch(`https://api.github.com/repos/Technigo/${repo.name}/pulls`) //, options

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The comment here, is this for the use of a token?

@idanaslund idanaslund Mar 2, 2022

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I must have missed it when I removed my token. Will remove it now, thank you!

Comment thread code/script.js
Comment on lines +64 to +69
const pulls = data.find((pull)=> pull.user.login === repo.owner.login) //Comparing all pull requests from Technigo to show only the ones with me as owner
if (pulls !== undefined ) { // If pull requests exist =
findingCommits(pulls.commits_url, repo.name) //passing the commits of these pull requests to the next function
} else { // If pull requests does not exist = display this
document.getElementById(`commit-${repo.name}`).innerHTML += ' Group project/no pull request'
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice way of writing this if/else statement.

Comment thread code/style.css Outdated
background: #FFECE9;
box-sizing: border-box;
background: #83c5be;
/*006d77*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe remove this line of code since it's not being used.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you, will do!

Comment thread code/style.css
}

ul {
list-style-image: url(./images/GitHub-Mark/PNG/GitHub-Mark-32px.png);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is really cute!

Comment thread code/style.css
padding: 1vh 2vw;
}

@media (min-width: 668px) and (max-width: 1024px) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Page looks nice in responsive mode and you have built your page doing mobile first which is great. The only thing I caught was that in mobile view the data in the project "boxes" seem to be centralized for the ones that showcase the number of commits, but for the group projects (0 pulls) the text will not be centered. I tried to play around in the inspector tool but I was unable to find a solution for this... :( Other than that, really good job with this page, Ida! :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tried fixing it too but I believe it is centralized on all of them, just that the content is wider on the ones without pull requests, making it look odd. Didn't know if I should keep it centered or not...

Comment thread code/style.css Outdated

.repos {
width: 20vw;
min-width: 210px;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A tiny detail but here's two little semi colons together.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Great catch, thank you!

@CamillaHallberg CamillaHallberg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You've done a really great job in creating your own GitHub tracker! I know that this week was very challenging for us so I want you to know that I think your code looks really good, I understand what you have done and I truly appreciate that you have made relevant comments. I have only made some few smaller comments that you can check if you get the time. Your code follows the guidelines and checks off on the blue requirement level. Be proud of this project. You've done such a good job! 🌟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants