Commit 1a5ac73611f82987b110b8518189f33617e08700

Authored by Cyril Mougel
2 parents 4442a477 3a0066d3
Exists in master and in 1 other branch production

Merge pull request #524 from roryf/master

Adds current user information to notifier.js
Showing 1 changed file with 17 additions and 3 deletions   Show diff stats
public/javascripts/notifier.js
@@ -515,6 +515,11 @@ printStackTrace.implementation.prototype = { @@ -515,6 +515,11 @@ printStackTrace.implementation.prototype = {
515 '<project-root>{project_root}</project-root>' + 515 '<project-root>{project_root}</project-root>' +
516 '<environment-name>{environment}</environment-name>' + 516 '<environment-name>{environment}</environment-name>' +
517 '</server-environment>' + 517 '</server-environment>' +
  518 + '<current-user>' +
  519 + '<id>{user_id}</id>' +
  520 + '<name>{user_name}</name>' +
  521 + '<email>{user_email}</email>' +
  522 + '</current-user>' +
518 '</notice>', 523 '</notice>',
519 REQUEST_VARIABLE_GROUP_XML = '<{group_name}>{inner_content}</{group_name}>', 524 REQUEST_VARIABLE_GROUP_XML = '<{group_name}>{inner_content}</{group_name}>',
520 REQUEST_VARIABLE_XML = '<var key="{key}">{value}</var>', 525 REQUEST_VARIABLE_XML = '<var key="{key}">{value}</var>',
@@ -547,9 +552,9 @@ printStackTrace.implementation.prototype = { @@ -547,9 +552,9 @@ printStackTrace.implementation.prototype = {
547 "rootDirectory": "{project_root}", 552 "rootDirectory": "{project_root}",
548 "action": "{request_action}", 553 "action": "{request_action}",
549 554
550 - "userId": "{}",  
551 - "userName": "{}",  
552 - "userEmail": "{}", 555 + "userId": "{user_id}",
  556 + "userName": "{user_name}",
  557 + "userEmail": "{user_email}",
553 }, 558 },
554 "environment": {}, 559 "environment": {},
555 //"session": "", 560 //"session": "",
@@ -819,6 +824,15 @@ printStackTrace.implementation.prototype = { @@ -819,6 +824,15 @@ printStackTrace.implementation.prototype = {
819 variable: 'outputFormat', 824 variable: 'outputFormat',
820 namespace: 'options' 825 namespace: 'options'
821 }, { 826 }, {
  827 + methodName: 'setCurrentUser',
  828 + method: (function (value) {
  829 + for (var key in value) {
  830 + if (value.hasOwnProperty(key)) {
  831 + Config.xmlData['user_' + key] = value[key];
  832 + }
  833 + }
  834 + })
  835 + }, {
822 methodName: 'setTrackJQ', 836 methodName: 'setTrackJQ',
823 variable: 'trackJQ', 837 variable: 'trackJQ',
824 namespace: 'options', 838 namespace: 'options',