Skip to content

Commit

Permalink
Merge pull request #2537 from adaptlearning/release/bugpatch
Browse files Browse the repository at this point in the history
Release 0.10.4
  • Loading branch information
tomgreenfield committed Aug 21, 2020
2 parents 28247b0 + ab9b806 commit 9100738
Show file tree
Hide file tree
Showing 29 changed files with 686 additions and 532 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ 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.4] - 2020-08-21

Bugfix release.

### Fixed
- Copied articles sometimes get pasted into the wrong place ([#1892](https://github.com/adaptlearning/adapt_authoring/issues/1892))
- Install breaks if any config values contain true/false ([#2133](https://github.com/adaptlearning/adapt_authoring/issues/2133))
- Upgrade script replaces all core-bundled plugins ([#2316](https://github.com/adaptlearning/adapt_authoring/issues/2316))
- Copied and pasted pages have out of order articles ([#2404](https://github.com/adaptlearning/adapt_authoring/issues/2404))
- Tooltip overflow in sidebar 'modal' ([#2414](https://github.com/adaptlearning/adapt_authoring/issues/2414))
- Error: Failed to determine user's tenant! ([#2504](https://github.com/adaptlearning/adapt_authoring/issues/2504))
- Export fails as it requires LESS variables for plugins that aren't in the project ([#2510](https://github.com/adaptlearning/adapt_authoring/issues/2510))
- Top navigation obscures save button on small window sizes ([#2511](https://github.com/adaptlearning/adapt_authoring/issues/2511))
- Support Node 14 ([#2514](https://github.com/adaptlearning/adapt_authoring/issues/2514))
- Reset not working ([#2518](https://github.com/adaptlearning/adapt_authoring/issues/2518))
- Wrong state for display title icon ([#2523](https://github.com/adaptlearning/adapt_authoring/issues/2523))
- Get 500 error when copying items with assets in Project Settings. Can also break courseassets in other items. ([#2534](https://github.com/adaptlearning/adapt_authoring/issues/2534))
- default FW -> AT import issues - PLP settings ([adaptlearning/adapt_framework#2841](https://github.com/adaptlearning/adapt_framework/issues/2841))

### Added
- Option to customise the 'contact support' message with details of who to contact ([#2477](https://github.com/adaptlearning/adapt_authoring/issues/2477))
- Remove 'field-help' icon if there isn't any 'help' text ([#2509](https://github.com/adaptlearning/adapt_authoring/issues/2509))
- Customise help link ([#2527](https://github.com/adaptlearning/adapt_authoring/issues/2527))

## [0.10.3] - 2020-02-21

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

[0.10.4]: https://github.com/adaptlearning/adapt_authoring/compare/v0.10.3...v0.10.4
[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
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/core/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ define(function(require){
}
}
return flatProperties;
},

importConstants: function() {
this.constants = Origin.constants;
return '';
}
};

Expand Down
30 changes: 8 additions & 22 deletions frontend/src/core/models/blockModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,14 @@ define(function(require) {
// Block specific properties
layoutOptions: null,
dragLayoutOptions: null,
// These are the only attributes which should be permitted on a save
// TODO look into this...
whitelistAttributes: [
'_id',
'_courseId',
'_parentId',
'_layoutOptions',
'_type',
'_sortOrder',
'_classes',
'_isOptional',
'_isAvailable',
'body',
'displayTitle',
'title',
'_extensions',
'themeSettings',
'_onScreen',
'_isVisible',
'_isHidden',
'instruction',
'_colorLabel'
attributeBlacklist: [
'_isDeleted',
'_tenantId',
'_trackingId',
'createdBy',
'createdAt',
'layoutOptions',
'updatedAt'
]
});

Expand Down
30 changes: 5 additions & 25 deletions frontend/src/core/models/componentModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,11 @@ define(function(require) {
urlRoot: 'api/content/component',
_parentType: 'block',
_siblingTypes: 'component',
// These are the only attributes which should be permitted on a save
// TODO look into this...
whitelistAttributes: [
'_id',
'_componentType',
'_courseId',
'_layout',
'_parentId',
'_type',
'properties',
'_component',
'_extensions',
'_classes',
'_isOptional',
'_isAvailable',
'body',
'displayTitle',
'title',
'version',
'themeSettings',
'_onScreen',
'_isVisible',
'_isHidden',
'instruction',
'_colorLabel'
attributeBlacklist: [
'_isDeleted',
'createdBy',
'createdAt',
'updatedAt'
]
});

Expand Down
18 changes: 7 additions & 11 deletions frontend/src/core/models/contentModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(function(require) {

var ContentModel = Backbone.Model.extend({
idAttribute: '_id',
whitelistAttributes: null,
attributeBlacklist: null,

initialize: function(options) {
this.on('sync', this.loadedData, this);
Expand Down Expand Up @@ -89,17 +89,13 @@ define(function(require) {
return JSON.stringify(this);
},

// Remove any attributes which are not on the whitelist (called before a save)
pruneAttributes: function() {
var self = this;
// Ensure that only valid attributes are pushed back on the save
if (self.whitelistAttributes) {
_.each(_.keys(self.attributes), function(key) {
if (!_.contains(self.whitelistAttributes, key)) {
self.unset(key);
}
});
}
if (!this.attributeBlacklist) return;
Object.keys(this.attributes).forEach(function(key) {
if (_.contains(this.attributeBlacklist, key)) {
this.unset(key);
}
}, this);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ define(function(require){
var events = {};
events['editorView:moveBlock:' + id] = this.render;
events['editorView:deleteArticle:' + id] = this.deletePageArticle;
events['editorView:pasted:' + id] = this.onPaste;
events['editorView:pasted:' + id] = this.render;
this.listenTo(Origin, events);
}

Expand Down Expand Up @@ -282,20 +282,6 @@ define(function(require){
duration = 0;
}
this.$('.article-content').velocity(shouldCollapse ? 'slideUp' : 'slideDown', duration);
},

onPaste: function(data) {
(new BlockModel({ _id: data._id })).fetch({
success: _.bind(function(model) {
this.addBlockView(model);
}, this),
error: function(data) {
Origin.Notify.alert({
type: 'error',
text: 'app.errorfetchingdata'
});
}
});
}

}, {
Expand Down
18 changes: 2 additions & 16 deletions frontend/src/modules/editor/contentObject/views/editorPageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ define(function(require){
'pageView:itemAnimated': this.evaluateChildStatus
};
originEvents['editorView:moveArticle:' + id] = this.render;
originEvents['editorView:pasted:' + id] = this.onPaste;
originEvents['editorView:pasted:' + id] = this.render;
this.listenTo(Origin, originEvents);

Origin.options.addItems([
Expand Down Expand Up @@ -109,7 +109,7 @@ define(function(require){
$.scrollTo(newArticleView.$el, 200);
}
// Increment the 'sortOrder' property
articleModel.set('_pasteZoneSortOrder', sortOrder++);
articleModel.set('_pasteZoneSortOrder', sortOrder + 1);
// Post-article paste zone - sort order of placeholder will be one greater
this.$('.page-articles').append(new EditorPasteZoneView({ model: articleModel }).$el);
return newArticleView;
Expand Down Expand Up @@ -159,20 +159,6 @@ define(function(require){
Origin.trigger('contextMenu:open', fakeView, event);
},

onPaste: function(data) {
(new ArticleModel({ _id: data._id })).fetch({
success: _.bind(function(model) {
this.addArticleView(model);
}, this),
error: function(data) {
Origin.Notify.alert({
type: 'error',
text: 'app.errorfetchingdata'
});
}
});
},

onCutArticle: function(view) {
this.once('pageView:postRender', view.showPasteZones);
this.render();
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/modules/help/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ define(function(require) {
var Origin = require('core/origin');

Origin.on('navigation:help', function() {
openWikiLink(getLink());
var override = Origin.constants.supportLink;
if (override) {
window.open(override);
} else {
openWikiLink(getLink());
}
});

function getLink() {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/modules/navigation/less/navigation.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@
}

.navigation-left {
width:50%;
float:left;
.navigation-product-name {
.no-select;
}
}

.navigation-right {
width:47%;
padding-right: 20px;
float:right;
text-align:right;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/scaffold/less/displayTitle.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
display: none;
}
.field-editor input {
width: 81%;
width: calc(90% - 80px);
}
}

Expand Down
16 changes: 3 additions & 13 deletions frontend/src/modules/scaffold/less/forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ form .error {
}

.field {
position: relative;
padding: 10px 30px;
&-object {
padding: 8px 10px;
Expand Down Expand Up @@ -84,32 +85,21 @@ form .error {
}

.field-help {
position: relative;
display: inline-block;
padding: 0 3px;
.tooltip {
position: absolute;
z-index: 2;
top: 0;
left: 105%;
max-width: 300px;
padding: 5px;
border-radius: 6px;
margin: 10px 0;
background-color: @tertiary-color;
color: @white;
opacity: 0;
text-align: center;
transition: opacity 0.3s, visibility 0s 0.3s;
visibility: hidden;
.tooltip-key {
color: @primary-color;
font-family: monospace;
}
.tooltip-help {
width: 300px;
.scaffold-items-modal & {
width: 200px;
}
}
}
i:hover + .tooltip {
opacity: 0.9;
Expand Down
11 changes: 4 additions & 7 deletions frontend/src/modules/scaffold/templates/field.hbs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<div class="field{{#if title}} field-{{stringToClassName title}}{{else}}{{#if legend}} field-object field-object-{{stringToClassName legend}}{{/if}}{{/if}}{{#if isDefaultValue}} is-default-value{{/if}}" data-editor-id="{{editorId}}" data-type="{{#if inputType.type}}{{inputType.type}}{{else}}{{inputType}}{{/if}}">
{{#if title}}
<label for="{{editorId}}">{{title}}</label>
<label for="{{editorId}}" title="{{key}}">{{title}}</label>
{{#if help}}
<div class="field-help">
<i class="fa fa-info-circle"></i>
<div class="tooltip">
<div class="tooltip-key">{{key}}</div>
{{#if help}}
<div class="tooltip-help">{{help}}</div>
{{/if}}
</div>
<div class="tooltip">{{help}}</div>
</div>
{{/if}}
<button class="field-default" data-action="default" title="{{t 'app.reset'}}">
<i class="fa fa-undo"></i>
</button>
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/modules/scaffold/views/scaffoldDisplayTitleView.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define([ 'core/origin', 'backbone-forms' ], function(Origin, BackboneForms) {

form: null,

isLocked: false,
isLocked: null,

events: {
'change input': 'triggerChange',
Expand Down Expand Up @@ -46,15 +46,16 @@ define([ 'core/origin', 'backbone-forms' ], function(Origin, BackboneForms) {
render: function() {
this.$el.append(Handlebars.templates[this.constructor.template]({ field: '' }));
this.setValue(this.value);

if (this.form.fields.title.editor.getValue() === this.getValue()) {
this.isLocked = true;
this.toggleLockButton();
}
this.isLocked = this.form.fields.title.editor.getValue() === this.getValue();
_.defer(this.postRender.bind(this));

return this;
},

postRender: function() {
this.toggleLockButton();
},

triggerChange: function() {
this.trigger('change', this);
},
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/modules/scaffold/views/scaffoldListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ define([
var flatItem = Helpers.flattenNestedProperties(this.editor.value);
var itemValues = _.values(flatItem);
var parentAttributes = Origin.scaffold.getCurrentModel().attributes;
var parentId = parentAttributes._type === 'course' ? parentAttributes._id : parentAttributes._parentId;
itemValues.forEach(function(item) {
if (typeof item !== 'string' || item.indexOf('course/assets') === -1) return;

Expand All @@ -112,7 +113,7 @@ define([
_contentTypeId : parentAttributes._id,
_fieldName : itemFileName,
_assetId : result[0]._id,
_contentTypeParentId: parentAttributes._parentId
_contentTypeParentId: parentId
}, {
error: function(error) {
Origin.Notify.alert({
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/modules/user/templates/forgotPassword.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{importConstants}}

<div class="login-logo"></div>

<div class="login-title">{{t 'app.resetpassword'}}</div>
Expand All @@ -24,6 +26,11 @@
</form>
</div>
<div class="forgot-footer">
<strong>{{t 'app.hasyouremailchanged'}}</strong> {{t 'app.forgotpasswordfooter'}}
<strong>{{t 'app.hasyouremailchanged'}}</strong>
{{#if constants.supportContact}}
{{t 'app.forgotpasswordfooter' supportContact=constants.supportContact}}
{{else}}
{{t 'app.forgotpasswordfooter' supportContact=(t 'app.anadmin')}}
{{/if}}
</div>
</div>
Loading

0 comments on commit 9100738

Please sign in to comment.