diff --git a/my-notes.txt b/my-notes.txt new file mode 100644 index 0000000..481bb8d --- /dev/null +++ b/my-notes.txt @@ -0,0 +1,34 @@ + + +## These are the user stories + + + 1. Engineer Alice makes branch "search-experiment" + 2. Alice sets up a project for "search-experiment" using this tool + 3. Engineer Bob makes further changes in master + 4. Testers start working on the "search-experiment" project + + ## why are the testers looking at the search-experiment project in the first place rather than the master branch + + +## the problem + + + + +## what I need to do: + +I need to edit the tool that I have been provided, in order to: + + [front-end] be able to specify the branch in a particular project + + [back-end] use the github api to compare a project with master + + [front-end] indicate if a project is up to date or not + + [the gist] make sure that the branch is up to date with master before testers work on it. + + + +Check the API to see if the branch is up to date with master +If not up to date, then give warning or disallow testers from working on the branch diff --git a/src/gitaccess.js b/src/gitaccess.js new file mode 100644 index 0000000..b8d4afb --- /dev/null +++ b/src/gitaccess.js @@ -0,0 +1,105 @@ +var request = new XMLHttpRequest(); +request.open('get', 'https://api.github.com/users/andrewdonato') +request.send() + + +$(document).ready(function() { + // This is called after the document has loaded in its entirety + // This guarantees that any elements we bind to will exist on the page + // when we try to bind to them + + // See: http://docs.jquery.com/Tutorials:Introducing_$(document).ready() + + makeGitRequest(); + +}); + + +var makeGitRequest = function(){ + $('.githubaccess').on('submit', function(event){ + + event.preventDefault(); + + $('.githubdata').html('
loading...
'); + + var username = $('.githubusername').val(); + var requesturl = 'https://api.github.com/users/'+username; + var repourl = 'https://api.github.com/users/'+username+'/repos'; + + requestJSON(requesturl, function(json) { + + if(json.message == "Not Found" || username == '') { + $('#githubdata').html("

No User Info Found

"); + } + + else { + // else we have a user and we display their info + var fullname = json.name; + var username = json.login; + var aviurl = json.avatar_url; + var profileurl = json.html_url; + var location = json.location; + var followersnum = json.followers; + var followingnum = json.following; + var reposnum = json.public_repos; + + if(fullname == undefined) { fullname = username; } + var outhtml = '

'+fullname+' (@'+username+')

'; + outhtml = outhtml + '
'+username+'
'; + outhtml = outhtml + '

Followers: '+followersnum+' - Following: '+followingnum+'
Repos: '+reposnum+'

'; + outhtml = outhtml + '
'; + + var repositories; + $.getJSON(repouri, function(json){ + repositories = json; + outputPageContent(); + }); + + function outputPageContent() { + if(repositories.length == 0) { outhtml = outhtml + '

No repos!

'; } + else { + outhtml = outhtml + '

Repos List:

'; + } + $('#githubdata').html(outhtml); + } + } + }); + }); +} + +// var form = $(this); +// var data = form.serialize(); +// var path = $('.create_project_form').attr('action') +// var method = $('.create_project_form').attr('method') + +// var request = $.ajax({ +// url: path, +// type: method, +// data: data, +// dataType: "json" +// }) +// request.done(function(serverData){ +// console.log('success'); +// console.log(serverData, "hello"); +// $('div.project_index').children().last().append('
'+ serverData.name+ '
') +// $('.hidden_project_form').toggle(); +// $('.create_project_form')[0].reset(); +// }) +// request.fail(function(serverData){ +// console.log(serverData); +// console.log('server request failed'); +// }) +// }); +// }; + + + +create a column for branch name and another column for status (is ahead or up to date) + +add project field +add another dropdown for project branch +make a request from local to github client side diff --git a/src/index.html b/src/index.html index 4f13778..05a6d7e 100644 --- a/src/index.html +++ b/src/index.html @@ -30,11 +30,24 @@

All active projects

+

Add new project

+ + +
@@ -49,12 +62,14 @@

Add new project

- +
+ + diff --git a/src/projects.js b/src/projects.js index 6c11b49..20e76c8 100644 --- a/src/projects.js +++ b/src/projects.js @@ -1,3 +1,6 @@ + + + function Project(id, type, name, lastActivity) { this.id = id; this.type = type; @@ -58,3 +61,5 @@ $(function(){ e.preventDefault(); }); }); + +