pointless_feedback 4.0.3 → 4.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d1b4eedf7429534dc7ad9f4a137f6b5f7080a7e9
4
- data.tar.gz: c370de8290b91920dfd58a7a7f235a5ae16d3b7c
2
+ SHA256:
3
+ metadata.gz: d53eed87ef989df133f64d5f4fa0900eb0d6aee928d3dffcfdafbf68eb053d11
4
+ data.tar.gz: a02e3a8589e71aaeff63f3c3de7fc43e91517735fb5e56593d63f92a08df8fb2
5
5
  SHA512:
6
- metadata.gz: a2f2d24ec71f599e4a5ba39683549fef64e8828faecae32146e7bbf073c9d80bb21782bedf2290ade4c8a31316539b9c9adac7f6103293e882d13b975829b42a
7
- data.tar.gz: 1ffd2e665742d79e54961d1a44e6ca10cf79f327b18fe1145d275bae114585b2ea2fa8af2d91d93575091a52d00b6913572e2154b3f0b8f66d90c038093befc6
6
+ metadata.gz: fd9f9db0beb9fc3dc24b43aba150c476aaf9aff9a94994da1df9fe63e6d08ebad7a59cc100b9fbeac15b80f62028e61b2725d631ca9f114ffd33dbb5d753e4bc
7
+ data.tar.gz: b055d4ceaebbe4b094629ca0c7451cc8dcaee96b3cc904ba129a76ab1b4941d3390ea656f4f1e5d49903f5d0d3ac8f8a857fb1ca025dd462dbb827a52b824991
data/README.md CHANGED
@@ -72,12 +72,14 @@ feedback form that users can submit.
72
72
 
73
73
  There are a number of configuration variables you can set in the initializer generated by `rails generate pointless_feedback:install`
74
74
 
75
- **message_topics:**
76
- Defaults to `['Error on page', 'Other']`. Populates the "Topic" dropdown for feedback submissions.
75
+ #### Email Configuration
77
76
 
78
77
  **email_feedback:**
79
78
  Defaults to `false`. If set to `true` will send feedback as an email.
80
79
 
80
+ **message_topics:**
81
+ Defaults to `['Error on page', 'Other']`. Populates the "Topic" dropdown for feedback submissions.
82
+
81
83
  **send_from_submitter:**
82
84
  Defaults to `false`. If set to `true` will use the submitted email address as the from address for feedback emails.
83
85
 
@@ -90,6 +92,22 @@ Specifies what address the feedback email is sent from.
90
92
  **table_name:**
91
93
  Defaults to engine's namespace, e.g. `pointless_feedback_messages`. Change to any desired table for `PointlessFeedback::Message` model.
92
94
 
95
+ **google_captcha_site_key & google_captcha_secret_key:**
96
+ If you'd like to block out the robots, set up a Google Captcha instance:
97
+
98
+ Do so here - http://www.google.com/recaptcha/admin. Be sure to configure it with the reCAPTCHA v2 `"I'm not a robot" Checkbox`. Then copy the site_key and secret_key into these config variables and PointlessFeedback will handle the rest!
99
+
100
+ #### Airtable Configuration
101
+
102
+ **airtable_api_key:**
103
+ Self explanatory, required if you want to export submitted feedback contents into an Airtable database.
104
+
105
+ **airtable_app_key:**
106
+ Self explanatory
107
+
108
+ **airtable_table_name:**
109
+ Self explanatory
110
+
93
111
  ## Customization
94
112
 
95
113
  Pointless Feedback provides you with a simple setup that should cover most
@@ -159,7 +177,6 @@ to customize your redirect hook.
159
177
 
160
178
  ## Roadmap
161
179
 
162
- - [ ] Add service to send to Unfuddle
163
180
  - [ ] Add service to send to Github
164
181
  - [ ] Add admin view for messages with comments
165
182
 
@@ -15,6 +15,8 @@ module PointlessFeedback
15
15
 
16
16
  redirect_to after_message_create_path
17
17
  else
18
+ flash[:alert] = I18n.t('pointless_feedback.messages.invalid_captcha',
19
+ :default => 'Are you a robot? Please check the box at the bottom of the page and try again.')
18
20
  render :new
19
21
  end
20
22
  end
@@ -16,11 +16,33 @@ module PointlessFeedback
16
16
  private
17
17
 
18
18
  def export_feedback
19
- return unless PointlessFeedback.email_feedback
19
+ if PointlessFeedback.email_feedback
20
+ # Support Rails < 4.2 and >= 4.2 delivery options
21
+ mailer = FeedbackMailer.feedback(self)
22
+ mailer.respond_to?(:deliver_now) ? mailer.deliver_now : mailer.deliver
23
+ end
20
24
 
21
- # Support Rails < 4.2 and >= 4.2 delivery options
22
- mailer = FeedbackMailer.feedback(self)
23
- mailer.respond_to?(:deliver_now) ? mailer.deliver_now : mailer.deliver
25
+ if PointlessFeedback.airtable_api_key
26
+ feedback_table = Airrecord.table(
27
+ PointlessFeedback.airtable_api_key,
28
+ PointlessFeedback.airtable_app_key,
29
+ PointlessFeedback.airtable_table_name
30
+ )
31
+
32
+ begin
33
+ feedback_table.create(
34
+ "Name" => name,
35
+ "Email" => email_address,
36
+ "Topic" => topic,
37
+ "Description" => description,
38
+ "Date" => created_at
39
+ )
40
+ rescue => e
41
+ # ignore errors in production, last thing you want is a 500
42
+ # when someone's trying to complain about your site.
43
+ raise(e) if Rails.env.development?
44
+ end
45
+ end
24
46
  end
25
47
 
26
48
  def honeypot_filled_in?
@@ -1,15 +1,37 @@
1
1
  PointlessFeedback.setup do |config|
2
2
  # ==> Feedback Configuration
3
3
  # Configure the topics for the user to choose from on the feedback form
4
- # config.message_topics = ['Error on page', 'Other']
4
+ # config.message_topics = ['Error on page', 'Feature Request', 'Praise', 'Other']
5
5
 
6
6
  # ==> Email Configuration
7
7
  # Configure feedback email properties (disabled by default)
8
8
  # Variables needed for emailing feedback
9
- # config.email_feedback = false
10
- # config.send_from_submitter = false
11
- # config.from_email = 'feedback@pointlesscorp.com'
12
- # config.to_emails = ['first@example.com', 'second@example.com']
9
+ # config.email_feedback = false
10
+ # config.send_from_submitter = false
11
+ # config.from_email = 'feedback@pointlesscorp.com'
12
+ # config.to_emails = ['first@example.com', 'second@example.com']
13
+
14
+ # ==> Google reCAPTCHA Configuration
15
+ # If you'd like to enable Google reCAPTCHA,
16
+ # 1. Register your site at: https://www.google.com/recaptcha/admin
17
+ # 2. !! Ensure you opt for reCAPTCHA v2. Support for v3 is not here yet.
18
+ # 3. Grab the site and secret key and paste them here.
19
+ #
13
20
  # config.google_captcha_site_key = nil
14
21
  # config.google_captcha_secret_key = nil
22
+
23
+ # ==> Airtable Configuration
24
+ # If you'd like to export feedback submissions to an Airtable database,
25
+ # 1. Create an Airtable database with the following columns:
26
+ # - Name
27
+ # - Email
28
+ # - Topic
29
+ # - Description
30
+ # 2. Generate an API Key: https://airtable.com/account
31
+ # 3. Find your app key and table name: https://airtable.com/api
32
+ # 4. Fill in all these configs
33
+ #
34
+ # config.airtable_api_key = "key--------------"
35
+ # config.airtable_app_key = "app--------------"
36
+ # config.airtable_table_name = "Feedback Tracker"
15
37
  end
@@ -1,6 +1,8 @@
1
1
  require "pointless_feedback/engine"
2
2
  require "pointless_feedback/captcha"
3
3
  require "typhoeus"
4
+ require "jquery-rails"
5
+ require "airrecord"
4
6
 
5
7
  module PointlessFeedback
6
8
  module Controllers
@@ -41,6 +43,15 @@ module PointlessFeedback
41
43
  mattr_accessor :google_captcha_secret_key
42
44
  @@google_captcha_secret_key = nil
43
45
 
46
+ mattr_accessor :airtable_api_key
47
+ @@airtable_api_key = nil
48
+
49
+ mattr_accessor :airtable_app_key
50
+ @@airtable_app_key = nil
51
+
52
+ mattr_accessor :airtable_table_name
53
+ @@airtable_table_name = nil
54
+
44
55
  # Default way to setup PointlessFeedback. Run rails generate
45
56
  # pointless_feedback_install to create a fresh initializer with all
46
57
  # configuration values.
@@ -1,3 +1,3 @@
1
1
  module PointlessFeedback
2
- VERSION = "4.0.3"
2
+ VERSION = "4.1.2"
3
3
  end
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pointless_feedback
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2020-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,6 +44,34 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 0.7.3
47
+ - !ruby/object:Gem::Dependency
48
+ name: jquery-rails
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '4.0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '4.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: airrecord
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '1.0'
47
75
  - !ruby/object:Gem::Dependency
48
76
  name: sqlite3
49
77
  requirement: !ruby/object:Gem::Requirement
@@ -172,6 +200,7 @@ files:
172
200
  - test/dummy/config/locales/en.yml
173
201
  - test/dummy/config/routes.rb
174
202
  - test/dummy/db/schema.rb
203
+ - test/dummy/log/test.log
175
204
  - test/dummy/public/404.html
176
205
  - test/dummy/public/422.html
177
206
  - test/dummy/public/500.html
@@ -209,52 +238,53 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
238
  version: '0'
210
239
  requirements: []
211
240
  rubyforge_project:
212
- rubygems_version: 2.5.1
241
+ rubygems_version: 2.7.6
213
242
  signing_key:
214
243
  specification_version: 4
215
244
  summary: Simple Rails Engine to allow users to submit feedback
216
245
  test_files:
217
- - test/dummy/app/assets/javascripts/application.js
218
- - test/dummy/app/assets/stylesheets/application.css
246
+ - test/unit/pointless_feedback/captcha_test.rb
247
+ - test/unit/pointless_feedback/message_test.rb
248
+ - test/unit/helpers/pointless_feedback/application_helper_test.rb
219
249
  - test/dummy/app/controllers/application_controller.rb
220
250
  - test/dummy/app/controllers/home_controller.rb
221
- - test/dummy/app/helpers/application_helper.rb
222
251
  - test/dummy/app/views/home/index.html.erb
223
252
  - test/dummy/app/views/layouts/application.html.erb
224
- - test/dummy/config/application.rb
225
- - test/dummy/config/boot.rb
226
- - test/dummy/config/database.yml
227
- - test/dummy/config/environment.rb
228
- - test/dummy/config/environments/development.rb
253
+ - test/dummy/app/assets/javascripts/application.js
254
+ - test/dummy/app/assets/stylesheets/application.css
255
+ - test/dummy/app/helpers/application_helper.rb
256
+ - test/dummy/config/routes.rb
257
+ - test/dummy/config/locales/en.yml
229
258
  - test/dummy/config/environments/production.rb
259
+ - test/dummy/config/environments/development.rb
230
260
  - test/dummy/config/environments/test.rb
261
+ - test/dummy/config/environment.rb
262
+ - test/dummy/config/application.rb
263
+ - test/dummy/config/database.yml
264
+ - test/dummy/config/boot.rb
231
265
  - test/dummy/config/initializers/backtrace_silencers.rb
232
- - test/dummy/config/initializers/filter_parameter_logging.rb
233
- - test/dummy/config/initializers/inflections.rb
234
266
  - test/dummy/config/initializers/mime_types.rb
235
- - test/dummy/config/initializers/secret_token.rb
267
+ - test/dummy/config/initializers/filter_parameter_logging.rb
236
268
  - test/dummy/config/initializers/session_store.rb
237
269
  - test/dummy/config/initializers/wrap_parameters.rb
238
- - test/dummy/config/locales/en.yml
239
- - test/dummy/config/routes.rb
270
+ - test/dummy/config/initializers/secret_token.rb
271
+ - test/dummy/config/initializers/inflections.rb
240
272
  - test/dummy/config.ru
241
- - test/dummy/db/schema.rb
242
- - test/dummy/public/404.html
273
+ - test/dummy/script/rails
274
+ - test/dummy/Rakefile
275
+ - test/dummy/public/favicon.ico
243
276
  - test/dummy/public/422.html
244
277
  - test/dummy/public/500.html
245
- - test/dummy/public/favicon.ico
246
- - test/dummy/Rakefile
278
+ - test/dummy/public/404.html
279
+ - test/dummy/db/schema.rb
280
+ - test/dummy/log/test.log
247
281
  - test/dummy/README.rdoc
248
- - test/dummy/script/rails
249
- - test/factories/messages.rb
250
- - test/functional/pointless_feedback/feedback_mailer_test.rb
251
- - test/functional/pointless_feedback/messages_controller_test.rb
252
- - test/generators/install_generator_test.rb
253
- - test/generators/views_generator_test.rb
254
282
  - test/integration/pointless_feedback/feedback_submission_test.rb
255
283
  - test/integration/pointless_feedback/main_app_root_url_test.rb
256
284
  - test/pointless_feedback_test.rb
285
+ - test/factories/messages.rb
257
286
  - test/test_helper.rb
258
- - test/unit/helpers/pointless_feedback/application_helper_test.rb
259
- - test/unit/pointless_feedback/captcha_test.rb
260
- - test/unit/pointless_feedback/message_test.rb
287
+ - test/generators/install_generator_test.rb
288
+ - test/generators/views_generator_test.rb
289
+ - test/functional/pointless_feedback/messages_controller_test.rb
290
+ - test/functional/pointless_feedback/feedback_mailer_test.rb