Commit 9aa92494de573bfec4185afeaa474196808dfab0

Authored by Cyril Mougel
2 parents 78b99e77 85450715
Exists in master and in 1 other branch production

Merge pull request #619 from soberstadt/619-handle-app-version-value

Handle App Version Value
app/models/notice.rb
... ... @@ -119,6 +119,12 @@ class Notice
119 119 end
120 120 end
121 121  
  122 + def app_version
  123 + if server_environment
  124 + server_environment['app-version'] || ''
  125 + end
  126 + end
  127 +
122 128 protected
123 129  
124 130 def decrease_counter_cache
... ...
app/views/notices/_summary.html.haml
... ... @@ -25,9 +25,14 @@
25 25 %tr
26 26 %th Tenant
27 27 %td= tenant_graph(problem)
28   - %tr
29   - %th App Server
30   - %td= notice.server_environment && notice.server_environment["hostname"]
  28 + - if notice.server_environment && notice.server_environment["hostname"]
  29 + %tr
  30 + %th App Server
  31 + %td= notice.server_environment && notice.server_environment["hostname"]
  32 + - if notice.app_version.present?
  33 + %tr
  34 + %th App Version
  35 + %td= notice.app_version
31 36 - if notice.framework
32 37 %tr
33 38 %th Framework
... ...
public/javascripts/notifier.js
... ... @@ -514,6 +514,7 @@ printStackTrace.implementation.prototype = {
514 514 '<server-environment>' +
515 515 '<project-root>{project_root}</project-root>' +
516 516 '<environment-name>{environment}</environment-name>' +
  517 + '<app-version>{appVersion}</app-version>' +
517 518 '</server-environment>' +
518 519 '<current-user>' +
519 520 '<id>{user_id}</id>' +
... ... @@ -551,10 +552,11 @@ printStackTrace.implementation.prototype = {
551 552 "url": "{request_url}",
552 553 "rootDirectory": "{project_root}",
553 554 "action": "{request_action}",
  555 + "app-version": "{appVersion}",
554 556  
555   - "userId": "{user_id}",
556   - "userName": "{user_name}",
557   - "userEmail": "{user_email}",
  557 + "userId": "{user_id}",
  558 + "userName": "{user_name}",
  559 + "userEmail": "{user_email}",
558 560 },
559 561 "environment": {},
560 562 //"session": "",
... ... @@ -859,6 +861,9 @@ printStackTrace.implementation.prototype = {
859 861 stack: e.stack
860 862 });
861 863 })
  864 + }, {
  865 + variable: 'appVersion',
  866 + namespace: 'xmlData'
862 867 }
863 868 ];
864 869  
... ...