-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue/788 #801
Merged
Merged
Issue/788 #801
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cc5974e
Fixes #792, adds support for HTML table editing
brian-learningpool 351dbf7
Added support for upgrading core plugins via script
brian-learningpool f275862
Added conditional check for outputdir argument
brian-learningpool 17c8ad2
Added 'framework' to bower plugin schema.
brian-learningpool e0372bb
Tidy up of lib/application.js
brian-learningpool d5814d7
Resolves #737, removes editor attributes from published JSON
brian-learningpool 9b48032
Correction - setting editorOnly: true to the correct attribute
brian-learningpool File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -362,7 +362,13 @@ Origin.prototype.createServer = function (options, cb) { | |
}, configuration.getConfig('dbName')); | ||
}; | ||
|
||
Origin.prototype.startServer = function () { | ||
Origin.prototype.startServer = function (options) { | ||
|
||
// Ensure that the options object is set. | ||
options = typeof options === 'undefined' | ||
? { skipVersionCheck: false } | ||
: options; | ||
|
||
// configure server | ||
var serverOptions = {}; | ||
if (!this.configuration || !this.configuration.getConfig('dbName')) { | ||
|
@@ -388,10 +394,10 @@ Origin.prototype.startServer = function () { | |
callback(); | ||
}, | ||
function(callback) { | ||
if (true === configuration.getConfig('isTestEnvironment')) { | ||
if (true === configuration.getConfig('isTestEnvironment') || options.skipVersionCheck) { | ||
return callback(); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you enabled .editorconfig in your editor and merge the develop branch, you'll not add this kind of whitespace ;) |
||
// Check the latest version of the project | ||
request({ | ||
headers: { | ||
|
@@ -400,9 +406,11 @@ Origin.prototype.startServer = function () { | |
uri: 'https://api.github.com/repos/adaptlearning/adapt_authoring/tags', | ||
method: 'GET' | ||
}, function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
if (error) { | ||
logger.log('error', error); | ||
} else if (response.statusCode == 200) { | ||
var tagInfo = JSON.parse(body); | ||
|
||
if (tagInfo) { | ||
latestBuilderTag = tagInfo[0].name; | ||
} | ||
|
@@ -412,7 +420,7 @@ Origin.prototype.startServer = function () { | |
}); | ||
}, | ||
function(callback) { | ||
if (true === configuration.getConfig('isTestEnvironment')) { | ||
if (true === configuration.getConfig('isTestEnvironment') || options.skipVersionCheck) { | ||
return callback(); | ||
} | ||
|
||
|
@@ -424,42 +432,42 @@ Origin.prototype.startServer = function () { | |
uri: 'https://api.github.com/repos/adaptlearning/adapt_framework/tags', | ||
method: 'GET' | ||
}, function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
if (error) { | ||
logger.log('error', error); | ||
} else if (response.statusCode == 200) { | ||
var tagInfo = JSON.parse(body); | ||
|
||
if (tagInfo) { | ||
latestFrameworkTag = tagInfo[0].name; | ||
} | ||
} | ||
} | ||
|
||
callback(); | ||
}); | ||
}, | ||
function(callback) { | ||
if (true === configuration.getConfig('isTestEnvironment')) { | ||
if (true === configuration.getConfig('isTestEnvironment') || options.skipVersionCheck) { | ||
return callback(); | ||
} | ||
|
||
var isUpdateAvailable = false; | ||
|
||
if (installedBuilderVersion == latestBuilderTag) { | ||
console.log(chalk.green('Adapt Builder %s'), installedBuilderVersion); | ||
logger.log('info', chalk.green('Adapt Builder %s'), installedBuilderVersion); | ||
} else { | ||
console.log(chalk.yellow('You are currently running Adapt Builder %s - %s is now available'), installedBuilderVersion, latestBuilderTag); | ||
logger.log('info', chalk.yellow('You are currently running Adapt Builder %s - %s is now available'), installedBuilderVersion, latestBuilderTag); | ||
isUpdateAvailable = true; | ||
} | ||
|
||
// @TODO #771 - remove this check until the builder supports v2 of the framework | ||
// if (installedFrameworkVersion == latestFrameworkTag) { | ||
// console.log(chalk.green('Adapt Framework %s'), installedFrameworkVersion); | ||
// } else { | ||
// console.log(chalk.yellow('The Adapt Framework being used is %s - %s is now available'), installedFrameworkVersion, latestFrameworkTag); | ||
// isUpdateAvailable = true; | ||
// } | ||
if (installedFrameworkVersion == latestFrameworkTag) { | ||
logger.log('info', chalk.green('Adapt Framework %s'), installedFrameworkVersion); | ||
} else { | ||
logger.log('info', chalk.yellow('The Adapt Framework being used is %s - %s is now available'), installedFrameworkVersion, latestFrameworkTag); | ||
isUpdateAvailable = true; | ||
} | ||
|
||
if (isUpdateAvailable) { | ||
console.log("Run " + chalk.bgRed('"node upgrade.js"') + " to update to the latest version"); | ||
console.log(); | ||
logger.log('info', "Run " + chalk.bgRed('"node upgrade.js"') + " to update to the latest version"); | ||
} | ||
|
||
callback(); | ||
|
@@ -561,7 +569,7 @@ Origin.prototype.restartServer = function () { | |
app.startServer(); | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
logger.log('error', error); | ||
} | ||
} | ||
}; | ||
|
@@ -571,7 +579,7 @@ Origin.prototype.restartServer = function () { | |
* @api public | ||
*/ | ||
|
||
Origin.prototype.run = function () { | ||
Origin.prototype.run = function (options) { | ||
// some modules are loaded async, so wait for them before actually starting the server | ||
this.once('modulesReady', function (app) { | ||
try { | ||
|
@@ -584,7 +592,7 @@ Origin.prototype.run = function () { | |
} | ||
app.mailer = new Mailer(); | ||
|
||
app.startServer(); | ||
app.startServer(options); | ||
}); | ||
|
||
|
||
|
@@ -602,6 +610,7 @@ Origin.prototype.run = function () { | |
this.preloadModule('usermanager', require('./usermanager')); | ||
this.preloadModule('tenantmanager', require('./tenantmanager')); | ||
this.preloadModule('rolemanager', require('./rolemanager')); | ||
this.preloadModule('bowermanager', require('./bowermanager')); | ||
this.preload(); | ||
}; | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options should be checked, and defaulted if not passed:
or similar