-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #447 from amihaiemil/446
#446 GET Personal Repos Front-End
- Loading branch information
Showing
5 changed files
with
35 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,9 +37,6 @@ | |
* @author Mihai Andronache ([email protected]) | ||
* @version $Id$ | ||
* @since 0.0.1 | ||
* @todo #43:30min Update the getPublicRepos.js function to fetch the | ||
* github/gitlab repos according to the "provider" attribute returned | ||
* the from "/api/users/self" endpoint. | ||
*/ | ||
@RestController | ||
public class Users extends BaseApiController { | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
$(document).ready( | ||
function () { | ||
getPersonalRepos(); | ||
} | ||
); | ||
/** | ||
* Get the user's personal repos. | ||
*/ | ||
function getPersonalRepos() { | ||
$("#repos").find("tbody").html(''); | ||
$("#loadingPersonalRepos").show(); | ||
$("#personal-repos-info").hide(); | ||
$.get( | ||
"/api/repositories/personal", | ||
function(repos) { | ||
(repos || []).forEach( | ||
function(repo){ | ||
$("#repos").find("tbody").append(repoAsTableRow(repo)); | ||
} | ||
) | ||
$("#loadingPersonalRepos").hide(); | ||
$("#personal-repos-info").show(); | ||
$('#repos').dataTable(); | ||
} | ||
); | ||
} | ||
|
||
/** | ||
* Wrap a repo's information between <li> tags, with anchor. | ||
*/ | ||
function repoAsTableRow(repo) { | ||
return "<tr><td><a href='/" + repo.provider + "/"+ repo.repoFullName+"'>" | ||
+ repo.repoFullName + "</a></td></tr>" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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