diff --git a/frontend-js/src/main/js/map/data/User.js b/frontend-js/src/main/js/map/data/User.js index 38df58677378362b0ddc77c906b391216ba2b9b9..37496daa81f89c980e634036fa0724a67324baa1 100644 --- a/frontend-js/src/main/js/map/data/User.js +++ b/frontend-js/src/main/js/map/data/User.js @@ -351,6 +351,10 @@ User.prototype.update = function (user) { self.setMinColor(user.getMinColor()); self.setMaxColor(user.getMaxColor()); self.setSimpleColor(user.getSimpleColor()); + self.setNeutralColor(user.getNeutralColor()); + self.setTermsOfUseConsent(user.isTermsOfUseConsent()); + self.setLdapAccountAvailable(user.isLdapAccountAvailable()); + self.setConnectedToLdap(user.isConnectedToLdap()); return self.callListeners("onreload"); }; @@ -376,7 +380,9 @@ User.prototype.isTermsOfUseConsent = function () { * @param {boolean} ldapAccountAvailable */ User.prototype.setLdapAccountAvailable = function (ldapAccountAvailable) { - this._ldapAccountAvailable = ldapAccountAvailable; + if (ldapAccountAvailable !== undefined) { + this._ldapAccountAvailable = ldapAccountAvailable; + } }; /** @@ -392,7 +398,9 @@ User.prototype.isLdapAccountAvailable = function () { * @param {boolean} connectedToLdap */ User.prototype.setConnectedToLdap = function (connectedToLdap) { - this._connectedToLdap = connectedToLdap; + if (connectedToLdap !== undefined) { + this._connectedToLdap = connectedToLdap; + } }; /** diff --git a/frontend-js/src/test/js/map/data/User-test.js b/frontend-js/src/test/js/map/data/User-test.js index 6b432464293cb1aeaa5d02dde6326da8585ad5f3..b2870a33acf10c6b68180216fab623b914762203 100644 --- a/frontend-js/src/test/js/map/data/User-test.js +++ b/frontend-js/src/test/js/map/data/User-test.js @@ -10,7 +10,7 @@ var logger = require('../../logger'); var chai = require('chai'); var assert = chai.assert; -describe('Project', function () { +describe('User', function () { describe("constructor", function () { it("empty data", function () { var user = new User({}); @@ -20,6 +20,17 @@ describe('Project', function () { }); }); + describe("update", function () { + it("ldap account available", function () { + var user = new User({}); + assert.ok(user); + var user2 = new User({ldapAccountAvailable:true}); + user.update(user2); + assert.ok(user.isLdapAccountAvailable()); + }); + }); + + describe("setPrivilege", function () { it("non existing data", function () { var user = new User({});