Skip to content

Commit

Permalink
Merge pull request #2413 from adaptlearning/release/crossframeworkimport
Browse files Browse the repository at this point in the history
0.10.0 Cross framework import release
  • Loading branch information
tomgreenfield authored Aug 29, 2019
2 parents af8e8d5 + 75759f7 commit 4707be7
Show file tree
Hide file tree
Showing 36 changed files with 871 additions and 313 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ 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.0] - 2019-08-29

Adds ability to import courses with an older framework version, and latest bugfixes.

### Fixed
- Improve error messages when saving theme preset names ([#2382](https://github.com/adaptlearning/adapt_authoring/issues/2382))
- Theme preset dropdown keeps reverting to 'No preset' ([#2379](https://github.com/adaptlearning/adapt_authoring/issues/2379))
- Manage theme preset button wraps onto second line ([#2361](https://github.com/adaptlearning/adapt_authoring/issues/2361))
- Sometimes a theme is wrongly identified as being editable ([#2360](https://github.com/adaptlearning/adapt_authoring/issues/2360))
- Absolute pikaday path breaks grunt build in some cases ([#2314](https://github.com/adaptlearning/adapt_authoring/issues/2314))
- Course creators cannot see asset tags list ([#2306](https://github.com/adaptlearning/adapt_authoring/issues/2306))
- Upload files not always cleared from tmp ([#2115](https://github.com/adaptlearning/adapt_authoring/issues/2115))
- When 'Add component' is clicked move focus to component search ([#1963](https://github.com/adaptlearning/adapt_authoring/issues/1963))
- Allow for pages without a sidebar ([#1541](https://github.com/adaptlearning/adapt_authoring/issues/1541))

### Added
- Ability to import a course with an older framework version ([#2288](https://github.com/adaptlearning/adapt_authoring/issues/2288))

## [0.9.0] - 2019-07-15

Adds ability to remove plugins, removes unused user roles and latest bugfixes.
Expand Down Expand Up @@ -622,6 +640,7 @@ Initial release.
- Loading screen of death
- Session cookie security issues

[0.10.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.8.1...v0.9.0
[0.8.1]: https://github.com/adaptlearning/adapt_authoring/compare/v0.8.0...v0.8.1
[0.8.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.7.1...v0.8.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ define(function(require) {
this.$el.css({ right:this.$('.editor-component-list-sidebar')
.width()*-1})
.velocity({ right: 0 }, {duration: 400, easing: 'easeOutQuart'});

this.$('.editor-component-list-sidebar-search-field input').focus();
},

closeView: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@

.nameEdit {
display: none;

.preset-error {
color: red;
}
}

.label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
min-width: 150px;
}
}

&.show-preset-select {
select {
width: 180px;
}
}
.edit.btn.secondary {
display: inline-block;
padding: 7px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</button>
</div>
<div class="nameEdit">
<div class="preset-error display-none"></div>
<input type="text" value="{{attributes.displayName}}">
<button class="button save btn secondary">
{{t 'app.themepresetsave'}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ define(function(require) {
// look out for injection attacks
var newValue = Helpers.escapeText($('input', $preset).val());

if (newValue === '') {
$preset.find('.preset-error').text(Origin.l10n.t('app.required')).removeClass('display-none');
return;
}

var theme = $('.theme select').val();
var presets = this.model.get('presets').where({ parentTheme: theme, displayName: newValue });
if (presets.length > 0) {
$preset.find('.preset-error').text(Origin.l10n.t('app.duplicatepreseterror')).removeClass('display-none');
return;
}

Origin.trigger('managePresets:edit', {
oldValue: $preset.attr('data-name'),
newValue: newValue
Expand All @@ -60,6 +72,7 @@ define(function(require) {
onCancelClicked: function(event) {
event && event.preventDefault();
var $preset = $(event.currentTarget).closest('.preset');
$preset.find('.preset-error').addClass('display-none');
$('.nameEdit', $preset).hide();
$('.name', $preset).show();
},
Expand Down
25 changes: 9 additions & 16 deletions frontend/src/modules/editor/themeEditor/views/editorThemingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ define(function(require) {
var selectedTheme = this.getSelectedTheme();

if (!this.themeIsEditable(selectedTheme)) {
this.$('.theme-selector').removeClass('show-preset-select');
this.$('.empty-message').show();
this.$('.editable-theme').hide();
$('.editor-theming-sidebar-reset').hide();
return;
}

this.$('.theme-selector').addClass('show-preset-select');
this.$('.empty-message').hide();
this.$('.editable-theme').show();
$('.editor-theming-sidebar-reset').show();
Expand Down Expand Up @@ -417,19 +419,8 @@ define(function(require) {

themeIsEditable: function(theme) {
var props = theme && theme.get('properties');
if (!props) {
return false;
}
if (Object.keys(props).length === 1) {
if (props.hasOwnProperty('pluginLocations')) {
return false;
}
// For old themes
if (props.hasOwnProperty('_screenSize')) {
return false;
}
}
return true;

return props && props.variables;
},

flattenNestedProperties: function(properties) {
Expand Down Expand Up @@ -538,14 +529,16 @@ define(function(require) {
text: Origin.l10n.t('app.presetinputtext'),
closeOnConfirm: false,
showCancelButton: true,
callback: function() {
callback: function(presetName) {
if (presetName === false) return;
if (presetName === "") return swal.showInputError(Origin.l10n.t('app.invalidempty'));
var theme = self.$('.theme select').val();
var presets = self.presets.where({ parentTheme: theme, displayName: arguments[0] });
var presets = self.presets.where({ parentTheme: theme, displayName: presetName });
if (presets.length > 0) {
swal.showInputError(Origin.l10n.t('app.duplicatepreseterror'));
} else {
// watch out for injection attacks
self.savePreset(Helpers.escapeText(arguments[0]));
self.savePreset(Helpers.escapeText(presetName));
swal.close();
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/frameworkImport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ define(function(require) {
Origin.permissions.addRoute('frameworkImport', data.featurePermissions);
});

Origin.on('router:frameworkImport', function(location, subLocation, action) {
Origin.on('router:frameworkImport', function() {
Origin.contentPane.setView(FrameworkImportView, { model: new Backbone.Model({ globalData: data }) });
Origin.sidebar.addView(new FrameworkImportSidebarView().$el);
});
Expand Down
70 changes: 70 additions & 0 deletions frontend/src/modules/frameworkImport/less/frameworkImport.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@import 'colours';
@import 'sharedStyles';
@framework-import-red: #ff3343;
@framework-import-amber: #ffa340;
@framework-import-green: @secondary-color;

.frameworkImport .inner {
.form-container-style;
Expand All @@ -26,6 +29,15 @@
}
}

.col-row {
display: flex;
align-items: center;
}

.tb-row .tb-col-inner {
padding: 0;
}

li {
margin-left: 0;
list-style: none;
Expand All @@ -43,4 +55,62 @@
padding-bottom: 5px;
}
}

&.import-summary {
.title {
padding-bottom: 10px;
color: @primary-color;

&.red {
color: @framework-import-red;
}

&.amber {
color: @framework-import-amber;
}

&.green {
color: @framework-import-green;
}
}
.description {
font-weight: @font-weight-bold;
}
}

&.plugin-list {
.red {
.status, .key {
color: @framework-import-red;
}
}

.amber {
.status, .key {
color: @framework-import-amber;
}

.at-version {
font-weight: @font-weight-bold;
}
}

.green-install, .green-update {
.status, .key {
color: @framework-import-green;
}

.import-version {
font-weight: @font-weight-bold;
}
}

.status, .key {
font-weight: @font-weight-bold;
}

.key-field {
margin-bottom: 5px;
}
}
}
86 changes: 51 additions & 35 deletions frontend/src/modules/frameworkImport/templates/frameworkImport.hbs
Original file line number Diff line number Diff line change
@@ -1,42 +1,58 @@
<div class="inner">
<form class="frameworkImport forms" action="importsource" method="post" autocomplete="off">
<div class="form-group">
<div class="field field-file">
<label for="file">
{{t 'app.assetfile'}} <span class="req">*</span>
<span class="error"></span>
</label>
<div class="field-help">
{{t 'app.importframeworkinstruction'}}
</div>
{{#if path}}
<div class="asset-management-new-asset-file">
{{t 'app.importframeworkfileuploaded'}}
</div>
{{else}}
<input type="file" class="asset-file" name="file">
{{maxUploadSize}}
<div class="progress-container">
<div class="progress-bar">
<div class="progress-percent">0%</div>
</div>
<div id="import_upload" class="inner">
<form class="frameworkImport forms" action="importsourcecheck" method="post" autocomplete="off">
<div class="form-group">
<div class="field field-file">
<label for="file">
{{t 'app.assetfile'}} <span class="req">*</span>
<span class="error"></span>
</label>
<div class="field-help">
{{t 'app.importframeworkinstruction'}}
</div>
{{#if path}}
<div class="asset-management-new-asset-file">
{{t 'app.importframeworkfileuploaded'}}
</div>
{{else}}
<input type="file" class="asset-file" name="file">
{{maxUploadSize}}
<div class="progress-container">
<div class="progress-bar">
<div class="progress-percent">0%</div>
</div>
{{/if}}
</div>
<div class="field field-assets">
<label for="tags">{{t 'app.importassetfolderstitle'}}</label>
<div class="field-help">
{{t 'app.importassetfoldersinstruction'}}
</div>
<div>
<input type="text" autocomplete="off" class="width-30" id="formAssetFolders" name="formAssetFolders" placeholder="{{t 'app.importassetfoldersplaceholder'}}" value="" />
</div>
{{/if}}
</div>
<div class="field field-assets">
<label for="tags">{{t 'app.importassetfolderstitle'}}</label>
<div class="field-help">
{{t 'app.importassetfoldersinstruction'}}
</div>
<div class="field field-tags">
<label for="tags">{{t 'app.tags'}}</label>
<input type="text" autocomplete="off" class="width-30" id="tags_control" name="tags_control" value="{{pickCSV tags "title"}}" />
<div>
<input type="text" autocomplete="off" class="width-30" id="formAssetFolders" name="formAssetFolders" placeholder="{{t 'app.importassetfoldersplaceholder'}}" value="" />
</div>
<input type="hidden" name="tags" id="tags" />
</div>
<div class="field field-tags">
<label for="tags">{{t 'app.tags'}}</label>
<input type="text" autocomplete="off" class="width-30" id="tags_control" name="tags_control" value="{{pickCSV tags "title"}}" />
</div>
<input type="hidden" name="tags" id="tags" />
</div>
</form>
</div>

<div id="import_details" class="display-none">
<form class="frameworkImportDetails forms" action="importsource" method="post" autocomplete="off">
<div class="inner framework-versions display-none"></div>
<div class="inner import-summary">
<div class="title"></div>
<div class="description"></div>
</div>
<div class="inner plugin-list display-none">
<div class="red key-field display-none"><span class="key">{{t 'app.pluginredlabel'}}</span> - {{t 'app.pluginredkey'}}</div>
<div class="amber key-field display-none"><span class="key">{{t 'app.pluginamberlabel'}}</span> - {{t 'app.pluginamberkey'}}</div>
<div class="green-update key-field display-none"><span class="key">{{t 'app.plugingreenupdatelabel'}}</span> - {{t 'app.plugingreenupdatekey'}}</div>
<div class="green-install key-field display-none"><span class="key">{{t 'app.plugingreeninstalllabel'}}</span> - {{t 'app.plugingreeninstallkey'}}</div>
</div>
</form>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="frameworkImportPlugin-headings tb-heading col-row tb-row">

<div class="frameworkImportPlugin-heading col-40">
<h4 class="tb-col-inner">{{t 'app.name'}}</h4>
</div>

<div class="frameworkImportPlugin-heading col-20 col-centered">
<h4 class="tb-col-inner">{{t 'app.importversion'}}</h4>
</div>

<div class="frameworkImportPlugin-heading col-20 col-centered">
<h4 class="tb-col-inner">{{t 'app.atversion'}}</h4>
</div>

<div class="frameworkImportPlugin-heading col-20 col-centered">
<h4 class="tb-col-inner">{{t 'app.action'}}</h4>
</div>

</div>
<ul class="frameworkImportPlugin-plugins clearfix grid-layout"></ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="frameworkImport-inner">
<div class="frameworkImport-description col-row tb-row {{category}}">
<div class="col-40">
{{displayName}}
</div>
<div class="col-20 col-centered import-version">
{{importVersion}}
</div>
<div class="col-20 col-centered at-version">
{{authoringToolVersion}}
</div>
<div class="col-20 col-centered status">
{{status}}
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="separator"></div>
<div class="sidebar-item-inner">
<button type="submit" class="action-primary framework-import-sidebar-save-button save">
<button type="submit" class="action-primary framework-import-sidebar-save-button show-details">
<span>{{t 'app.importcourse'}}</span>
</button>
<button type="button" class="cancel action-secondary">
Expand Down
Loading

0 comments on commit 4707be7

Please sign in to comment.