Open
Conversation
rijad90
reviewed
Feb 28, 2022
rijad90
left a comment
There was a problem hiding this comment.
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, | ||
| } |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
Good job inceasing the amout results from 30 to 100
| } | ||
|
|
||
| const fetchAllReposFromUser = () => { | ||
| // FETCH MY REPOS |
There was a problem hiding this comment.
Good job adding the comments making it more clear for a a reviews
| } | ||
| }) | ||
| }) | ||
| .catch(err => alert('fetchFullRepo error:', err)) |
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' | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Nice detail to let users know your collabs for the project!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.