Skip to content

Github Tracker without image(will fix)#58

Open
Groovedharry wants to merge 2 commits intoTechnigo:mainfrom
Groovedharry:main
Open

Github Tracker without image(will fix)#58
Groovedharry wants to merge 2 commits intoTechnigo:mainfrom
Groovedharry:main

Conversation

@Groovedharry
Copy link
Copy Markdown

Sorry that I didn't do commits, I forget at times when I am stressed which I was this time
Copy link
Copy Markdown

@Zancotti Zancotti left a comment

Choose a reason for hiding this comment

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

Hey Harry, by the sound of the time you have had you have done a good work in finishing this project and you can be proud of yourself! Clean code btw =)

<title>Project GitHub Tracker</title>
<link rel="stylesheet" href="./style.css" />
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just a very small detail, i would get rid of line 11 or do the same on both sides so it looks proportionate =)

const USER = 'Groovedharry'
const REPOS_URL = `https://api.github.com/users/${USER}/repos`;
const USER_API = `https://api.github.com/users/${USER}`;
const projectsContainerXXYT = document.getElementById('profileInfo');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just curious, what does xxyt mean?

const REPOS_URL = `https://api.github.com/users/${USER}/repos`;
const USER_API = `https://api.github.com/users/${USER}`;
const projectsContainerXXYT = document.getElementById('profileInfo');
const projectsContainer = document.querySelector("#projects");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there a reason why you used a querySelector here instead of just use document.getElementById? If there isnt a particular reason i would try to make it coherent and use dockument.getElementById here aswell or just use the queryselector for targeting the elements =).

fetch(USER_API)
.then((response) => response.json())
.then((data) => {
profile.info.innerHTML += `
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 would guess that this bit doesnt work since you havent targeted the correct id. you have used profile.info.innerhtml. Try to change that to profileInfo.innerHTML instead.

.then((data) => {
profile.info.innerHTML += `
<h2> Profile info </h2>
<img src ="https://avatars.githubusercontent.com/u/83465217?v=4" alt="profile pic">
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 info is possible to pick up from the data So you dont have to hard code it. It is just a suggestion since you already use the api to pcick up the name!

const getRepos = () => {
fetch(REPOS_URL)
.then((response) => {
return response.json();
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 solution to wait until the data is finished! =)

})
.then((json) => {
const forkedRepos = json.filter((project) => project.fork && project.name.startsWith("project-"));
console.log(forkedRepos)
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 would remove this console log before pushing the final result, but since you have written that you arent entirely done with the project I understand that you left it =)

.then((json) => {
const filteredCommits = json.filter((project) => project.commit.author.name === "Harry Bäcklin");
// makes the first letter an upper case, Thank you Bruna //
const upperCaseName = project.name.charAt(0).toUpperCase() + project.name.slice(1);
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 one!

const myPullRequest = pulldata.find(
(pull) => pull.user.login === project.owner.login
);
if (myPullRequest) {
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 solution =)

font-size: 40px;
}

/* not working prolly something in JS but I can't figure it out */
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See comment about it above =)

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