Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 2.3 into master #4462

Merged
merged 8 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 16 additions & 24 deletions buildtools/compile-catalog.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
"use strict";
let fs = require('fs');
let options = require('commander');
let Compiler = require('angular-gettext-tools').Compiler;
const fs = require('fs');
const options = require('commander');
const Compiler = require('angular-gettext-tools').Compiler;

function main(inputs) {
let compiler = new Compiler({format: 'json'});
const compiler = new Compiler({format: 'json'});

let contents = [];
inputs.forEach(function(input) {
// ignore un existing files
fs.exists(input, function(exists) {
if (exists) {
fs.readFile(input, {encoding: 'utf-8'}, function(err, content) {
if (!err) {
contents.push(content);
if (contents.length === inputs.length) {
process.stdout.write(compiler.convertPo(contents.filter(function (content) {
return content.length !== 0;
})));
}
}
});
}
else {
contents.push("")
}
});
const promises = [];
inputs.forEach((input) => {
promises.push(new Promise((resolve) => {
fs.readFile(input, 'utf-8', (error, content) => {
resolve(error ? undefined : content);
});
}));
});

Promise.all(promises).then((contents) => {
contents = contents.filter(content => content !== undefined);
process.stdout.write(compiler.convertPo(contents));
});
}

Expand Down
39 changes: 18 additions & 21 deletions buildtools/extract-messages.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
"use strict";
let async = require('async');
let fs = require('fs');
let path = require('path');
let options = require('commander');
let Extractor = require('angular-gettext-tools').Extractor;
const fs = require('fs');
const options = require('commander');
const Extractor = require('angular-gettext-tools').Extractor;

function main(inputs) {
let extractor = new Extractor();
const extractor = new Extractor();

async.eachSeries(inputs,
function(input, cb) {
fs.readFile(input, {encoding: 'utf-8'}, function(err, data) {
if (!err) {
extractor.parse(input, data);
}
cb(err);
const promises = [];
inputs.forEach((input) => {
promises.push(new Promise((resolve) => {
fs.readFile(input, 'utf-8', (error, content) => {
resolve(error ? undefined : {input, content});
});
},
function(err) {
if (err) {
throw new Error(err);
}
process.stdout.write(extractor.toString());
}
);
}));
});

Promise.all(promises).then((contents) => {
contents = contents.filter(content => content !== undefined);
contents.forEach(({input, content}) => extractor.parse(input, content));

process.stdout.write(extractor.toString());
});
}

// If running this module directly then call the main function.
Expand Down
3 changes: 1 addition & 2 deletions contribs/gmf/src/authentication/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ const exports = class extends olEventsEventTarget {
withCredentials: true
}).then(((response) => {
this.user_.is_password_changed = true;
this.$rootScope_.$digest();
}).bind(this));
}));
}

/**
Expand Down
11 changes: 6 additions & 5 deletions contribs/gmf/src/authentication/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,14 @@ class AuthenticationController {
this.setError_(errors);
} else {
// Send request with current credentials, which may fail if the old password given is incorrect.
const error = gettextCatalog.getString('Incorrect old password.');
this.gmfAuthenticationService_.changePassword(oldPwd, newPwd, confPwd).then(
() => {
this.gmfAuthenticationService_.changePassword(oldPwd, newPwd, confPwd)
.then(() => {
this.changePasswordModalShown = true;
this.changePasswordReset();
},
this.setError_.bind(this, error));
})
.catch((err) => {
this.setError_(gettextCatalog.getString('Incorrect old password.'));
});
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/filters/filterselectorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class Controller {
);

// Manage the data sources that are already in the collection
this.gmfDataSources_.forEach(this.registerDataSource_, this);
this.gmfDataSources_.forEach(this.registerDataSource_.bind(this));

} else {
keys.forEach(olEvents.unlistenByKey);
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"angular-touch": "1.7.5",
"angular-ui-date": "1.1.1",
"angular-ui-slider": "0.4.0",
"async": "2.6.1",
"babel-loader": "8.0.3",
"bootstrap": "4.1.3",
"co": "4.6.0",
Expand Down