Skip to content

Commit

Permalink
Merge pull request #2454 from adaptlearning/release/bugpatch
Browse files Browse the repository at this point in the history
Release 0.10.1
  • Loading branch information
tomgreenfield committed Oct 22, 2019
2 parents 4707be7 + eda41d8 commit 650cece
Show file tree
Hide file tree
Showing 30 changed files with 511 additions and 265 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ package-lock.json
/plugins/content/menu/versions/
/plugins/content/bower/bowercache/

/routes/lang/en.json

/temp
/test/.testcache
/tmp
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ 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.1] - 2019-10-22

Bugfix release.

### Fixed
- Courses dashboard: A-Z/Z-A sort is case sensitive ([#2325](https://github.com/adaptlearning/adapt_authoring/issues/2325))
- Item copy can result in broken courseassets in other items ([#2347](https://github.com/adaptlearning/adapt_authoring/issues/2347))
- Allow non-interactive install and upgrade scripts ([#2407](https://github.com/adaptlearning/adapt_authoring/issues/2407))
- installation: missing translation key for app.productname ([#2410](https://github.com/adaptlearning/adapt_authoring/issues/2410))
- Fix reading of asset type from schema ([#2416](https://github.com/adaptlearning/adapt_authoring/issues/2416))
- Grunt tasks do not process symlinks ([#2428](https://github.com/adaptlearning/adapt_authoring/issues/2428))
- Importing plugin with existing targetAttribute causes error when retrieving plugin schemas ([#2433](https://github.com/adaptlearning/adapt_authoring/issues/2433))
- Support Node 12 ([#2437](https://github.com/adaptlearning/adapt_authoring/issues/2437))
- Asset tags are not preserved on import ([#2439](https://github.com/adaptlearning/adapt_authoring/issues/2439))

### Added
- skip-version check should be passed as cli argument ([#2005](https://github.com/adaptlearning/adapt_authoring/issues/2005))
- Plugin upload failed modal should be more descriptive ([#2444](https://github.com/adaptlearning/adapt_authoring/issues/2444))

## [0.10.0] - 2019-08-29

Adds ability to import courses with an older framework version, and latest bugfixes.
Expand Down Expand Up @@ -640,6 +659,7 @@ Initial release.
- Loading screen of death
- Session cookie security issues

[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
[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
Expand Down
64 changes: 48 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"merge-json": {
en: {
src: [
'routes/lang/en-application.json',
'frontend/src/**/lang/en.json'
],
dest: 'routes/lang/en.json'
'generate-lang-json': {
options: {
langFileExt: '.json',
src: {
backend: 'routes/lang',
frontend: 'frontend/src/**/lang'
},
dest: 'temp/lang'
}
},
copy: {
Expand Down Expand Up @@ -87,13 +88,17 @@ module.exports = function(grunt) {
partialRegex: /^part_/,
partialsPathRegex: /\/partials\//
},
files: {
"frontend/src/templates/templates.js": [
"frontend/src/core/**/*.hbs",
"frontend/src/modules/**/*.hbs",
"frontend/src/plugins/**/*.hbs"
]
}
files: [
{
follow: true,
src: [
'frontend/src/core/**/*.hbs',
'frontend/src/modules/**/*.hbs',
'frontend/src/plugins/**/*.hbs'
],
dest: 'frontend/src/templates/templates.js'
}
]
}
},
requirejs: {
Expand Down Expand Up @@ -217,7 +222,10 @@ module.exports = function(grunt) {
var ret = '';

for (var i = 0, l = src.length; i < l; i++) {
grunt.file.expand({ filter: options.filter }, src[i]).forEach(function(lessPath) {
grunt.file.expand({
filter: options.filter,
follow: true
}, src[i]).forEach(function(lessPath) {
ret += '@import \'' + path.normalize(lessPath) + '\';\n';
});
}
Expand Down Expand Up @@ -262,6 +270,30 @@ module.exports = function(grunt) {
done();
}
});
grunt.registerTask('generate-lang-json', function() {
const fs = require('fs-extra');
const path = require('path');

const options = this.options();
const backendGlob = path.join(options.src.backend, `*${options.langFileExt}`);
const dest = options.dest;
// load each route lang file
/**
* NOTE there must be a file in routes/lang for the language to be loaded,
* won't work if you've only got lang files in frontend
*/
grunt.file.expand({}, path.join(backendGlob)).forEach(backendPath => {
const basename = path.basename(backendPath);
const frontendGlob = path.join(options.src.frontend, basename);
let data = { ...fs.readJSONSync(backendPath) };
// load all matching frontend lang files
grunt.file.expand({}, frontendGlob).forEach(frontendPath => {
data = { ...data, ...fs.readJSONSync(frontendPath) };
});
fs.ensureDirSync(dest);
fs.writeJSONSync(path.join(dest, basename), data, { spaces: 2 });
});
});

grunt.registerTask('default', ['build:dev']);
grunt.registerTask('test', ['mochaTest']);
Expand All @@ -283,7 +315,7 @@ module.exports = function(grunt) {
config.isProduction = isProduction;
grunt.file.write(configFile, JSON.stringify(config, null, 2));
// run the task
grunt.task.run(['migration-conf', 'requireBundle', 'merge-json', 'copy', 'less:' + compilation, 'handlebars', 'requirejs:'+ compilation]);
grunt.task.run(['migration-conf', 'requireBundle', 'generate-lang-json', 'copy', 'less:' + compilation, 'handlebars', 'requirejs:'+ compilation]);

} catch(e) {
grunt.task.run(['requireBundle', 'copy', 'less:' + compilation, 'handlebars', 'requirejs:' + compilation]);
Expand Down
27 changes: 21 additions & 6 deletions frontend/src/core/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,6 @@ define(function(require){
return new Handlebars.SafeString(html + '</ul>');
},

decodeHTML: function(html) {
var el = document.createElement('div');
el.innerHTML = html;
return el.childNodes.length === 0 ? "" : el.childNodes[0].nodeValue;
},

ifHasPermissions: function(permissions, block) {
var hasPermission = Origin.permissions.hasPermissions(permissions.split(','));
return hasPermission ? block.fn(this) : block.inverse(this);
Expand Down Expand Up @@ -342,6 +336,27 @@ define(function(require){
'<span class="max-fileupload-size">',
Origin.l10n.t('app.maxfileuploadsize', {size: Origin.constants.humanMaxFileUploadSize}),
'</span>'].join(''))
},

flattenNestedProperties: function(properties) {
if (!properties) return {};
var flatProperties = {};
for (var key in properties) {
// Check for nested properties
if (typeof properties[key] === 'object') {
for (var innerKey in properties[key]) {
// Check if key already exists
if (flatProperties[innerKey]) {
flatProperties[key+'.'+innerKey] = properties[key][innerKey];
} else {
flatProperties[innerKey] = properties[key][innerKey];
}
}
} else {
flatProperties[key] = properties[key];
}
}
return flatProperties;
}
};

Expand Down
Loading

0 comments on commit 650cece

Please sign in to comment.