Skip to content

Week7- github tracker- Haru Ahn#29

Open
ruruahn wants to merge 6 commits intoTechnigo:mainfrom
ruruahn:main
Open

Week7- github tracker- Haru Ahn#29
ruruahn wants to merge 6 commits intoTechnigo:mainfrom
ruruahn:main

Conversation

@ruruahn
Copy link
Copy Markdown

@ruruahn ruruahn commented Oct 3, 2021

This week's challenge was to make a github tracker website, which fetches the repositories from my github homepage. The challenge included filtering out the fetch requests in various ways, such as certain repos which were forked from specific master branch. I learned what is API and how is it used in fetching informations. The most challenging part was to understand each code's role in regard of its relations to endpoint. But I am very proud that I got to use many helps from StackOverFlow and google. If I had more time, I would have worked on rounding out the overall design of the page with CSS.

Check it out Live! :
https://github-tracker-ruruahn.netlify.app

Copy link
Copy Markdown

@MarySnopok MarySnopok left a comment

Choose a reason for hiding this comment

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

A great project with a stylish design and easy to read code.
As I understood you decided to render only projects that were pulled by you. Correct me if I am mistaken.
Really enjoyed exploring the code , love the part that prevents the chart to redraw it self on each data change. It is cool that it is drawn once per session.
Requirements :
Blue

  • A list of all repos that are forked from Technigo - DONE
  • Your username and profile picture- DONE
  • Most recent update (push) for each repo- DONE
  • Name of your default branch for each repo- DONE
  • URL to the actual GitHub repo- DONE
  • Number of commits for each repo- DONE
  • It should be responsive (mobile first)- DONE
  • A visualisation, for example through a pie chart - DONE

🔴 Red Level (Intermediary Goals)

  • Sort your list in different ways. - DONE
  • Create the opportunity to filter the repos based on a condition - DONE

code/script.js Outdated
fetchPullRequests(forkedRepos)

//Only draw the chart once
if (!chartDrawn) {
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 very smart approach ! Great that it is drawn only once per session . Great job!

code/script.js Outdated
.then(res => res.json())
.then((data) => {
const myPullRequest =
data.find(pull => pull.user.login === repo.owner.login)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Aha , you decided to work only with repos on what you made a pull request yourself . In this case it is a clear code and comments provide all the important highlights for the logic .

code/script.js Outdated
const filterLanguages = (event) => {
console.log(event)
const language = event.target.id
const checked = event.target.checked
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 super cool and fancy ) . Love the part with filtering according to the main language of the repo.

code/script.js Outdated
selectedLanguages.push(language)
//Removes language string in array if unchecked language is in array
} else if (!checked && selectedLanguages.includes(language)) {
for (let i = 0; i < selectedLanguages.length; i++) {
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 use of for loop also cool that you are implementing other methods (not only foreach) that we learned so far.

code/script.js Outdated
console.log("selectedLanguages[i]=", selectedLanguages[i])
if (selectedLanguages[i] === language) {
selectedLanguages.splice(i, 1)
break
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Interesting use of break , I had seen it within switch context only . Thank you for educational tip . I had googled and yep thats one of ways (https://stackoverflow.com/questions/4851657/call-break-in-nested-if-statements).

height: 100vh;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
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 , hero img )) Cute!

code/style.css Outdated
}

#project-business-site.repo, #project-chatbot.repo, #project-github-tracker.repo, #project-guess-who.repo, #project-news-site.repo, #project-weather-app.repo {
border: transparent;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

interesting grouping for styling purposes

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