diff --git a/dashboard/public/js/client.js b/dashboard/public/js/client.js index 672b4ddbf..dee880ec8 100644 --- a/dashboard/public/js/client.js +++ b/dashboard/public/js/client.js @@ -681,7 +681,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout source: null, avatarUrl: null, avatarType: null, - hasBackgroundImage: false + hasBackgroundImage: false, + notificationConfig: [] }; this._config = { consoleServerOrigin: null, @@ -813,6 +814,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout this._userInfo.avatarUrl = userInfo.avatarUrl + '?ts=' + Date.now(); // we add the timestamp to avoid caching this._userInfo.avatarType = userInfo.avatarType; this._userInfo.hasBackgroundImage = userInfo.hasBackgroundImage; + this._userInfo.notificationConfig = userInfo.notificationConfig; this._userInfo.isAtLeastOwner = [ ROLES.OWNER ].indexOf(userInfo.role) !== -1; this._userInfo.isAtLeastAdmin = [ ROLES.OWNER, ROLES.ADMIN ].indexOf(userInfo.role) !== -1; this._userInfo.isAtLeastMailManager = [ ROLES.OWNER, ROLES.ADMIN, ROLES.MAIL_MANAGER ].indexOf(userInfo.role) !== -1; @@ -2457,6 +2459,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; + Client.prototype.setNotificationConfig = function (notificationConfig, callback) { + post('/api/v1/profile/notification_config', { notificationConfig }, null, function (error, data, status) { + if (error) return callback(error); + if (status !== 204) return callback(new ClientError(status, data)); + + callback(null, data); + }); + }; + Client.prototype.setProfileEmail = function (email, password, callback) { post('/api/v1/profile/email', { email: email, password: password }, null, function (error, data, status) { if (error) return callback(error); diff --git a/dashboard/public/views/notifications.html b/dashboard/public/views/notifications.html index bf2ffb05b..7cc50b14c 100644 --- a/dashboard/public/views/notifications.html +++ b/dashboard/public/views/notifications.html @@ -1,8 +1,37 @@ + +