Skip to content

Commit

Permalink
Merge branch 'develop' into issue/1116
Browse files Browse the repository at this point in the history
* develop: (94 commits)
  update archive dependecy
  Fixes: #1928
  Fix and refactor helper
  update
  Check if user is course owner
  Require modules before plugins
  Change to ensureDirSync
  refactor to set scrollTop after all animations are completed
  hook into transition end event instead of post render
  Fixes #1906
  Allow MongoDB authentication in install script
  Fix modules define
  Fix globalData
  Make sure we load the plugin
  Fix issue with merge
  Save isVisible and isHidden on blocks and components
  Fix context menu for page
  Move plugin folder to modules
  Refactor for readability
  Update comments
  ...

# Conflicts:
#	plugins/output/adapt/index.js
  • Loading branch information
taylortom committed Apr 6, 2018
2 parents 6e1a45f + b92c928 commit 7a36411
Show file tree
Hide file tree
Showing 72 changed files with 2,653 additions and 2,722 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ All notable changes to the Adapt authoring tool are documented in this file.

_Note that we adhere to the [semantic versioning](http://semver.org/) scheme for release numbering._

## [0.4.1] - 2018-02-05

This is a patch release fixing issues introduced in v0.4.0.

### Fixed
- Major performance fix for large installs ([\#1758](https://github.com/adaptlearning/adapt_authoring/issues/1758))
- Various minor fixes for install and upgrade scripts ([\#1749](https://github.com/adaptlearning/adapt_authoring/issues/1749), [\#1760](https://github.com/adaptlearning/adapt_authoring/issues/1760), [\#1763](https://github.com/adaptlearning/adapt_authoring/issues/1763), [\#1797](https://github.com/adaptlearning/adapt_authoring/issues/1797), [\#1838](https://github.com/adaptlearning/adapt_authoring/issues/1838), [\#1842](https://github.com/adaptlearning/adapt_authoring/issues/1842))
- Dashboard paging fixed ([\#1759](https://github.com/adaptlearning/adapt_authoring/issues/1759))
- Asset management paging fixed ([\#1790](https://github.com/adaptlearning/adapt_authoring/issues/1790))
- Fixed issue whereby the page editor screen would occasionally render the same block twice ([\#1834](https://github.com/adaptlearning/adapt_authoring/issues/1834))
- Asset preview image has been fixed for contrib-media video assets ([\#1835](https://github.com/adaptlearning/adapt_authoring/issues/1835))
- Fixed menu editor rendering quirks ([\#1837](https://github.com/adaptlearning/adapt_authoring/issues/1837))

## [0.4.0] - 2017-10-17

Major refactor of the front-end application.
Expand Down Expand Up @@ -379,6 +392,7 @@ Initial release.
- Loading screen of death
- Session cookie security issues

[0.4.1]: https://github.com/adaptlearning/adapt_authoring/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/adaptlearning/adapt_authoring/compare/v0.2.2...v0.3.0
[0.2.2]: https://github.com/adaptlearning/adapt_authoring/compare/v0.2.1...v0.2.2
Expand Down
12 changes: 5 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function(grunt) {
{
expand: true,
flatten: true,
src: ['frontend/src/core/libraries/ace/**/*'],
src: ['frontend/src/libraries/ace/*'],
dest: 'frontend/build/js/ace'
}
]
Expand Down Expand Up @@ -260,23 +260,21 @@ module.exports = function(grunt) {

// Compiles frontend plugins
grunt.registerMultiTask('requireBundle', 'Generates a .js file with a bunch of imports for the path files', function() {
var requirePaths = '';
var modulePaths = '';
// Go through each subfolder in the plugins directory
var foldersArray = grunt.file.expand({ filter: "isDirectory" }, this.data.src);
// Check if any plugins are available
if (foldersArray.length === 0) {
requirePaths += "'";
modulePaths += "'";
}
foldersArray.forEach(function(path, index, folders) {
// Strip off front of path to make relative path to config file
var relativePath = path.replace(grunt.config.get('requirejs').dev.options.baseUrl, '').slice(1);
var splitter = "','";
if (index === folders.length - 1) splitter = "'";
requirePaths += relativePath + '/index' + splitter;
modulePaths += relativePath + '/index' + splitter;
});

var defineStatement = "define('" + this.target + "',['" + requirePaths +"]);";
grunt.file.write(this.data.dest, defineStatement);
grunt.file.write(this.data.dest, "define(['" + modulePaths +"], function() {});");
});

grunt.registerMultiTask('less', 'Compile Less files to CSS', function() {
Expand Down
22 changes: 0 additions & 22 deletions conf/config-sample.json

This file was deleted.

50 changes: 17 additions & 33 deletions frontend/src/core/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,46 +43,30 @@
});
}

function loadAddOns(callback) {
/*
* FIXME we want to just be able to require these
* (this doesn't work in production mode)
*/
// ['modules/modules','plugins/plugins']
function loadModules(callback) {
require([
// modules
'modules/actions/index',
'modules/assetManagement/index',
'modules/contentPane/index',
'modules/contextMenu/index',
'modules/editor/index',
'modules/filters/index',
'modules/globalMenu/index',
'modules/help/index',
'modules/location/index',
'modules/modal/index',
'modules/navigation/index',
'modules/notify/index',
'modules/options/index',
'modules/pluginManagement/index',
'modules/projects/index',
'modules/scaffold/index',
'modules/sidebar/index',
'modules/user/index',
'modules/userManagement/index',
'modules/modules'
], callback);
}

function loadPlugins(callback) {
require([
'plugins/plugins'
], callback);
}

/**
* Start app load
*/
* Start app load
*/
loadLibraries(function() {
loadCore(function() {
loadAddOns(function() {
// start session
// FIXME required here to avoid errors
require(['modules/user/models/sessionModel'], function(SessionModel) {
origin.startSession(new SessionModel());
loadModules(function() {
loadPlugins(function() {
// start session
// FIXME required here to avoid errors
require(['modules/user/models/sessionModel'], function(SessionModel) {
origin.startSession(new SessionModel());
});
});
});
});
Expand Down
35 changes: 35 additions & 0 deletions frontend/src/core/collections/contentCollection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// LICENCE https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE
define(function(require) {
var Backbone = require('backbone');
var Origin = require('core/origin');
var Helpers = require('core/helpers');

var ContentCollection = Backbone.Collection.extend({
initialize : function(models, options) {
this._type = options._type;
this.model = Helpers.contentModelMap(this._type);
this._courseId = options._courseId;
this._parentId = options._parentId;
this.url = options.url || 'api/content/' + options._type + this.buildQuery();

this.on('reset', this.loadedData, this);
},

buildQuery: function() {
var query = '';
if(this._courseId) {
query += '_courseId=' + this._courseId
}
if(this._parentId) {
query += '_parentId=' + this._parentId
}
return query ? '?' + query : '';
},

loadedData: function() {
Origin.trigger('contentCollection:dataLoaded', this._type);
}
});

return ContentCollection;
});
Loading

0 comments on commit 7a36411

Please sign in to comment.