workarea-gdpr 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.gitignore +19 -0
  7. data/.rubocop.yml +116 -0
  8. data/CHANGELOG.md +26 -0
  9. data/CODE_OF_CONDUCT.md +3 -0
  10. data/CONTRIBUTING.md +3 -0
  11. data/Gemfile +22 -0
  12. data/LICENSE +52 -0
  13. data/README.md +45 -0
  14. data/Rakefile +60 -0
  15. data/app/assets/javascripts/workarea/storefront/gdpr/modules/gdpr_popup.js +52 -0
  16. data/app/assets/javascripts/workarea/storefront/gdpr/templates/popup.jst.ejs +1 -0
  17. data/app/assets/stylesheets/workarea/storefront/gdpr/components/_gdpr_popup.scss +7 -0
  18. data/bin/rails +21 -0
  19. data/config/initializers/workarea.rb +15 -0
  20. data/config/locales/en.yml +6 -0
  21. data/config/routes.rb +2 -0
  22. data/lib/tasks/gdpr_tasks.rake +4 -0
  23. data/lib/workarea/gdpr/engine.rb +8 -0
  24. data/lib/workarea/gdpr/version.rb +5 -0
  25. data/lib/workarea/gdpr.rb +11 -0
  26. data/test/dummy/Rakefile +6 -0
  27. data/test/dummy/app/assets/config/manifest.js +4 -0
  28. data/test/dummy/app/assets/javascripts/application.js +13 -0
  29. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  30. data/test/dummy/app/controllers/application_controller.rb +3 -0
  31. data/test/dummy/app/helpers/application_helper.rb +2 -0
  32. data/test/dummy/app/jobs/application_job.rb +2 -0
  33. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  34. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  36. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  37. data/test/dummy/bin/bundle +3 -0
  38. data/test/dummy/bin/rails +4 -0
  39. data/test/dummy/bin/rake +4 -0
  40. data/test/dummy/bin/setup +30 -0
  41. data/test/dummy/bin/update +26 -0
  42. data/test/dummy/bin/yarn +11 -0
  43. data/test/dummy/config/application.rb +30 -0
  44. data/test/dummy/config/boot.rb +5 -0
  45. data/test/dummy/config/cable.yml +10 -0
  46. data/test/dummy/config/environment.rb +5 -0
  47. data/test/dummy/config/environments/development.rb +51 -0
  48. data/test/dummy/config/environments/production.rb +88 -0
  49. data/test/dummy/config/environments/test.rb +44 -0
  50. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  51. data/test/dummy/config/initializers/assets.rb +14 -0
  52. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  53. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  54. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  55. data/test/dummy/config/initializers/inflections.rb +16 -0
  56. data/test/dummy/config/initializers/mime_types.rb +4 -0
  57. data/test/dummy/config/initializers/workarea.rb +5 -0
  58. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  59. data/test/dummy/config/locales/en.yml +33 -0
  60. data/test/dummy/config/puma.rb +56 -0
  61. data/test/dummy/config/routes.rb +5 -0
  62. data/test/dummy/config/secrets.yml +32 -0
  63. data/test/dummy/config/spring.rb +6 -0
  64. data/test/dummy/config.ru +5 -0
  65. data/test/dummy/db/seeds.rb +2 -0
  66. data/test/dummy/package.json +5 -0
  67. data/test/teaspoon_env.rb +6 -0
  68. data/test/test_helper.rb +10 -0
  69. data/workarea-gdpr.gemspec +19 -0
  70. metadata +112 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9c1437e888b8a42c520d265b1c55212a30a125ba956a5d86958289cb28c90b61
4
+ data.tar.gz: 9af596b54f706805f093c626f33965083fc8c8f845b669d51c5161ded7f52bef
5
+ SHA512:
6
+ metadata.gz: 7addd2407898c47d9c65358b33f168b2829368076a1cd08853ed69337e5e5ff805ba97670587d8ea23d28472ac93ed2eeb85b0bcdd2ad045e0f42f87bfc90bd2
7
+ data.tar.gz: a61cfdb5d53d24b69d001491afd2a09265b24888c8a8f7e4f1af5c94ff7a66a34153fa026b3d20ceafb025a0e2623f59dcf90083ece6a5cd92758eb48a74dea9
data/.editorconfig ADDED
@@ -0,0 +1,20 @@
1
+ # editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ end_of_line = lf
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [{*.rb,*.haml,*.decorator,*.yml,*.yaml,*.jbuilder}]
12
+ indent_size = 2
13
+ indent_style = space
14
+
15
+ [{*.js,*.jst,*.ejs,*.scss}]
16
+ indent_size = 4
17
+
18
+ [*.md]
19
+ indent_size = 4
20
+ trim_trailing_whitespace = false
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve Workarea
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ⚠️**Before you create**⚠️
11
+ Please verify the issue you're experiencing is not part of your Workarea project customizations. The best way to do this is with a [vanilla Workarea installation](https://developer.workarea.com/articles/create-a-new-host-application.html). This will help us spend time on fixes/improvements for the whole community. Thank you!
12
+
13
+ **Describe the bug**
14
+ A clear and concise description of what the bug is.
15
+
16
+ **To Reproduce**
17
+ Steps to reproduce the behavior:
18
+ 1. Go to '...'
19
+ 2. Click on '....'
20
+ 3. Scroll down to '....'
21
+ 4. See error
22
+
23
+ **Expected behavior**
24
+ A clear and concise description of what you expected to happen.
25
+
26
+ **Workarea Setup (please complete the following information):**
27
+ - Workarea Version: [e.g. v3.4.6]
28
+ - Plugins [e.g. workarea-blog, workarea-sitemaps]
29
+
30
+ **Attachments**
31
+ If applicable, add any attachments to help explain your problem, things like:
32
+ - screenshots
33
+ - Gemfile.lock
34
+ - test cases
35
+
36
+ **Additional context**
37
+ Add any other context about the problem here.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Documentation request
3
+ about: Suggest documentation
4
+ title: ''
5
+ labels: documentation
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your documentation related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm confused by [...]
12
+
13
+ **Describe the article you'd like**
14
+ A clear and concise description of what would be in the documentation article.
15
+
16
+ **Additional context**
17
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for Workarea
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ test/dummy/db/*.sqlite3
5
+ test/dummy/db/*.sqlite3-journal
6
+ test/dummy/log/*.log
7
+ test/dummy/tmp/
8
+ .DS_Store
9
+ .byebug_history
10
+ .bundle/
11
+ .sass-cache/
12
+ Gemfile.lock
13
+ pkg/
14
+ test/dummy/tmp/
15
+ test/dummy/public/
16
+ log/*.log
17
+ test/dummy/log/*.log
18
+ test/dummy/db/*.sqlite3
19
+ test/dummy/db/*.sqlite3-journal
data/.rubocop.yml ADDED
@@ -0,0 +1,116 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
+ # to ignore them, so only the ones explicitly set in this file are enabled.
5
+ DisabledByDefault: true
6
+
7
+ # Prefer &&/|| over and/or.
8
+ Style/AndOr:
9
+ Enabled: true
10
+
11
+ # Do not use braces for hash literals when they are the last argument of a
12
+ # method call.
13
+ Style/BracesAroundHashParameters:
14
+ Enabled: true
15
+ EnforcedStyle: context_dependent
16
+
17
+ # Align `when` with `case`.
18
+ Layout/CaseIndentation:
19
+ Enabled: true
20
+
21
+ # Align comments with method definitions.
22
+ Layout/CommentIndentation:
23
+ Enabled: true
24
+
25
+ Layout/EmptyLineAfterMagicComment:
26
+ Enabled: true
27
+
28
+ # In a regular class definition, no empty lines around the body.
29
+ Layout/EmptyLinesAroundClassBody:
30
+ Enabled: true
31
+
32
+ # In a regular method definition, no empty lines around the body.
33
+ Layout/EmptyLinesAroundMethodBody:
34
+ Enabled: true
35
+
36
+ # In a regular module definition, no empty lines around the body.
37
+ Layout/EmptyLinesAroundModuleBody:
38
+ Enabled: true
39
+
40
+ Layout/FirstParameterIndentation:
41
+ Enabled: true
42
+
43
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
44
+ Style/HashSyntax:
45
+ Enabled: true
46
+
47
+ # Two spaces, no tabs (for indentation).
48
+ Layout/IndentationWidth:
49
+ Enabled: true
50
+
51
+ Layout/SpaceAfterColon:
52
+ Enabled: true
53
+
54
+ Layout/SpaceAfterComma:
55
+ Enabled: true
56
+
57
+ Layout/SpaceAroundEqualsInParameterDefault:
58
+ Enabled: true
59
+
60
+ Layout/SpaceAroundKeyword:
61
+ Enabled: true
62
+
63
+ Layout/SpaceAroundOperators:
64
+ Enabled: true
65
+
66
+ Layout/SpaceBeforeFirstArg:
67
+ Enabled: true
68
+
69
+ # Defining a method with parameters needs parentheses.
70
+ Style/MethodDefParentheses:
71
+ Enabled: true
72
+
73
+ # Use `foo {}` not `foo{}`.
74
+ Layout/SpaceBeforeBlockBraces:
75
+ Enabled: true
76
+
77
+ # Use `foo { bar }` not `foo {bar}`.
78
+ Layout/SpaceInsideBlockBraces:
79
+ Enabled: true
80
+
81
+ # Use `{ a: 1 }` not `{a:1}`.
82
+ Layout/SpaceInsideHashLiteralBraces:
83
+ Enabled: true
84
+
85
+ Layout/SpaceInsideParens:
86
+ Enabled: true
87
+
88
+ # Check quotes usage according to lint rule below.
89
+ Style/StringLiterals:
90
+ Enabled: true
91
+
92
+ # Detect hard tabs, no hard tabs.
93
+ Layout/Tab:
94
+ Enabled: true
95
+
96
+ # Blank lines should not have any spaces.
97
+ Layout/TrailingBlankLines:
98
+ Enabled: true
99
+
100
+ # No trailing whitespace.
101
+ Layout/TrailingWhitespace:
102
+ Enabled: true
103
+
104
+ # Use quotes for string literals when they are enough.
105
+ Style/UnneededPercentQ:
106
+ Enabled: true
107
+
108
+ # Align `end` with the matching keyword or starting expression except for
109
+ # assignments, where it should be aligned with the LHS.
110
+ Lint/EndAlignment:
111
+ Enabled: true
112
+ EnforcedStyleAlignWith: variable
113
+
114
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
115
+ Lint/RequireParentheses:
116
+ Enabled: true
data/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ Workarea Gdpr 1.0.1 (2019-08-21)
2
+ --------------------------------------------------------------------------------
3
+
4
+ * Open Source!
5
+
6
+
7
+
8
+ Workarea Gdpr 1.0.0 (2018-05-24)
9
+ --------------------------------------------------------------------------------
10
+
11
+ * Leverage Workarea Changelog task
12
+
13
+ ECOMMERCE-5355
14
+ Curt Howard
15
+
16
+ * Initial implementation
17
+
18
+ ECOMMERCE-5717
19
+ Ben Crouse
20
+
21
+ * Add editorconfig
22
+
23
+ Ben Crouse
24
+
25
+
26
+
@@ -0,0 +1,3 @@
1
+ View this plugin's code of conduct here:
2
+
3
+ <https://github.com/workarea-commerce/workarea/blob/master/CODE_OF_CONDUCT.md>
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,3 @@
1
+ View this plugin's contribution guidelines here:
2
+
3
+ <https://github.com/workarea-commerce/workarea/blob/master/CONTRIBUTING.md>
data/Gemfile ADDED
@@ -0,0 +1,22 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "git@github.com:#{repo}.git" }
3
+
4
+ # Declare your gem's dependencies in gdpr.gemspec.
5
+ # Bundler will treat runtime dependencies like base dependencies, and
6
+ # development dependencies will be added by default to the :development group.
7
+ gemspec
8
+
9
+ # Declare any dependencies that are still in development here instead of in
10
+ # your gemspec. These might include edge Rails or gems from your path or
11
+ # Git. Remember to move these dependencies to your gemspec before releasing
12
+ # your gem to rubygems.org.
13
+
14
+ # To use a debugger
15
+ # gem 'byebug', group: [:development, :test]
16
+
17
+ gem 'rubocop', '0.52.1', require: false
18
+
19
+ gem 'workarea', '>= 3.2.0'
20
+ group :test do
21
+ gem 'workarea-testing', '>= 3.2.0'
22
+ end
data/LICENSE ADDED
@@ -0,0 +1,52 @@
1
+ WebLinc
2
+ Business Source License
3
+
4
+ Licensor: WebLinc Corporation, 22 S. 3rd Street, 2nd Floor, Philadelphia PA 19106
5
+
6
+ Licensed Work: Workarea Commerce Platform
7
+ The Licensed Work is (c) 2019 WebLinc Corporation
8
+
9
+ Additional Use Grant:
10
+ You may make production use of the Licensed Work without an additional license agreement with WebLinc so long as you do not use the Licensed Work for a Commerce Service.
11
+
12
+ A "Commerce Service" is a commercial offering that allows third parties (other than your employees and contractors) to access the functionality of the Licensed Work by creating or managing commerce functionality, the products, taxonomy, assets and/or content of which are controlled by such third parties.
13
+
14
+ For information about obtaining an additional license agreement with WebLinc, contact licensing@workarea.com.
15
+
16
+ Change Date: 2019-08-20
17
+
18
+ Change License: Version 2.0 or later of the GNU General Public License as published by the Free Software Foundation
19
+
20
+ Terms
21
+
22
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
23
+
24
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
25
+
26
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
27
+
28
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
29
+
30
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
31
+
32
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
33
+
34
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works and to refer to it using the trademark "Business Source License" as long as you comply with the Covenants of Licensor below.
35
+
36
+ Covenants of Licensor
37
+ In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
38
+
39
+ To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
40
+
41
+ To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None."
42
+
43
+ To specify a Change Date.
44
+
45
+ Not to modify this License in any other way.
46
+
47
+ Notice
48
+ The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
49
+
50
+ For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
51
+
52
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ Workarea GDPR
2
+ ================================================================================
3
+
4
+ A Workarea Commerce plugin that adds GDPR support to your application.
5
+
6
+ Read up on GDPR here:
7
+ * http://www.dummies.com/education/politics-government/general-data-protections-regulation-gdpr/
8
+ * https://confluence.tools.weblinc.com/display/WEBLINC/European+Union+General+Data+Protection+Regulation
9
+ * https://www.cennydd.com/writing/a-techies-rough-guide-to-gdpr
10
+
11
+ Overview
12
+ --------------------------------------------------------------------------------
13
+
14
+ This plugin attempts to provide compliance by adding these features:
15
+
16
+ * Adding a popup prompting to accept cookie use as essential for the site
17
+ * Adding GDPR request to the contact us form (any request for data can be handled through that)
18
+
19
+ Getting Started
20
+ --------------------------------------------------------------------------------
21
+
22
+ Add the gem to your application's Gemfile:
23
+
24
+ ```ruby
25
+ # ...
26
+ gem 'workarea-gdpr'
27
+ # ...
28
+ ```
29
+
30
+ Update your application's bundle.
31
+
32
+ ```bash
33
+ cd path/to/application
34
+ bundle
35
+ ```
36
+
37
+ Workarea Commerce Documentation
38
+ --------------------------------------------------------------------------------
39
+
40
+ See [https://developer.workarea.com](https://developer.workarea.com) for Workarea Commerce documentation.
41
+
42
+ License
43
+ --------------------------------------------------------------------------------
44
+
45
+ Workarea GDPR is released under the [Business Software License](LICENSE)
data/Rakefile ADDED
@@ -0,0 +1,60 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+ RDoc::Task.new(:rdoc) do |rdoc|
9
+ rdoc.rdoc_dir = 'rdoc'
10
+ rdoc.title = 'Gdpr'
11
+ rdoc.options << '--line-numbers'
12
+ rdoc.rdoc_files.include('README.md')
13
+ rdoc.rdoc_files.include('lib/**/*.rb')
14
+ end
15
+
16
+ APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
17
+ load 'rails/tasks/engine.rake'
18
+ load 'rails/tasks/statistics.rake'
19
+ load 'workarea/changelog.rake'
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |t|
23
+ t.libs << 'lib'
24
+ t.libs << 'test'
25
+ t.pattern = 'test/**/*_test.rb'
26
+ t.verbose = false
27
+ end
28
+ task default: :test
29
+
30
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
31
+ require 'workarea/gdpr/version'
32
+
33
+ desc "Release version #{Workarea::Gdpr::VERSION} of the gem"
34
+ task :release do
35
+ host = "https://#{ENV['BUNDLE_GEMS__WEBLINC__COM']}@gems.weblinc.com"
36
+
37
+ #Rake::Task['workarea:changelog'].execute
38
+ #system 'git add CHANGELOG.md'
39
+ #system 'git commit -m "Update CHANGELOG"'
40
+ #system 'git push origin HEAD'
41
+
42
+ system "git tag -a v#{Workarea::Gdpr::VERSION} -m 'Tagging #{Workarea::Gdpr::VERSION}'"
43
+ system 'git push --tags'
44
+
45
+ system 'gem build workarea-gdpr.gemspec'
46
+ system "gem push workarea-gdpr-#{Workarea::Gdpr::VERSION}.gem"
47
+ system "gem push workarea-gdpr-#{Workarea::Gdpr::VERSION}.gem --host #{host}"
48
+ system "rm workarea-gdpr-#{Workarea::Gdpr::VERSION}.gem"
49
+ end
50
+
51
+ desc 'Run the JavaScript tests'
52
+ ENV['TEASPOON_RAILS_ENV'] = File.expand_path('../test/dummy/config/environment', __FILE__)
53
+ task teaspoon: 'app:teaspoon'
54
+
55
+ desc 'Start a server at http://localhost:3000/teaspoon for JavaScript tests'
56
+ task :teaspoon_server do
57
+ Dir.chdir('test/dummy')
58
+ teaspoon_env = File.expand_path('../test/teaspoon_env.rb', __FILE__)
59
+ system "RAILS_ENV=test TEASPOON_ENV=#{teaspoon_env} rails s"
60
+ end
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @namespace WORKAREA.gdprPopup
3
+ */
4
+ WORKAREA.registerModule('gdprPopup', (function () {
5
+ 'use strict';
6
+
7
+ var markUserHasSeenPopup = function () {
8
+ WORKAREA.cookie.create('gdpr_popup', 'true', 999);
9
+ },
10
+
11
+ userHasSeenPopup = function () {
12
+ return Boolean(WORKAREA.cookie.read('gdpr_popup'));
13
+ },
14
+
15
+ showPopup = function () {
16
+ var $dialog = WORKAREA.dialog.createFromTemplate(
17
+ { path: 'workarea/storefront/gdpr/templates/popup' },
18
+ {
19
+ uiDialogOptions: {
20
+ modal: true,
21
+ closeOnEscape: false,
22
+ classes: {
23
+ 'ui-dialog': 'gdpr-popup'
24
+ },
25
+ open: function(event, ui) {
26
+ $('.ui-dialog-titlebar-close', ui.dialog | ui).hide();
27
+ },
28
+ buttons: [{
29
+ text: I18n.t('workarea.storefront.gdpr.agree'),
30
+ click: function() {
31
+ $(this).dialog('close');
32
+ markUserHasSeenPopup();
33
+ }
34
+ }]
35
+ }
36
+ }
37
+ );
38
+ },
39
+
40
+ /**
41
+ * @method
42
+ * @name init
43
+ * @memberof WORKAREA.gdprPopup
44
+ */
45
+ init = _.once(function () {
46
+ if (!userHasSeenPopup()) { showPopup(); }
47
+ });
48
+
49
+ return {
50
+ init: init
51
+ };
52
+ }()));
@@ -0,0 +1 @@
1
+ <p class="gdpr-popup__message"><%= I18n.t('workarea.storefront.gdpr.uses_cookies') %></p>
@@ -0,0 +1,7 @@
1
+ /*------------------------------------*\
2
+ #GDPR-POPUP
3
+ \*------------------------------------*/
4
+
5
+ .gdpr-popup {}
6
+
7
+ .gdpr-popup__message {}
data/bin/rails ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails gems
3
+ # installed from the root of your application.
4
+
5
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
6
+ ENGINE_PATH = File.expand_path('../../lib/workarea/gdpr/engine', __FILE__)
7
+ APP_PATH = File.expand_path('../../test/dummy/config/application', __FILE__)
8
+
9
+ # Set up gems listed in the Gemfile.
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
11
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
12
+
13
+ require 'action_controller/railtie'
14
+ require 'action_view/railtie'
15
+ require 'action_mailer/railtie'
16
+ require 'rails/test_unit/railtie'
17
+ require 'sprockets/railtie'
18
+ require 'teaspoon-mocha'
19
+
20
+ require 'workarea'
21
+ require 'rails/engine/commands'
@@ -0,0 +1,15 @@
1
+ Workarea.configure do |config|
2
+ config.inquiry_subjects['gdpr'] = 'GDPR Request'
3
+ end
4
+
5
+ unless Rails.env.test?
6
+ Workarea::Plugin.append_javascripts(
7
+ 'storefront.modules',
8
+ 'workarea/storefront/gdpr/modules/gdpr_popup'
9
+ )
10
+
11
+ Workarea::Plugin.append_javascripts(
12
+ 'storefront.templates',
13
+ 'workarea/storefront/gdpr/templates/popup'
14
+ )
15
+ end
@@ -0,0 +1,6 @@
1
+ en:
2
+ workarea:
3
+ storefront:
4
+ gdpr:
5
+ uses_cookies: This site uses cookies and third party services to provide certain services.
6
+ agree: I Agree
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :gdpr do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,8 @@
1
+ module Workarea
2
+ module Gdpr
3
+ class Engine < ::Rails::Engine
4
+ include Workarea::Plugin
5
+ isolate_namespace Workarea::Gdpr
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Workarea
2
+ module Gdpr
3
+ VERSION = '1.0.1'.freeze
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ require 'workarea'
2
+ require 'workarea/storefront'
3
+ require 'workarea/admin'
4
+
5
+ require 'workarea/gdpr/engine'
6
+ require 'workarea/gdpr/version'
7
+
8
+ module Workarea
9
+ module Gdpr
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,4 @@
1
+
2
+ //= link_tree ../images
3
+ //= link_directory ../javascripts .js
4
+ //= link_directory ../stylesheets .css
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end