Skip to content

Conversation

@Dopest0727
Copy link

No description provided.

Copy link

@rijad90 rijad90 left a comment

Choose a reason for hiding this comment

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

Well done! You should be proud of your accomplishment this week. Clean JS code, easy to understand.

Usually I would mention that the CSS is not on point to 100%, but I have seen your capability in other projects so I don't mind at all as this was by far the hardest project, so far.

Woop woop!

Comment on lines +1 to +26
// GITHUB API
const USER = 'Dopest0727'
const PARENT_OWNER = 'Technigo'
const REPOS_URL = `https://api.github.com/users/${USER}/repos`
const USER_URL = `https://api.github.com/users/${USER}`

// GLO VAR
const projects = document.getElementById('projects')
const userData = document.getElementById('userData')

// FILTER BY
const filterAllBtn = document.getElementById('filterAllBtn')
const filterLangJsBtn = document.getElementById('filterLangJsBtn')
const filterLangHtmlBtn = document.getElementById('filterLangHtmlBtn')

const sortSizeBtn = document.getElementById('sortSizeBtn')
const sortCreatedBtn = document.getElementById('sortCreatedBtn')
const sortNameBtn = document.getElementById('sortNameBtn')

let reposArr = []
let reposData = {}

const pullReqData = {
total: 19,
done: 4,
}
Copy link

Choose a reason for hiding this comment

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

Well done, I like the way you sorted this!

reposData[repo.name] = { pullRequest: '', authors: '', commits: '' }

generateProjectCard(repo)
const COMMITS_URL = `https://api.github.com/repos/${USER}/${repo.name}/commits?per_page=100`
Copy link

Choose a reason for hiding this comment

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

Good job inceasing the amout results from 30 to 100

}

const fetchAllReposFromUser = () => {
// FETCH MY REPOS
Copy link

Choose a reason for hiding this comment

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

Good job adding the comments making it more clear for a a reviews

}
})
})
.catch(err => alert('fetchFullRepo error:', err))
Copy link

Choose a reason for hiding this comment

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

Nice :)

Comment on lines +101 to +128
const getCollaborators = (commits, repo) => {
// filter out each commit author and stor for later sort
let authors = {}
commits.forEach(commit => {
if (!Object.keys(authors).includes(commit.author.login)) {
authors[commit.author.login] = {
avatar_url: commit.author.avatar_url,
html_url: commit.author.html_url,
}
}
})
reposData[repo.name].authors = authors
populateCollaborators(authors, repo)
fetchPullRequestsArray(repo, Object.keys(authors))
}

const populateCollaborators = (authors, repo) => {
for (const author in authors) {
if (Object.keys(authors).length > 1) {
document.getElementById(
`collaborators-${repo.name}`
).innerHTML += `<a href="${authors[author].html_url}" target="_blank"><img class="avatar-collaborator" src="${authors[author].avatar_url}"></a>`
} else {
document.getElementById(`collaborators-${repo.name}`).innerHTML =
'Individual project'
}
}
}
Copy link

Choose a reason for hiding this comment

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

Nice detail to let users know your collabs for the project!

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