Skip to content

Commit

Permalink
Merge pull request #2501 from adaptlearning/release/bugpatch
Browse files Browse the repository at this point in the history
Release 0.10.3
  • Loading branch information
tomgreenfield authored Feb 21, 2020
2 parents 859227b + 58817e7 commit 28247b0
Show file tree
Hide file tree
Showing 21 changed files with 6,599 additions and 131 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/nbproject/
/master/

package-lock.json

/plugins/content/component/versions/
/plugins/content/component/componentcache/
/plugins/content/extension/versions/
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ before_install:

install:
- npm config set spin false
- npm install
- npm ci
- grunt build:prod

matrix:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to the Adapt authoring tool are documented in this file.
**IMPORTANT**: For information on how to **correctly and safely** update your installation, please consult **INSTALL.md**.<br/>
_Note that we adhere to the [semantic versioning](http://semver.org/) scheme for release numbering._

## [0.10.3] - 2020-02-21

Bugfix release.

### Fixed
- Cannot remove Spoor's required files from published course ([#2235](https://github.com/adaptlearning/adapt_authoring/issues/2235))
- If I switch theme, the old theme assets still seem to be retained on publish ([#2442](https://github.com/adaptlearning/adapt_authoring/issues/2442))
- Incompatible versions of plugins are targetted if range specified in adapt.json ([#2479](https://github.com/adaptlearning/adapt_authoring/issues/2479))
- Framework and AT use different default screen sizes ([#2485](https://github.com/adaptlearning/adapt_authoring/issues/2485))
- Heavy course validation on front-end ([#2487](https://github.com/adaptlearning/adapt_authoring/issues/2487))

### Added
- Generate a dependency lock on release ([#2301](https://github.com/adaptlearning/adapt_authoring/issues/2301))

## [0.10.2] - 2019-11-08

Bugfix release.
Expand Down Expand Up @@ -673,6 +687,7 @@ Initial release.
- Loading screen of death
- Session cookie security issues

[0.10.3]: https://github.com/adaptlearning/adapt_authoring/compare/v0.10.2...v0.10.3
[0.10.2]: https://github.com/adaptlearning/adapt_authoring/compare/v0.10.1...v0.10.2
[0.10.1]: https://github.com/adaptlearning/adapt_authoring/compare/v0.10.0...v0.10.1
[0.10.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.9.0...v0.10.0
Expand Down
31 changes: 0 additions & 31 deletions frontend/src/core/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,37 +228,6 @@ define(function(require){
return success;
},

// checks for at least one child object
validateCourseContent: function(currentCourse, callback) {
var containsAtLeastOneChild = true;
var alerts = [];
var iterateOverChildren = function(model, index, doneIterator) {
if(!model._childTypes) {
return doneIterator();
}
model.fetchChildren(function(currentChildren) {
if (currentChildren.length > 0) {
return helpers.forParallelAsync(currentChildren, iterateOverChildren, doneIterator);
}
containsAtLeastOneChild = false;
var children = _.isArray(model._childTypes) ? model._childTypes.join('/') : model._childTypes;
alerts.push(model.get('_type') + " '" + model.get('title') + "' missing " + children);
doneIterator();
});
};
// start recursion
iterateOverChildren(currentCourse, null, function() {
var errorMessage = "";
if(alerts.length > 0) {
for(var i = 0, len = alerts.length; i < len; i++) {
errorMessage += "<li>" + alerts[i] + "</li>";
}
return callback(new Error(errorMessage));
}
callback(null, true);
});
},

isValidEmail: function(value) {
var regEx = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return value.length > 0 && regEx.test(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ define(function(require) {
var newMenuItemModel = new ContentObjectModel({
_parentId: this._parentId,
_courseId: Origin.editor.data.course.get('_id'),
title: (type == 'page' ? Origin.l10n.t('app.placeholdernewpage') : Origin.l10n.t('app.placeholdernewmenu')),
displayTitle: (type == 'page' ? Origin.l10n.t('app.placeholdernewpage') : Origin.l10n.t('app.placeholdernewmenu')),
body: '',
linkText: Origin.l10n.t('app.view'),
graphic: { alt: '', src: '' },
_type: type
Expand Down Expand Up @@ -125,26 +122,20 @@ define(function(require) {
addNewPageArticleAndBlock: function(model, newMenuItemView) {
var typeToAdd;
var newChildModel;
var newChildTitle;
this.pageModel;
this.pageView;

if (model.get('_type') === 'page') {
this.pageModel = model;
this.pageView = newMenuItemView;
typeToAdd = 'article';
newChildTitle = Origin.l10n.t('app.placeholdernewarticle');
var newChildModel = new ArticleModel();
} else {
typeToAdd = 'block';
newChildTitle = Origin.l10n.t('app.placeholdernewblock');
var newChildModel = new BlockModel();
}

newChildModel.save({
title: newChildTitle,
displayTitle: (typeToAdd == 'block') ? '' : newChildTitle,
body: '',
_parentId: model.get('_id'),
_courseId: Origin.editor.data.course.get('_id')
}, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ define(function(require){
event && event.preventDefault();
var model = new BlockModel();
model.save({
title: Origin.l10n.t('app.placeholdernewblock'),
displayTitle: Origin.l10n.t('app.placeholdernewblock'),
body: '',
_parentId: this.model.get('_id'),
_courseId: Origin.editor.data.course.get('_id'),
layoutOptions: [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ define(function(require) {
var model = new ComponentModel();

model.save({
title: Origin.l10n.t('app.placeholdernewcomponent'),
displayTitle: Origin.l10n.t('app.placeholdernewcomponent'),
body: '',
_parentId: this._parentId,
_courseId: Origin.editor.data.course.get('_id'),
_type: 'component',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ define(function(require){
addNewArticle: function(event) {
event && event.preventDefault();
(new ArticleModel()).save({
title: Origin.l10n.t('app.placeholdernewarticle'),
displayTitle: Origin.l10n.t('app.placeholdernewarticle'),
body: '',
_parentId: this.model.get('_id'),
_courseId: Origin.editor.data.course.get('_id'),
_type:'article'
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/modules/editor/course/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ define(function(require) {
}

function createNewCourse() {
var model = new CourseModel({
title: Origin.l10n.t('app.placeholdernewcourse'),
displayTitle: Origin.l10n.t('app.placeholdernewcourse')
});
var model = new CourseModel();
Origin.trigger('location:title:update', {
breadcrumbs: ['dashboard'],
title: Origin.l10n.t('app.editornew')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ define(function(require) {

createGenericPage: function(courseModel) {
var contentObjectModel = new ContentObjectModel({
title: Origin.l10n.t('app.placeholdernewpage'),
displayTitle: Origin.l10n.t('app.placeholdernewpage'),
_type: 'page',
_courseId: courseModel.get('_id'),
_parentId: courseModel.get('_id')
Expand Down
28 changes: 3 additions & 25 deletions frontend/src/modules/editor/global/views/editorView.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,12 @@ define(function(require) {
'editorView:copy': this.addToClipboard,
'editorView:copyID': this.copyIdToClipboard,
'editorView:paste': this.pasteFromClipboard,
'editorCommon:download': function() {
this.validateProject(function(error) {
this.downloadProject();
});
},
'editorCommon:download': this.downloadProject,
'editorCommon:preview': function(isForceRebuild) {
var previewWindow = window.open('loading', 'preview');
this.validateProject(function(error) {
if(error) {
return previewWindow.close();
}
this.previewProject(previewWindow, isForceRebuild);
});
this.previewProject(previewWindow, isForceRebuild);
},
'editorCommon:export': function() {
this.validateProject(function(error) {
this.exportProject(error);
});
}
'editorCommon:export': this.exportProject
});
this.render();
this.setupEditor();
Expand All @@ -76,15 +63,6 @@ define(function(require) {
this.renderCurrentEditorView();
},

validateProject: function(next) {
helpers.validateCourseContent(this.currentCourse, _.bind(function(error) {
if(error) {
Origin.Notify.alert({ type: 'error', text: "There's something wrong with your course:<br/><br/>" + error });
}
next.call(this, error);
}, this));
},

previewProject: function(previewWindow, forceRebuild) {
if(Origin.editor.isPreviewPending) {
return;
Expand Down
12 changes: 3 additions & 9 deletions lib/installHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,20 +573,14 @@ function updateFrameworkPlugins(opts, callback) {
}
var plugins = Object.keys(json.dependencies);
async.eachSeries(plugins, function(plugin, pluginCallback) {
var _done = function(error) {
showSpinner(`Updating Adapt framework plugin '${plugin}'`);
app.bowermanager.installLatestCompatibleVersion(plugin, error => {
hideSpinner();
if(error) { // log, but don't fail (see #1890)
warn(`Failed to install ${plugin}, ${error}`);
}
pluginCallback();
};
showSpinner(`Updating Adapt framework plugin '${plugin}'`);

if(json.dependencies[plugin] === '*') {
app.bowermanager.installLatestCompatibleVersion(plugin, _done);
} else {
app.bowermanager.installPlugin(plugin, json.dependencies[plugin], _done);
}
});
}, function(error) {
hideSpinner();
if(error) {
Expand Down
Loading

0 comments on commit 28247b0

Please sign in to comment.