lsa_tdx_feedback 1.0.0
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 +7 -0
- data/.rspec +3 -0
- data/CHANGELOG.md +49 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +328 -0
- data/INSTALLATION.md +244 -0
- data/LICENSE.txt +21 -0
- data/README.md +391 -0
- data/Rakefile +10 -0
- data/app/assets/javascripts/lsa_tdx_feedback.js +231 -0
- data/app/assets/stylesheets/lsa_tdx_feedback.css +279 -0
- data/app/controllers/lsa_tdx_feedback/feedback_controller.rb +71 -0
- data/app/views/lsa_tdx_feedback/shared/_feedback_modal.html.erb +95 -0
- data/config/routes.rb +3 -0
- data/example_application_tests.rb +0 -0
- data/lib/lsa_tdx_feedback/application_controller_extensions.rb +52 -0
- data/lib/lsa_tdx_feedback/configuration.rb +89 -0
- data/lib/lsa_tdx_feedback/engine.rb +65 -0
- data/lib/lsa_tdx_feedback/oauth_client.rb +81 -0
- data/lib/lsa_tdx_feedback/ticket_client.rb +106 -0
- data/lib/lsa_tdx_feedback/version.rb +3 -0
- data/lib/lsa_tdx_feedback/view_helpers.rb +37 -0
- data/lib/lsa_tdx_feedback.rb +31 -0
- metadata +223 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 5896d4658c9650d7701c7d01749c6711ce587e96c24359e782ff9c0389a2519c
|
|
4
|
+
data.tar.gz: 939f0bf40ef322b8f2476a7ec7b2a5c352a7cfdfee4f56529a7d6c2b9e779515
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fff2fe97da072eb680cfaad57ada3ab31875424005fc9e85c90c664b5802e2d0be4145649b7bb6cea8d68eae1ae4fcd0626aa0146a8a05119492e4e7abf82a1f
|
|
7
|
+
data.tar.gz: 785ff50bf9f04c511bbaf223212986ee98c6861b196b4a1ab22c9de8ebc5b2050231c728aa18bf6b86cba68f28eb409f77f750ad8d260538e01c4d02f1fab4be
|
data/.rspec
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **TDX API Integration Issues**: Resolved HTTP 422 errors when creating tickets
|
|
12
|
+
- Fixed invalid Classification value (changed from 300 to 46)
|
|
13
|
+
- Updated configuration validation to handle both string and integer values for `default_classification`
|
|
14
|
+
- Simplified ticket payload structure to include only essential fields
|
|
15
|
+
- Fixed string interpolation in `build_description` method
|
|
16
|
+
- Changed description format from HTML to plain text to avoid parsing issues
|
|
17
|
+
- Removed unnecessary fields that were causing 500 errors
|
|
18
|
+
|
|
19
|
+
### Technical Improvements
|
|
20
|
+
- Enhanced configuration validation for better error handling
|
|
21
|
+
- Streamlined ticket payload to include only required TDX API fields:
|
|
22
|
+
- TypeID, Classification, Title, Description
|
|
23
|
+
- RequestorEmail, SourceID, ServiceID
|
|
24
|
+
- ResponsibleGroupID, AccountID
|
|
25
|
+
- Improved error handling and debugging capabilities
|
|
26
|
+
|
|
27
|
+
## [0.1.0] - 2024-01-XX
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Initial release of FeedbackGem
|
|
31
|
+
- Self-contained feedback modal with responsive design
|
|
32
|
+
- TDX API integration for ticket creation
|
|
33
|
+
- OAuth client credentials flow authentication
|
|
34
|
+
- Zero-configuration setup with Rails credentials support
|
|
35
|
+
- Automatic context capture (URL, user agent, user email)
|
|
36
|
+
- Smart token caching for optimal performance
|
|
37
|
+
- Mobile-responsive design
|
|
38
|
+
- Framework-agnostic CSS and JavaScript
|
|
39
|
+
- Comprehensive documentation and examples
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
- Beautiful, accessible feedback modal
|
|
43
|
+
- Multiple feedback categories with automatic priority mapping
|
|
44
|
+
- Real-time form validation and submission
|
|
45
|
+
- Loading states and error handling
|
|
46
|
+
- Keyboard navigation support (ESC to close)
|
|
47
|
+
- CSRF protection for secure form submission
|
|
48
|
+
- Automatic asset pipeline integration
|
|
49
|
+
- View helpers for easy integration
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
lsa_tdx_feedback (1.0.0)
|
|
5
|
+
httparty (~> 0.22)
|
|
6
|
+
rails (>= 6.0)
|
|
7
|
+
redis (>= 4.0)
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
actioncable (8.0.2.1)
|
|
13
|
+
actionpack (= 8.0.2.1)
|
|
14
|
+
activesupport (= 8.0.2.1)
|
|
15
|
+
nio4r (~> 2.0)
|
|
16
|
+
websocket-driver (>= 0.6.1)
|
|
17
|
+
zeitwerk (~> 2.6)
|
|
18
|
+
actionmailbox (8.0.2.1)
|
|
19
|
+
actionpack (= 8.0.2.1)
|
|
20
|
+
activejob (= 8.0.2.1)
|
|
21
|
+
activerecord (= 8.0.2.1)
|
|
22
|
+
activestorage (= 8.0.2.1)
|
|
23
|
+
activesupport (= 8.0.2.1)
|
|
24
|
+
mail (>= 2.8.0)
|
|
25
|
+
actionmailer (8.0.2.1)
|
|
26
|
+
actionpack (= 8.0.2.1)
|
|
27
|
+
actionview (= 8.0.2.1)
|
|
28
|
+
activejob (= 8.0.2.1)
|
|
29
|
+
activesupport (= 8.0.2.1)
|
|
30
|
+
mail (>= 2.8.0)
|
|
31
|
+
rails-dom-testing (~> 2.2)
|
|
32
|
+
actionpack (8.0.2.1)
|
|
33
|
+
actionview (= 8.0.2.1)
|
|
34
|
+
activesupport (= 8.0.2.1)
|
|
35
|
+
nokogiri (>= 1.8.5)
|
|
36
|
+
rack (>= 2.2.4)
|
|
37
|
+
rack-session (>= 1.0.1)
|
|
38
|
+
rack-test (>= 0.6.3)
|
|
39
|
+
rails-dom-testing (~> 2.2)
|
|
40
|
+
rails-html-sanitizer (~> 1.6)
|
|
41
|
+
useragent (~> 0.16)
|
|
42
|
+
actiontext (8.0.2.1)
|
|
43
|
+
actionpack (= 8.0.2.1)
|
|
44
|
+
activerecord (= 8.0.2.1)
|
|
45
|
+
activestorage (= 8.0.2.1)
|
|
46
|
+
activesupport (= 8.0.2.1)
|
|
47
|
+
globalid (>= 0.6.0)
|
|
48
|
+
nokogiri (>= 1.8.5)
|
|
49
|
+
actionview (8.0.2.1)
|
|
50
|
+
activesupport (= 8.0.2.1)
|
|
51
|
+
builder (~> 3.1)
|
|
52
|
+
erubi (~> 1.11)
|
|
53
|
+
rails-dom-testing (~> 2.2)
|
|
54
|
+
rails-html-sanitizer (~> 1.6)
|
|
55
|
+
activejob (8.0.2.1)
|
|
56
|
+
activesupport (= 8.0.2.1)
|
|
57
|
+
globalid (>= 0.3.6)
|
|
58
|
+
activemodel (8.0.2.1)
|
|
59
|
+
activesupport (= 8.0.2.1)
|
|
60
|
+
activerecord (8.0.2.1)
|
|
61
|
+
activemodel (= 8.0.2.1)
|
|
62
|
+
activesupport (= 8.0.2.1)
|
|
63
|
+
timeout (>= 0.4.0)
|
|
64
|
+
activestorage (8.0.2.1)
|
|
65
|
+
actionpack (= 8.0.2.1)
|
|
66
|
+
activejob (= 8.0.2.1)
|
|
67
|
+
activerecord (= 8.0.2.1)
|
|
68
|
+
activesupport (= 8.0.2.1)
|
|
69
|
+
marcel (~> 1.0)
|
|
70
|
+
activesupport (8.0.2.1)
|
|
71
|
+
base64
|
|
72
|
+
benchmark (>= 0.3)
|
|
73
|
+
bigdecimal
|
|
74
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
75
|
+
connection_pool (>= 2.2.5)
|
|
76
|
+
drb
|
|
77
|
+
i18n (>= 1.6, < 2)
|
|
78
|
+
logger (>= 1.4.2)
|
|
79
|
+
minitest (>= 5.1)
|
|
80
|
+
securerandom (>= 0.3)
|
|
81
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
82
|
+
uri (>= 0.13.1)
|
|
83
|
+
addressable (2.8.7)
|
|
84
|
+
public_suffix (>= 2.0.2, < 7.0)
|
|
85
|
+
ast (2.4.3)
|
|
86
|
+
base64 (0.3.0)
|
|
87
|
+
benchmark (0.4.1)
|
|
88
|
+
bigdecimal (3.2.3)
|
|
89
|
+
builder (3.3.0)
|
|
90
|
+
concurrent-ruby (1.3.5)
|
|
91
|
+
connection_pool (2.5.4)
|
|
92
|
+
crack (1.0.0)
|
|
93
|
+
bigdecimal
|
|
94
|
+
rexml
|
|
95
|
+
crass (1.0.6)
|
|
96
|
+
csv (3.3.5)
|
|
97
|
+
date (3.4.1)
|
|
98
|
+
diff-lcs (1.6.2)
|
|
99
|
+
drb (2.2.3)
|
|
100
|
+
erb (5.0.2)
|
|
101
|
+
erubi (1.13.1)
|
|
102
|
+
factory_bot (6.5.5)
|
|
103
|
+
activesupport (>= 6.1.0)
|
|
104
|
+
factory_bot_rails (6.5.1)
|
|
105
|
+
factory_bot (~> 6.5)
|
|
106
|
+
railties (>= 6.1.0)
|
|
107
|
+
globalid (1.2.1)
|
|
108
|
+
activesupport (>= 6.1)
|
|
109
|
+
hashdiff (1.2.1)
|
|
110
|
+
httparty (0.23.1)
|
|
111
|
+
csv
|
|
112
|
+
mini_mime (>= 1.0.0)
|
|
113
|
+
multi_xml (>= 0.5.2)
|
|
114
|
+
i18n (1.14.7)
|
|
115
|
+
concurrent-ruby (~> 1.0)
|
|
116
|
+
io-console (0.8.1)
|
|
117
|
+
irb (1.15.2)
|
|
118
|
+
pp (>= 0.6.0)
|
|
119
|
+
rdoc (>= 4.0.0)
|
|
120
|
+
reline (>= 0.4.2)
|
|
121
|
+
json (2.15.0)
|
|
122
|
+
language_server-protocol (3.17.0.5)
|
|
123
|
+
lint_roller (1.1.0)
|
|
124
|
+
logger (1.7.0)
|
|
125
|
+
loofah (2.24.1)
|
|
126
|
+
crass (~> 1.0.2)
|
|
127
|
+
nokogiri (>= 1.12.0)
|
|
128
|
+
mail (2.8.1)
|
|
129
|
+
mini_mime (>= 0.1.1)
|
|
130
|
+
net-imap
|
|
131
|
+
net-pop
|
|
132
|
+
net-smtp
|
|
133
|
+
marcel (1.1.0)
|
|
134
|
+
mini_mime (1.1.5)
|
|
135
|
+
minitest (5.25.5)
|
|
136
|
+
multi_xml (0.7.2)
|
|
137
|
+
bigdecimal (~> 3.1)
|
|
138
|
+
net-imap (0.5.10)
|
|
139
|
+
date
|
|
140
|
+
net-protocol
|
|
141
|
+
net-pop (0.1.2)
|
|
142
|
+
net-protocol
|
|
143
|
+
net-protocol (0.2.2)
|
|
144
|
+
timeout
|
|
145
|
+
net-smtp (0.5.1)
|
|
146
|
+
net-protocol
|
|
147
|
+
nio4r (2.7.4)
|
|
148
|
+
nokogiri (1.18.10-aarch64-linux-gnu)
|
|
149
|
+
racc (~> 1.4)
|
|
150
|
+
nokogiri (1.18.10-aarch64-linux-musl)
|
|
151
|
+
racc (~> 1.4)
|
|
152
|
+
nokogiri (1.18.10-arm-linux-gnu)
|
|
153
|
+
racc (~> 1.4)
|
|
154
|
+
nokogiri (1.18.10-arm-linux-musl)
|
|
155
|
+
racc (~> 1.4)
|
|
156
|
+
nokogiri (1.18.10-arm64-darwin)
|
|
157
|
+
racc (~> 1.4)
|
|
158
|
+
nokogiri (1.18.10-x86_64-darwin)
|
|
159
|
+
racc (~> 1.4)
|
|
160
|
+
nokogiri (1.18.10-x86_64-linux-gnu)
|
|
161
|
+
racc (~> 1.4)
|
|
162
|
+
nokogiri (1.18.10-x86_64-linux-musl)
|
|
163
|
+
racc (~> 1.4)
|
|
164
|
+
parallel (1.27.0)
|
|
165
|
+
parser (3.3.9.0)
|
|
166
|
+
ast (~> 2.4.1)
|
|
167
|
+
racc
|
|
168
|
+
pp (0.6.2)
|
|
169
|
+
prettyprint
|
|
170
|
+
prettyprint (0.2.0)
|
|
171
|
+
prism (1.5.1)
|
|
172
|
+
psych (5.2.6)
|
|
173
|
+
date
|
|
174
|
+
stringio
|
|
175
|
+
public_suffix (6.0.2)
|
|
176
|
+
racc (1.8.1)
|
|
177
|
+
rack (3.2.1)
|
|
178
|
+
rack-session (2.1.1)
|
|
179
|
+
base64 (>= 0.1.0)
|
|
180
|
+
rack (>= 3.0.0)
|
|
181
|
+
rack-test (2.2.0)
|
|
182
|
+
rack (>= 1.3)
|
|
183
|
+
rackup (2.2.1)
|
|
184
|
+
rack (>= 3)
|
|
185
|
+
rails (8.0.2.1)
|
|
186
|
+
actioncable (= 8.0.2.1)
|
|
187
|
+
actionmailbox (= 8.0.2.1)
|
|
188
|
+
actionmailer (= 8.0.2.1)
|
|
189
|
+
actionpack (= 8.0.2.1)
|
|
190
|
+
actiontext (= 8.0.2.1)
|
|
191
|
+
actionview (= 8.0.2.1)
|
|
192
|
+
activejob (= 8.0.2.1)
|
|
193
|
+
activemodel (= 8.0.2.1)
|
|
194
|
+
activerecord (= 8.0.2.1)
|
|
195
|
+
activestorage (= 8.0.2.1)
|
|
196
|
+
activesupport (= 8.0.2.1)
|
|
197
|
+
bundler (>= 1.15.0)
|
|
198
|
+
railties (= 8.0.2.1)
|
|
199
|
+
rails-dom-testing (2.3.0)
|
|
200
|
+
activesupport (>= 5.0.0)
|
|
201
|
+
minitest
|
|
202
|
+
nokogiri (>= 1.6)
|
|
203
|
+
rails-html-sanitizer (1.6.2)
|
|
204
|
+
loofah (~> 2.21)
|
|
205
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
206
|
+
railties (8.0.2.1)
|
|
207
|
+
actionpack (= 8.0.2.1)
|
|
208
|
+
activesupport (= 8.0.2.1)
|
|
209
|
+
irb (~> 1.13)
|
|
210
|
+
rackup (>= 1.0.0)
|
|
211
|
+
rake (>= 12.2)
|
|
212
|
+
thor (~> 1.0, >= 1.2.2)
|
|
213
|
+
zeitwerk (~> 2.6)
|
|
214
|
+
rainbow (3.1.1)
|
|
215
|
+
rake (13.3.0)
|
|
216
|
+
rdoc (6.14.2)
|
|
217
|
+
erb
|
|
218
|
+
psych (>= 4.0.0)
|
|
219
|
+
redis (5.4.1)
|
|
220
|
+
redis-client (>= 0.22.0)
|
|
221
|
+
redis-client (0.25.3)
|
|
222
|
+
connection_pool
|
|
223
|
+
regexp_parser (2.11.3)
|
|
224
|
+
reline (0.6.2)
|
|
225
|
+
io-console (~> 0.5)
|
|
226
|
+
rexml (3.4.4)
|
|
227
|
+
rspec (3.13.1)
|
|
228
|
+
rspec-core (~> 3.13.0)
|
|
229
|
+
rspec-expectations (~> 3.13.0)
|
|
230
|
+
rspec-mocks (~> 3.13.0)
|
|
231
|
+
rspec-core (3.13.5)
|
|
232
|
+
rspec-support (~> 3.13.0)
|
|
233
|
+
rspec-expectations (3.13.5)
|
|
234
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
235
|
+
rspec-support (~> 3.13.0)
|
|
236
|
+
rspec-mocks (3.13.5)
|
|
237
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
238
|
+
rspec-support (~> 3.13.0)
|
|
239
|
+
rspec-rails (5.1.2)
|
|
240
|
+
actionpack (>= 5.2)
|
|
241
|
+
activesupport (>= 5.2)
|
|
242
|
+
railties (>= 5.2)
|
|
243
|
+
rspec-core (~> 3.10)
|
|
244
|
+
rspec-expectations (~> 3.10)
|
|
245
|
+
rspec-mocks (~> 3.10)
|
|
246
|
+
rspec-support (~> 3.10)
|
|
247
|
+
rspec-support (3.13.6)
|
|
248
|
+
rubocop (1.80.2)
|
|
249
|
+
json (~> 2.3)
|
|
250
|
+
language_server-protocol (~> 3.17.0.2)
|
|
251
|
+
lint_roller (~> 1.1.0)
|
|
252
|
+
parallel (~> 1.10)
|
|
253
|
+
parser (>= 3.3.0.2)
|
|
254
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
255
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
256
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
|
257
|
+
ruby-progressbar (~> 1.7)
|
|
258
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
259
|
+
rubocop-ast (1.47.1)
|
|
260
|
+
parser (>= 3.3.7.2)
|
|
261
|
+
prism (~> 1.4)
|
|
262
|
+
rubocop-capybara (2.22.1)
|
|
263
|
+
lint_roller (~> 1.1)
|
|
264
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
265
|
+
rubocop-factory_bot (2.27.1)
|
|
266
|
+
lint_roller (~> 1.1)
|
|
267
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
268
|
+
rubocop-rails (2.33.3)
|
|
269
|
+
activesupport (>= 4.2.0)
|
|
270
|
+
lint_roller (~> 1.1)
|
|
271
|
+
rack (>= 1.1)
|
|
272
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
273
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
274
|
+
rubocop-rspec (2.31.0)
|
|
275
|
+
rubocop (~> 1.40)
|
|
276
|
+
rubocop-capybara (~> 2.17)
|
|
277
|
+
rubocop-factory_bot (~> 2.22)
|
|
278
|
+
rubocop-rspec_rails (~> 2.28)
|
|
279
|
+
rubocop-rspec_rails (2.29.1)
|
|
280
|
+
rubocop (~> 1.61)
|
|
281
|
+
ruby-progressbar (1.13.0)
|
|
282
|
+
securerandom (0.4.1)
|
|
283
|
+
stringio (3.1.7)
|
|
284
|
+
thor (1.4.0)
|
|
285
|
+
timeout (0.4.3)
|
|
286
|
+
tzinfo (2.0.6)
|
|
287
|
+
concurrent-ruby (~> 1.0)
|
|
288
|
+
unicode-display_width (3.2.0)
|
|
289
|
+
unicode-emoji (~> 4.1)
|
|
290
|
+
unicode-emoji (4.1.0)
|
|
291
|
+
uri (1.0.3)
|
|
292
|
+
useragent (0.16.11)
|
|
293
|
+
vcr (6.3.1)
|
|
294
|
+
base64
|
|
295
|
+
webmock (3.25.1)
|
|
296
|
+
addressable (>= 2.8.0)
|
|
297
|
+
crack (>= 0.3.2)
|
|
298
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
299
|
+
websocket-driver (0.8.0)
|
|
300
|
+
base64
|
|
301
|
+
websocket-extensions (>= 0.1.0)
|
|
302
|
+
websocket-extensions (0.1.5)
|
|
303
|
+
zeitwerk (2.7.3)
|
|
304
|
+
|
|
305
|
+
PLATFORMS
|
|
306
|
+
aarch64-linux-gnu
|
|
307
|
+
aarch64-linux-musl
|
|
308
|
+
arm-linux-gnu
|
|
309
|
+
arm-linux-musl
|
|
310
|
+
arm64-darwin
|
|
311
|
+
x86_64-darwin
|
|
312
|
+
x86_64-linux-gnu
|
|
313
|
+
x86_64-linux-musl
|
|
314
|
+
|
|
315
|
+
DEPENDENCIES
|
|
316
|
+
factory_bot_rails (~> 6.0)
|
|
317
|
+
lsa_tdx_feedback!
|
|
318
|
+
rake (~> 13.0)
|
|
319
|
+
rspec (~> 3.0)
|
|
320
|
+
rspec-rails (~> 5.0)
|
|
321
|
+
rubocop (~> 1.21)
|
|
322
|
+
rubocop-rails (~> 2.0)
|
|
323
|
+
rubocop-rspec (~> 2.0)
|
|
324
|
+
vcr (~> 6.0)
|
|
325
|
+
webmock (~> 3.0)
|
|
326
|
+
|
|
327
|
+
BUNDLED WITH
|
|
328
|
+
2.6.9
|
data/INSTALLATION.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Installation and Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide will walk you through setting up LsaTdxFeedback in your Rails application.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Rails 6.0 or higher
|
|
8
|
+
- Redis (for token caching)
|
|
9
|
+
- TDX API credentials from your administrator
|
|
10
|
+
|
|
11
|
+
## Step 1: Add the Gem
|
|
12
|
+
|
|
13
|
+
Add LsaTdxFeedback to your Gemfile:
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
gem 'lsa_tdx_feedback'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run bundle install:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bundle install
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Step 2: Configure TDX Credentials
|
|
26
|
+
|
|
27
|
+
### Option A: Rails Credentials (Recommended)
|
|
28
|
+
|
|
29
|
+
Edit your Rails credentials:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
rails credentials:edit
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Add your TDX configuration:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
lsa_tdx_feedback:
|
|
39
|
+
# Required OAuth Configuration
|
|
40
|
+
oauth_url: 'https://your-tdx-instance.com/oauth2' # Note: Do NOT include /token
|
|
41
|
+
api_base_url: 'https://your-tdx-instance.com/api'
|
|
42
|
+
client_id: your_tdx_client_id_here
|
|
43
|
+
client_secret: your_tdx_client_secret_here
|
|
44
|
+
|
|
45
|
+
# Required TDX Configuration
|
|
46
|
+
app_id: 31
|
|
47
|
+
account_id: 456
|
|
48
|
+
service_offering_id: 789
|
|
49
|
+
|
|
50
|
+
# Required Ticket Configuration
|
|
51
|
+
default_type_id: 100
|
|
52
|
+
default_form_id: 200
|
|
53
|
+
default_classification: '300'
|
|
54
|
+
default_status_id: 400
|
|
55
|
+
default_priority_id: 500
|
|
56
|
+
default_source_id: 600
|
|
57
|
+
default_responsible_group_id: 700
|
|
58
|
+
default_service_id: 800
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Note**: The gem will automatically configure itself from these credentials - no additional setup required!
|
|
62
|
+
|
|
63
|
+
### Option B: Environment Variables
|
|
64
|
+
|
|
65
|
+
Create an initializer file:
|
|
66
|
+
|
|
67
|
+
```ruby
|
|
68
|
+
# config/initializers/lsa_tdx_feedback.rb
|
|
69
|
+
LsaTdxFeedback.configure do |config|
|
|
70
|
+
config.client_id = ENV['TDX_CLIENT_ID']
|
|
71
|
+
config.client_secret = ENV['TDX_CLIENT_SECRET']
|
|
72
|
+
config.default_responsible_group_id = ENV['TDX_RESPONSIBLE_GROUP_ID'].to_i
|
|
73
|
+
end
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then set your environment variables:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
export TDX_CLIENT_ID="your_client_id"
|
|
80
|
+
export TDX_CLIENT_SECRET="your_client_secret"
|
|
81
|
+
export TDX_RESPONSIBLE_GROUP_ID="123"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Step 3: Mount the Engine Routes
|
|
85
|
+
|
|
86
|
+
Add the feedback gem routes to your application's `config/routes.rb`:
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
# config/routes.rb
|
|
90
|
+
Rails.application.routes.draw do
|
|
91
|
+
# Your existing routes...
|
|
92
|
+
|
|
93
|
+
# Mount the feedback gem engine
|
|
94
|
+
mount LsaTdxFeedback::Engine => "/lsa_tdx_feedback", as: "lsa_tdx_feedback"
|
|
95
|
+
end
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Step 4: Add to Your Layout
|
|
99
|
+
|
|
100
|
+
Add the feedback modal to your application layout:
|
|
101
|
+
|
|
102
|
+
```erb
|
|
103
|
+
<!-- app/views/layouts/application.html.erb -->
|
|
104
|
+
<!DOCTYPE html>
|
|
105
|
+
<html>
|
|
106
|
+
<head>
|
|
107
|
+
<!-- Your existing head content -->
|
|
108
|
+
<%= lsa_tdx_feedback_css %>
|
|
109
|
+
</head>
|
|
110
|
+
|
|
111
|
+
<body>
|
|
112
|
+
<!-- Your existing body content -->
|
|
113
|
+
|
|
114
|
+
<!-- Add the feedback modal -->
|
|
115
|
+
<%= lsa_tdx_feedback_modal %>
|
|
116
|
+
|
|
117
|
+
<!-- Add the JavaScript before closing body tag -->
|
|
118
|
+
<%= lsa_tdx_feedback_js %>
|
|
119
|
+
</body>
|
|
120
|
+
</html>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Or use the all-in-one helper:
|
|
124
|
+
|
|
125
|
+
```erb
|
|
126
|
+
<!-- app/views/layouts/application.html.erb -->
|
|
127
|
+
<!DOCTYPE html>
|
|
128
|
+
<html>
|
|
129
|
+
<head>
|
|
130
|
+
<!-- Your existing head content -->
|
|
131
|
+
</head>
|
|
132
|
+
|
|
133
|
+
<body>
|
|
134
|
+
<!-- Your existing body content -->
|
|
135
|
+
|
|
136
|
+
<!-- Add feedback gem (includes both assets and modal) -->
|
|
137
|
+
<%= lsa_tdx_feedback %>
|
|
138
|
+
</body>
|
|
139
|
+
</html>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Step 5: Customize User Email (Optional)
|
|
143
|
+
|
|
144
|
+
Override the user email detection in your ApplicationController:
|
|
145
|
+
|
|
146
|
+
```ruby
|
|
147
|
+
# app/controllers/application_controller.rb
|
|
148
|
+
class ApplicationController < ActionController::Base
|
|
149
|
+
private
|
|
150
|
+
|
|
151
|
+
def current_user_email_for_feedback
|
|
152
|
+
current_user&.email # Adjust based on your user model
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Step 6: Test the Installation
|
|
158
|
+
|
|
159
|
+
1. Start your Rails server:
|
|
160
|
+
```bash
|
|
161
|
+
rails server
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. Navigate to any page in your application
|
|
165
|
+
|
|
166
|
+
3. Look for the blue "Feedback" button in the bottom-right corner
|
|
167
|
+
|
|
168
|
+
4. Click it to open the feedback modal
|
|
169
|
+
|
|
170
|
+
5. Submit a test feedback to verify it creates a ticket in TDX
|
|
171
|
+
|
|
172
|
+
## Troubleshooting
|
|
173
|
+
|
|
174
|
+
### Common Issues
|
|
175
|
+
|
|
176
|
+
**1. Modal doesn't appear or form submission fails**
|
|
177
|
+
- Check that you've included the gem in your layout
|
|
178
|
+
- **Verify you've mounted the engine routes** in your `config/routes.rb`
|
|
179
|
+
- Check browser console for JavaScript errors
|
|
180
|
+
- Ensure CSS is loading properly
|
|
181
|
+
- Verify the `/lsa_tdx_feedback/feedback` endpoint is accessible
|
|
182
|
+
|
|
183
|
+
**2. "client_id is required" error**
|
|
184
|
+
- Verify your credentials are configured correctly
|
|
185
|
+
- Check Rails credentials with `rails credentials:show`
|
|
186
|
+
- Ensure environment variables are set if using that approach
|
|
187
|
+
|
|
188
|
+
**3. OAuth/API errors**
|
|
189
|
+
- Verify your TDX credentials are correct
|
|
190
|
+
- **Ensure oauth_url does NOT include /token** (e.g., use `https://your-tdx.com/oauth2` not `https://your-tdx.com/oauth2/token`)
|
|
191
|
+
- Check that your responsible group ID exists in TDX
|
|
192
|
+
- Ensure your TDX instance URLs are correct (default is UMich test environment)
|
|
193
|
+
|
|
194
|
+
**4. Styling conflicts**
|
|
195
|
+
- All LsaTdxFeedback styles are prefixed with `feedback-gem-`
|
|
196
|
+
- Use browser dev tools to identify conflicts
|
|
197
|
+
- Override styles in your application CSS if needed
|
|
198
|
+
|
|
199
|
+
### Debug Mode
|
|
200
|
+
|
|
201
|
+
Enable debug logging in your Rails environment:
|
|
202
|
+
|
|
203
|
+
```ruby
|
|
204
|
+
# config/environments/development.rb
|
|
205
|
+
config.log_level = :debug
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
This will log OAuth requests and API calls for troubleshooting.
|
|
209
|
+
|
|
210
|
+
## Advanced Configuration
|
|
211
|
+
|
|
212
|
+
### Custom TDX Instance
|
|
213
|
+
|
|
214
|
+
If you're using a different TDX instance than University of Michigan:
|
|
215
|
+
|
|
216
|
+
```ruby
|
|
217
|
+
LsaTdxFeedback.configure do |config|
|
|
218
|
+
config.oauth_url = "https://your-tdx-oauth-url"
|
|
219
|
+
config.api_base_url = "https://your-tdx-api-url"
|
|
220
|
+
# ... other config
|
|
221
|
+
end
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Custom Ticket Defaults
|
|
225
|
+
|
|
226
|
+
Override default ticket values:
|
|
227
|
+
|
|
228
|
+
```ruby
|
|
229
|
+
LsaTdxFeedback.configure do |config|
|
|
230
|
+
config.default_type_id = 28
|
|
231
|
+
config.default_priority_id = 20
|
|
232
|
+
config.default_status_id = 77
|
|
233
|
+
# ... other defaults
|
|
234
|
+
end
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Support
|
|
238
|
+
|
|
239
|
+
If you encounter issues:
|
|
240
|
+
|
|
241
|
+
1. Check the troubleshooting section above
|
|
242
|
+
2. Review the main README.md for detailed documentation
|
|
243
|
+
3. Check the GitHub issues page
|
|
244
|
+
4. Contact your TDX administrator for API-related questions
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Your Name
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|