Skip to content

Commit 650cece

Browse files
Merge pull request #2454 from adaptlearning/release/bugpatch
Release 0.10.1
2 parents 4707be7 + eda41d8 commit 650cece

30 files changed

Lines changed: 511 additions & 265 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ package-lock.json
2323
/plugins/content/menu/versions/
2424
/plugins/content/bower/bowercache/
2525

26-
/routes/lang/en.json
27-
2826
/temp
2927
/test/.testcache
3028
/tmp

CHANGELOG.md

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

8+
## [0.10.1] - 2019-10-22
9+
10+
Bugfix release.
11+
12+
### Fixed
13+
- Courses dashboard: A-Z/Z-A sort is case sensitive ([#2325](https://github.com/adaptlearning/adapt_authoring/issues/2325))
14+
- Item copy can result in broken courseassets in other items ([#2347](https://github.com/adaptlearning/adapt_authoring/issues/2347))
15+
- Allow non-interactive install and upgrade scripts ([#2407](https://github.com/adaptlearning/adapt_authoring/issues/2407))
16+
- installation: missing translation key for app.productname ([#2410](https://github.com/adaptlearning/adapt_authoring/issues/2410))
17+
- Fix reading of asset type from schema ([#2416](https://github.com/adaptlearning/adapt_authoring/issues/2416))
18+
- Grunt tasks do not process symlinks ([#2428](https://github.com/adaptlearning/adapt_authoring/issues/2428))
19+
- Importing plugin with existing targetAttribute causes error when retrieving plugin schemas ([#2433](https://github.com/adaptlearning/adapt_authoring/issues/2433))
20+
- Support Node 12 ([#2437](https://github.com/adaptlearning/adapt_authoring/issues/2437))
21+
- Asset tags are not preserved on import ([#2439](https://github.com/adaptlearning/adapt_authoring/issues/2439))
22+
23+
### Added
24+
- skip-version check should be passed as cli argument ([#2005](https://github.com/adaptlearning/adapt_authoring/issues/2005))
25+
- Plugin upload failed modal should be more descriptive ([#2444](https://github.com/adaptlearning/adapt_authoring/issues/2444))
26+
827
## [0.10.0] - 2019-08-29
928

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

662+
[0.10.1]: https://github.com/adaptlearning/adapt_authoring/compare/v0.10.0...v0.10.1
643663
[0.10.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.9.0...v0.10.0
644664
[0.9.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.8.1...v0.9.0
645665
[0.8.1]: https://github.com/adaptlearning/adapt_authoring/compare/v0.8.0...v0.8.1

Gruntfile.js

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ module.exports = function(grunt) {
44
// Project configuration.
55
grunt.initConfig({
66
pkg: grunt.file.readJSON('package.json'),
7-
"merge-json": {
8-
en: {
9-
src: [
10-
'routes/lang/en-application.json',
11-
'frontend/src/**/lang/en.json'
12-
],
13-
dest: 'routes/lang/en.json'
7+
'generate-lang-json': {
8+
options: {
9+
langFileExt: '.json',
10+
src: {
11+
backend: 'routes/lang',
12+
frontend: 'frontend/src/**/lang'
13+
},
14+
dest: 'temp/lang'
1415
}
1516
},
1617
copy: {
@@ -87,13 +88,17 @@ module.exports = function(grunt) {
8788
partialRegex: /^part_/,
8889
partialsPathRegex: /\/partials\//
8990
},
90-
files: {
91-
"frontend/src/templates/templates.js": [
92-
"frontend/src/core/**/*.hbs",
93-
"frontend/src/modules/**/*.hbs",
94-
"frontend/src/plugins/**/*.hbs"
95-
]
96-
}
91+
files: [
92+
{
93+
follow: true,
94+
src: [
95+
'frontend/src/core/**/*.hbs',
96+
'frontend/src/modules/**/*.hbs',
97+
'frontend/src/plugins/**/*.hbs'
98+
],
99+
dest: 'frontend/src/templates/templates.js'
100+
}
101+
]
97102
}
98103
},
99104
requirejs: {
@@ -217,7 +222,10 @@ module.exports = function(grunt) {
217222
var ret = '';
218223

219224
for (var i = 0, l = src.length; i < l; i++) {
220-
grunt.file.expand({ filter: options.filter }, src[i]).forEach(function(lessPath) {
225+
grunt.file.expand({
226+
filter: options.filter,
227+
follow: true
228+
}, src[i]).forEach(function(lessPath) {
221229
ret += '@import \'' + path.normalize(lessPath) + '\';\n';
222230
});
223231
}
@@ -262,6 +270,30 @@ module.exports = function(grunt) {
262270
done();
263271
}
264272
});
273+
grunt.registerTask('generate-lang-json', function() {
274+
const fs = require('fs-extra');
275+
const path = require('path');
276+
277+
const options = this.options();
278+
const backendGlob = path.join(options.src.backend, `*${options.langFileExt}`);
279+
const dest = options.dest;
280+
// load each route lang file
281+
/**
282+
* NOTE there must be a file in routes/lang for the language to be loaded,
283+
* won't work if you've only got lang files in frontend
284+
*/
285+
grunt.file.expand({}, path.join(backendGlob)).forEach(backendPath => {
286+
const basename = path.basename(backendPath);
287+
const frontendGlob = path.join(options.src.frontend, basename);
288+
let data = { ...fs.readJSONSync(backendPath) };
289+
// load all matching frontend lang files
290+
grunt.file.expand({}, frontendGlob).forEach(frontendPath => {
291+
data = { ...data, ...fs.readJSONSync(frontendPath) };
292+
});
293+
fs.ensureDirSync(dest);
294+
fs.writeJSONSync(path.join(dest, basename), data, { spaces: 2 });
295+
});
296+
});
265297

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

288320
} catch(e) {
289321
grunt.task.run(['requireBundle', 'copy', 'less:' + compilation, 'handlebars', 'requirejs:' + compilation]);

frontend/src/core/helpers.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ define(function(require){
172172
return new Handlebars.SafeString(html + '</ul>');
173173
},
174174

175-
decodeHTML: function(html) {
176-
var el = document.createElement('div');
177-
el.innerHTML = html;
178-
return el.childNodes.length === 0 ? "" : el.childNodes[0].nodeValue;
179-
},
180-
181175
ifHasPermissions: function(permissions, block) {
182176
var hasPermission = Origin.permissions.hasPermissions(permissions.split(','));
183177
return hasPermission ? block.fn(this) : block.inverse(this);
@@ -342,6 +336,27 @@ define(function(require){
342336
'<span class="max-fileupload-size">',
343337
Origin.l10n.t('app.maxfileuploadsize', {size: Origin.constants.humanMaxFileUploadSize}),
344338
'</span>'].join(''))
339+
},
340+
341+
flattenNestedProperties: function(properties) {
342+
if (!properties) return {};
343+
var flatProperties = {};
344+
for (var key in properties) {
345+
// Check for nested properties
346+
if (typeof properties[key] === 'object') {
347+
for (var innerKey in properties[key]) {
348+
// Check if key already exists
349+
if (flatProperties[innerKey]) {
350+
flatProperties[key+'.'+innerKey] = properties[key][innerKey];
351+
} else {
352+
flatProperties[innerKey] = properties[key][innerKey];
353+
}
354+
}
355+
} else {
356+
flatProperties[key] = properties[key];
357+
}
358+
}
359+
return flatProperties;
345360
}
346361
};
347362

0 commit comments

Comments
 (0)