Skip to content

GitHub Tracker Ebba Delsol#47

Open
ebbadelsol wants to merge 12 commits intoTechnigo:mainfrom
ebbadelsol:main
Open

GitHub Tracker Ebba Delsol#47
ebbadelsol wants to merge 12 commits intoTechnigo:mainfrom
ebbadelsol:main

Conversation

@ebbadelsol
Copy link
Copy Markdown

GitHub Tracker

The assignment was to create a GitHub tracker with all my Technigo-repos.

The problem

I started by fetching all the data that I wanted from the GitHub API. I began with fetching all the repos and filtering out only the forked ones from Technigo and continued with fetching the pull requests, commits and reviews. In order to inject data from one function to another I used dynamic IDs and DOM-selector.

If I had more time I would have wanted to sort the data by latest repo. I would also have wanted to add a dropdown meny were the user can choose to sort the repos after language. I would also like to style the GitHub tracker a bit more.

View it live

https://github-tracker-ebbadelsol.netlify.app/

Copy link
Copy Markdown

@anndimi anndimi left a comment

Choose a reason for hiding this comment

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

Hey Ebba! Really good job on this project! You code was really easy to navigate through, no uneccesary repetitions and very clean. I don't have any negative comments. Your code works as I can already see project-music-releases on you site! Good job!

You have followed the project brief and finished the requirements.

Comment on lines +13 to +14
data: [numberOfProjects, 19 - numberOfProjects],
backgroundColor: ["rgb(255, 99, 132)", "rgb(255, 205, 86)"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job on personalizing your chart!

Comment on lines +16 to +17
<!-- Roboto fontfamily -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet" />

<script src="./script.js"></script>
<script src="./chart.js"></script>
</body>
</html> No newline at end of file
<!-- Open Sans fontfamily -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap" rel="stylesheet" />
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 using google fonts to add a more personal tuch!

Comment on lines +23 to +25
const technigoProjects = data.filter((repo) => repo.fork && repo.name.startsWith("project-"));

technigoProjects.sort((oldestRepo, newestRepo) => new Date(newestRepo.pushed_at) - new Date(oldestRepo.pushed_at));
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 working with the filter! And GG on sorting your projects from newest to oldest!

Comment on lines +55 to +59
if (filteredPull) {
getCommits(filteredPull.commits_url, repo.name);
getReview(filteredPull.review_comments_url, repo.name);
} else {
document.getElementById(`commits-${repo.name}`).innerHTML = "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.

I really like that you added an if else for whether you have any commits or not. And the fact that you've added info about who has reviewed your work is really neat!

Comment on lines +73 to +81
const getReview = (url, repoName) => {
fetch(url)
.then((response) => response.json())
.then((data) => {
if (data.length === 0) {
document.getElementById(`${repoName}-container`).innerHTML += "";
} else {
document.getElementById(`${repoName}-container`).innerHTML += /*html*/ `
<p class="project-info">Reviewed by ${data[0].user.login}</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.

This is soooo neat! Very inspirational!

Comment on lines +40 to +83
.project {
display: flex;
flex-direction: column;
align-items: center;
padding: 40px 0;
}

.projects-container {
line-height: 1.8;
margin-top: -40px;
}

.project-info {
font-family: "Open Sans", sans-serif;
font-size: 15px;
font-weight: 400;
color: #666666;
pointer-events: none;
}

.project-name,
.chart-heading {
font-family: "Open Sans", sans-serif;
color: #222222;
font-size: 18px;
font-weight: 700;
pointer-events: none;
}

.project-link {
text-decoration: none;
}

.project-link :hover {
background: linear-gradient(90deg, white, #e6e6e6 50%, #e6e6e6 50%, #e6e6e6 50%, white);
}

hr {
margin: auto;
width: 75vw;
background: linear-gradient(90deg, white, #e6e6e6, #e6e6e6, #e6e6e6, white);
height: 1px;
border: none;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Love the minimal styling you've done for the projects! And the fact that you get redirected to your repo when you click on them!

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