Skip to content

Commit e97d416

Browse files
Merge pull request #432 from ChristianMurphy/node-modules
Update Node Modules
2 parents f0b84ed + 19dc6be commit e97d416

19 files changed

+255
-183
lines changed

.eslintrc.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.pug-lint.json

Lines changed: 0 additions & 58 deletions
This file was deleted.

.remarkrc.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

lib/database.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const mongoose = require('mongoose');
1414
function setupDatabase (configuration) {
1515
const config = configuration.database;
1616

17-
// set Mongoose Promise to native Promise
17+
// Set Mongoose Promise to native Promise
1818
mongoose.Promise = Promise;
1919
mongoose.connect(config.hostname, config.database, config.port, (err) => {
2020
if (err) {

lib/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const nicestCodeProject = require('../modules/code-project/plugin');
3737

3838
const mongoose = require('mongoose');
3939

40-
// server has initial not been configured
40+
// Server has initial not been configured
4141
let isSetup = false;
4242

4343
/**
@@ -207,7 +207,7 @@ function setup (configuration) {
207207
engines: {pug: {module: pug}}
208208
});
209209

210-
// load nicest plugins
210+
// Load nicest plugins
211211
server.register(
212212
[
213213
{register: nicestWelcome},

modules/code-project/handler/confirm-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function confirmView (request, reply) {
3131
.exec()
3232
.then((teams) => {
3333
for (let teamIndex = 0; teamIndex < teams.length; teamIndex += 1) {
34-
// find any invalid users
34+
// Find any invalid users
3535
for (let userIndex = 0; userIndex < teams[teamIndex].members.length; userIndex += 1) {
3636
const currentUser = teams[teamIndex].members[userIndex];
3737

modules/code-project/handler/confirm.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function confirm (request, reply) {
5757

5858
// Gather Github user information from Users/Teams
5959
gatherGithubUsers(seedRepository, githubUsername, studentType, students)
60-
// create repostories
60+
// Create repostories
6161
.then((temporaryGithubRepositories) => {
6262
githubRepositories = temporaryGithubRepositories;
6363

@@ -68,7 +68,7 @@ function confirm (request, reply) {
6868
});
6969
})
7070

71-
// create Taiga boards
71+
// Create Taiga boards
7272
.then(() => {
7373
if (useTaiga) {
7474
const taigaUsername = request
@@ -102,7 +102,7 @@ function confirm (request, reply) {
102102
}
103103
})
104104

105-
// gather CA Dashboard users
105+
// Gather CA Dashboard users
106106
.then(() => {
107107
if (useAssessment) {
108108
return gatherCaUsers(seedRepository, githubUsername, studentType, students, course);
@@ -111,7 +111,7 @@ function confirm (request, reply) {
111111
return null;
112112
})
113113

114-
// setup CA Dashboard
114+
// Setup CA Dashboard
115115
.then((caConfiguration) => {
116116
if (useAssessment) {
117117
return configureCaDashboard(caConfiguration);
@@ -120,20 +120,20 @@ function confirm (request, reply) {
120120
return null;
121121
})
122122

123-
// add seed code to repositories
123+
// Add seed code to repositories
124124
.then(() => {
125125
const seedRepositoryURL = `https://github.com/${githubUsername}/${(/[a-z0-9-]+$/i).exec(seedRepository)}`;
126126
const githubUrls = githubRepositories.map((element) => element.url);
127127

128128
return seedGitRepositories(githubUsername, githubPassword, seedRepositoryURL, githubUrls);
129129
})
130130

131-
// sucess redirect
131+
// Sucess redirect
132132
.then(() => {
133133
reply().redirect(`${prefix}/recipe/code-project/success`);
134134
})
135135

136-
// failure redirect
136+
// Failure redirect
137137
.catch((err) => {
138138
request.log('error', err.toString());
139139
reply().redirect(`${prefix}/recipe/code-project/error`);

modules/code-project/task/create-github-repositories.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ function createRepositories (githubUsername, githubPassword, repositories, optio
3939
username: githubUsername
4040
});
4141

42-
// for each student
42+
// For each student
4343
for (const index in repositories) {
44-
// gather the promises
44+
// Gather the promises
4545
promises.push(
46-
// create a repository
46+
// Create a repository
4747
Github
4848
.me
4949
.repos
@@ -58,11 +58,11 @@ function createRepositories (githubUsername, githubPassword, repositories, optio
5858
const collaboratorPromises = [];
5959
const collaborators = repositories[index].collaborators;
6060

61-
// for each student
61+
// For each student
6262
for (const collaboratorIndex in collaborators) {
63-
// gather the promises
63+
// Gather the promises
6464
collaboratorPromises.push(
65-
// create a repository
65+
// Create a repository
6666
Github
6767
.repos(githubUsername, repositories[index].name)
6868
.collaborators(collaborators[collaboratorIndex])

modules/code-project/task/create-taiga-boards.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function requestPromise (data) {
5353
function createTiagaBoards (taigaUsername, taigaPassword, taigaBoards, taigaOptions) {
5454
let authorizationToken = null;
5555

56-
// login to Taiga
56+
// Login to Taiga
5757
requestPromise({
5858
body: {
5959
password: taigaPassword,
@@ -65,10 +65,10 @@ function createTiagaBoards (taigaUsername, taigaPassword, taigaBoards, taigaOpti
6565
uri: 'https://api.taiga.io/api/v1/auth'
6666
})
6767
.then((data) => {
68-
// store authorization token for later
68+
// Store authorization token for later
6969
authorizationToken = data.auth_token;
7070

71-
// setup shared meta for boards
71+
// Setup shared meta for boards
7272
const boardMetaData = {
7373
description: taigaOptions.description,
7474
is_backlog_activated: taigaOptions.isBacklogActived,
@@ -78,14 +78,14 @@ function createTiagaBoards (taigaUsername, taigaPassword, taigaBoards, taigaOpti
7878
is_wiki_activated: taigaOptions.isWikiActivated
7979
};
8080

81-
// collect promises for all boards
81+
// Collect promises for all boards
8282
const promises = [];
8383

84-
// create each board
84+
// Create each board
8585
for (const index in taigaBoards) {
86-
// set the name
86+
// Set the name
8787
boardMetaData.name = taigaBoards[index].name;
88-
// create board
88+
// Create board
8989
promises.push(
9090
requestPromise({
9191
body: boardMetaData,
@@ -97,17 +97,17 @@ function createTiagaBoards (taigaUsername, taigaPassword, taigaBoards, taigaOpti
9797
);
9898
}
9999

100-
// wait for all boards to be created
100+
// Wait for all boards to be created
101101
return Promise.all(promises);
102102
})
103103
.then((data) => {
104104
const promises = [];
105105

106-
// for each person in each project
106+
// For each person in each project
107107
for (const boardIndex in taigaBoards) {
108108
for (const userIndex in taigaBoards[boardIndex].emails) {
109109
const taigaRoles = data[boardIndex].roles;
110-
// setup the members permissions
110+
// Setup the members permissions
111111
const userMetadata = {
112112
email: taigaBoards[boardIndex].emails[userIndex],
113113
project: data[boardIndex].id,
@@ -116,7 +116,7 @@ function createTiagaBoards (taigaUsername, taigaPassword, taigaBoards, taigaOpti
116116
.id
117117
};
118118

119-
// add them to the taiga board
119+
// Add them to the taiga board
120120
promises.push(
121121
requestPromise({
122122
body: userMetadata,

modules/code-project/task/gather-ca-users.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Course = require('../../course/model/course');
3535
* @returns {Promise.<Array>} resolves to {Array} of {CaMeta}
3636
*/
3737
function gatherCaUsers (seedRepository, githubUsername, studentType, students, courseId) {
38-
// create empty repos for each student on github
38+
// Create empty repos for each student on github
3939
const caDashboardProjects = [];
4040
const githubUrl = `${githubUsername}/${(/[a-z0-9-]+$/i).exec(seedRepository)}-`;
4141

@@ -53,7 +53,7 @@ function gatherCaUsers (seedRepository, githubUsername, studentType, students, c
5353
.exec()
5454
])
5555
.then(([teams, course]) => {
56-
// for each team
56+
// For each team
5757
for (const team of teams) {
5858
const githubIndividualUrl = githubUrl + team
5959
.name
@@ -62,7 +62,7 @@ function gatherCaUsers (seedRepository, githubUsername, studentType, students, c
6262
.replace(/\//, '-')
6363
.toLowerCase();
6464

65-
// add team information to Github meta data
65+
// Add team information to Github meta data
6666
const caInformation = {
6767
course: course.name,
6868
'github-url': githubIndividualUrl,
@@ -72,7 +72,7 @@ function gatherCaUsers (seedRepository, githubUsername, studentType, students, c
7272
'taiga-slug': taigaSlug
7373
};
7474

75-
// for each team member
75+
// For each team member
7676
for (const member of team.members) {
7777
caInformation
7878
.members
@@ -111,7 +111,7 @@ function gatherCaUsers (seedRepository, githubUsername, studentType, students, c
111111
.exec()
112112
])
113113
.then(([users, course]) => {
114-
// for each student
114+
// For each student
115115
for (const user of users) {
116116
const githubIndividualUrl = githubUrl + user.modules.github.username;
117117
const taigaSlug = githubIndividualUrl
@@ -140,7 +140,7 @@ function gatherCaUsers (seedRepository, githubUsername, studentType, students, c
140140
});
141141
}
142142

143-
// create the Repository meta data
143+
// Create the Repository meta data
144144
caDashboardProjects.push(caInformation);
145145
}
146146

0 commit comments

Comments
 (0)