Skip to content

Commit 5340ce7

Browse files
committed
Merge branch 'release/bugpatch' into issue/1715
2 parents e16b90d + bf209c6 commit 5340ce7

22 files changed

Lines changed: 368 additions & 228 deletions

File tree

Gruntfile.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ module.exports = function(grunt) {
8888
partialRegex: /^part_/,
8989
partialsPathRegex: /\/partials\//
9090
},
91-
files: {
92-
"frontend/src/templates/templates.js": [
93-
"frontend/src/core/**/*.hbs",
94-
"frontend/src/modules/**/*.hbs",
95-
"frontend/src/plugins/**/*.hbs"
96-
]
97-
}
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+
]
98102
}
99103
},
100104
requirejs: {
@@ -218,7 +222,10 @@ module.exports = function(grunt) {
218222
var ret = '';
219223

220224
for (var i = 0, l = src.length; i < l; i++) {
221-
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) {
222229
ret += '@import \'' + path.normalize(lessPath) + '\';\n';
223230
});
224231
}

frontend/src/core/helpers.js

Lines changed: 0 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);

frontend/src/libraries/handlebars.js

Lines changed: 124 additions & 62 deletions
Large diffs are not rendered by default.

frontend/src/modules/assetManagement/views/assetManagementModalView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ define(function(require) {
1616
postRender: function() {
1717
this.setupSubViews();
1818
this.setupFilterAndSearchView();
19-
if (this.options.assetType === "Asset:image" && Origin.scaffold.getCurrentModel().get('_component') === 'graphic') {
19+
if (this.options.assetType === "image" && Origin.scaffold.getCurrentModel().get('_component') === 'graphic') {
2020
this.setupImageAutofillButton();
2121
}
2222
this.resizePanels();
2323
},
2424

2525
setupSubViews: function() {
2626
this.search = {};
27-
// Replace Asset and : so we can have both filtered and all asset types
28-
var assetType = this.options.assetType.replace('Asset', '').replace(':', '');
27+
28+
var assetType = this.options.assetType;
2929

3030
if (assetType) {
3131
var filters = [assetType];

frontend/src/modules/editor/themeEditor/views/editorThemingView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,10 @@ define(function(require) {
212212
if (!fieldView) {
213213
return;
214214
}
215-
if (fieldView.schema.inputType === 'ColourPicker') {
215+
var inputType = fieldView.schema.inputType.type || fieldView.schema.inputType;
216+
if (inputType === 'ColourPicker') {
216217
fieldView.setValue(value);
217-
} else if (typeof fieldView.schema.inputType === 'string' && fieldView.schema.inputType.indexOf('Asset:') > -1) {
218+
} else if (inputType.indexOf('Asset') > -1) {
218219
fieldView.setValue(value);
219220
fieldView.render();
220221
$('div[data-editor-id*="' + key + '"]').append(fieldView.editor.$el);

frontend/src/modules/pluginManagement/views/pluginManagementUploadView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ define(function(require){
6161
Origin.Notify.alert({
6262
type: 'error',
6363
title: Origin.l10n.t('app.uploadpluginerror'),
64-
text: Helpers.decodeHTML(message)
64+
text: message
6565
});
6666
Origin.router.navigateTo('pluginManagement/upload');
6767
},

frontend/src/modules/projects/views/projectsView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ define(function(require){
133133
operators : {
134134
skip: this.fetchCount,
135135
limit: this.pageSize,
136-
sort: this.sort
136+
sort: this.sort,
137+
collation: { locale: navigator.language.substring(0, 2) }
137138
}
138139
},
139140
success: function(collection, response) {

frontend/src/modules/scaffold/views/scaffoldAssetItemView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ define([
174174

175175
Origin.trigger('modal:open', AssetManagementModalView, {
176176
collection: new AssetCollection,
177-
assetType: 'Asset:image',
177+
assetType: 'image',
178178
_shouldShowScrollbar: false,
179179
onUpdate: function(data) {
180180
if (!data) return;

frontend/src/modules/scaffold/views/scaffoldAssetView.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ define([
1010

1111
var ScaffoldAssetView = Backbone.Form.editors.Base.extend({
1212

13+
assetType: null,
14+
1315
events: {
1416
'change input': function() { this.trigger('change', this); },
1517
'focus input': function() { this.trigger('focus', this); },
@@ -52,9 +54,13 @@ define([
5254
var inputType = this.schema.inputType;
5355
var dataUrl = Helpers.isAssetExternal(this.value) ? this.value : '';
5456

57+
this.assetType = typeof inputType === 'string' ?
58+
inputType.replace(/Asset|:/g, '') :
59+
inputType.media;
60+
5561
this.$el.html(Handlebars.templates[this.constructor.template]({
5662
value: this.value,
57-
type: inputType.media || inputType.replace('Asset:', ''),
63+
type: this.assetType,
5864
url: id ? 'api/asset/serve/' + id : dataUrl,
5965
thumbUrl: id ? 'api/asset/thumb/' + id : dataUrl
6066
}));
@@ -200,7 +206,7 @@ define([
200206

201207
Origin.trigger('modal:open', AssetManagementModalView, {
202208
collection: new AssetCollection,
203-
assetType: this.schema.inputType,
209+
assetType: this.assetType,
204210
_shouldShowScrollbar: false,
205211
onUpdate: function(data) {
206212
if (!data) return;

install.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ installHelpers.checkPrimaryDependencies(function(error) {
261261
]
262262
};
263263
if(!IS_INTERACTIVE) {
264+
if (installHelpers.inputHelpers.toBoolean(optimist.argv.useJSON)) {
265+
USE_CONFIG = true;
266+
}
264267
return start();
265268
}
266269
console.log('');
@@ -282,7 +285,8 @@ installHelpers.checkPrimaryDependencies(function(error) {
282285
function generatePromptOverrides() {
283286
if(USE_CONFIG) {
284287
var configJson = require('./conf/config.json');
285-
var configData = JSON.parse(JSON.stringify(configJson).replace(/true/g, '"y"').replace(/false/g, '"n"'));
288+
var configData = JSON.parse(JSON.stringify(configJson).replace(/:true/g, ':"y"').replace(/:false/g, ':"n"'));
289+
addConfig(configData);
286290
configData.install = 'y';
287291
}
288292
const sessionSecret = USE_CONFIG && configData.sessionSecret || crypto.randomBytes(64).toString('hex');
@@ -345,7 +349,7 @@ function configureDatabase(callback) {
345349
installHelpers.getInput(inputData.database.dbConfig, function(result) {
346350
addConfig(result);
347351

348-
var isStandard = !result.useConnectionUri || USE_CONFIG && configResults.useConnectionUri !== 'y';
352+
var isStandard = !installHelpers.inputHelpers.toBoolean(result.useConnectionUri);
349353
var config = inputData.database[isStandard ? 'configureStandard' : 'configureUri'];
350354

351355
installHelpers.getInput(config, function(result) {
@@ -360,14 +364,14 @@ function configureFeatures(callback) {
360364
function smtp(cb) {
361365
installHelpers.getInput(inputData.features.smtp.confirm, function(result) {
362366
addConfig(result);
363-
if(!result.useSmtp || USE_CONFIG && configResults.useSmtp !== 'y') {
367+
if (!installHelpers.inputHelpers.toBoolean(result.useSmtp)) {
364368
return cb();
365369
}
366370
// prompt user if custom connection url or well-known-service should be used
367371
installHelpers.getInput(inputData.features.smtp.confirmConnectionUrl, function(result) {
368372
addConfig(result);
369373
var smtpConfig;
370-
if (result.useSmtpConnectionUrl === true) {
374+
if (installHelpers.inputHelpers.toBoolean(result.useSmtpConnectionUrl)) {
371375
smtpConfig = inputData.features.smtp.configure.concat(inputData.features.smtp.configureConnectionUrl);
372376
} else {
373377
smtpConfig = inputData.features.smtp.configure.concat(inputData.features.smtp.configureService);
@@ -478,7 +482,7 @@ function createSuperUser(callback) {
478482
var onError = function(error) {
479483
handleError(error, 1, 'Failed to create admin user account. Please check the console output.');
480484
};
481-
console.log(`\nNow we need to set up a 'Super Admin' account. This account can be used to manage everything on your ${app.polyglot.t('app.productname')} instance.`);
485+
console.log(`\nNow we need to set up a 'Super Admin' account. This account can be used to manage everything on your authoring tool instance.`);
482486
installHelpers.getInput(inputData.superUser, function(result) {
483487
console.log('');
484488
app.usermanager.deleteUser({ email: result.suEmail }, function(error, userRec) {

0 commit comments

Comments
 (0)