softwear-lib 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/softwear.js +157 -0
- data/app/assets/stylesheets/animate/animate.css +2752 -0
- data/app/assets/stylesheets/application.css +4 -0
- data/app/assets/stylesheets/softwear.css +11 -0
- data/app/controllers/softwear/error_reports_controller.rb +7 -0
- data/app/mailers/error_report_mailer.rb +42 -16
- data/lib/softwear/auth/emails_helper.rb +1 -0
- data/lib/softwear/engine.rb +4 -0
- data/lib/softwear/library/version.rb +1 -1
- metadata +6 -2
@@ -1,6 +1,7 @@
|
|
1
1
|
module Softwear
|
2
2
|
class ErrorReportsController < ApplicationController
|
3
3
|
skip_before_filter :authenticate_user!
|
4
|
+
before_action :assign_current_user, only: :email_report
|
4
5
|
|
5
6
|
helper Softwear::Engine.helpers do
|
6
7
|
def method_missing(name, *args, &block)
|
@@ -33,5 +34,11 @@ module Softwear
|
|
33
34
|
render inline: "<%= flash[:success] %>"
|
34
35
|
end
|
35
36
|
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def assign_current_user
|
41
|
+
@current_user = current_user rescue nil
|
42
|
+
end
|
36
43
|
end
|
37
44
|
end
|
@@ -2,36 +2,45 @@ class ErrorReportMailer < ActionMailer::Base
|
|
2
2
|
default to: 'devteam@annarbortees.com'
|
3
3
|
|
4
4
|
def send_report(user, params)
|
5
|
-
@order = Order.find_by(id: params[:order_id])
|
6
5
|
@user = user || User.find_by(id: params[:user_id])
|
6
|
+
if ["Softwear CRM", "Softwear Production"].include?(app_name)
|
7
|
+
@order = Order.find_by(id: params[:order_id])
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
if @user.nil?
|
10
|
+
from_customer = true
|
10
11
|
|
11
|
-
|
12
|
+
if @order.nil?
|
13
|
+
@user = OpenStruct.new(
|
14
|
+
email: 'unknown-user@annarbortees.com',
|
15
|
+
full_name: 'Unknown Customer'
|
16
|
+
)
|
17
|
+
else
|
18
|
+
@user = OpenStruct.new(
|
19
|
+
email: @order.email,
|
20
|
+
full_name: "(Customer) #{@order.full_name}"
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
if @user.nil?
|
12
26
|
@user = OpenStruct.new(
|
13
27
|
email: 'unknown-user@annarbortees.com',
|
14
28
|
full_name: 'Unknown Customer'
|
15
29
|
)
|
16
|
-
else
|
17
|
-
@user = OpenStruct.new(
|
18
|
-
email: @order.email,
|
19
|
-
full_name: "(Customer) #{@order.full_name}"
|
20
|
-
)
|
21
30
|
end
|
22
|
-
end
|
23
31
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
32
|
+
@error_class = params[:error_class]
|
33
|
+
@error_message = params[:error_message]
|
34
|
+
@backtrace = params[:backtrace]
|
35
|
+
@user_message = params[:user_message]
|
36
|
+
@additional_info = params[:additional_info]
|
37
|
+
end
|
29
38
|
|
30
39
|
mail(
|
31
40
|
from: from_customer ? 'customer-report@softwearcrm.com' : @user.email,
|
32
41
|
reply_to: @user.email,
|
33
42
|
to: 'devteam@annarbortees.com',
|
34
|
-
subject: "
|
43
|
+
subject: "#{app_name} Error Report from #{@user.full_name}"
|
35
44
|
)
|
36
45
|
end
|
37
46
|
|
@@ -50,4 +59,21 @@ class ErrorReportMailer < ActionMailer::Base
|
|
50
59
|
body: at.strftime("Just got a response at %I:%M%p")
|
51
60
|
)
|
52
61
|
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def app_name
|
66
|
+
case Rails.application.class.parent.to_s
|
67
|
+
when "CrmSoftwearcrmCom" then return "Softwear CRM"
|
68
|
+
when "RetailPublishing" then return "Softwear Mockbot"
|
69
|
+
when "SoftwearProduction" then return "Softwear Production"
|
70
|
+
when "SoftwearHub" then return "Softwear Hub"
|
71
|
+
when "AnnarborteesFba" then return "Softwear Fba"
|
72
|
+
when "AnnarborteesWww" then return "Ann Arbor Tees WWW"
|
73
|
+
else
|
74
|
+
return "Unknown App"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
53
78
|
end
|
79
|
+
|
data/lib/softwear/engine.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: softwear-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nigel Baillie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,6 +81,10 @@ files:
|
|
81
81
|
- LICENSE.txt
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
|
+
- app/assets/javascripts/softwear.js
|
85
|
+
- app/assets/stylesheets/animate/animate.css
|
86
|
+
- app/assets/stylesheets/application.css
|
87
|
+
- app/assets/stylesheets/softwear.css
|
84
88
|
- app/controllers/softwear/application_controller.rb
|
85
89
|
- app/controllers/softwear/error_reports_controller.rb
|
86
90
|
- app/helpers/softwear/application_helper.rb
|