workarea-google_analytics 2.1.6 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ca843aa749daf4ee89e4cc4584e0439f5928e1577d27c64ed72eba13f48caa5
4
- data.tar.gz: 99ec473ad9acfd98becfed72f6af78495df7342f847b4b6340808fceebd4df90
3
+ metadata.gz: b3b2732c59098561a87d64fcaa5b282c327e729c3bf26f64ff8ba0d252b6e286
4
+ data.tar.gz: 7274c3cc842cf545257bfce7fbbd012559b6c0dffaa515e83e079e2dbbda6f37
5
5
  SHA512:
6
- metadata.gz: d10d98ad3456003e96aee4906b9e7fd4ba0b5a0da2bebc6912081adae4f8f31529dea145ea5d94ce71fdfb5436705aa48797771c85bf89428ab3c461b7975909
7
- data.tar.gz: 1cec12e197be3021adb2c95c336f3079438886b50ee5aa83748868f20f826a674ad38d009f94396a54846f758b49524fce8fc4cd283314076b09944219b56a11
6
+ metadata.gz: e9a26aa2b74b54a05541671fcc8cd7dd48d5763013d78008cf32d19e6aff4d7602f539c6b08ca36edbc022f550235d34d90d1fa67a6af743cd2188c881649ca6
7
+ data.tar.gz: f8e156793f7fa1a48c41e766f70d7cd2022d8f8f7ab6db78eaccf0ea29e81750b8fdc1e776d35fdb7a19b021e780e9c0739948c33711d6d75fdc1f07a4bf6bcc
data/.eslintrc.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "extends": "eslint:recommended",
3
+ "rules": {
4
+ "semi": ["error", "always"],
5
+ "eqeqeq": ["error", "always"]
6
+ },
7
+ "globals": {
8
+ "window": true,
9
+ "document": true,
10
+ "WORKAREA": true,
11
+ "$": true,
12
+ "jQuery": true,
13
+ "_": true,
14
+ "feature": true,
15
+ "JST": true,
16
+ "Turbolinks": true,
17
+ "I18n": true,
18
+ "Chart": true,
19
+ "Dropzone": true,
20
+ "strftime": true,
21
+ "Waypoint": true,
22
+ "wysihtml": true,
23
+ "LocalTime": true,
24
+ "describe": true,
25
+ "after": true,
26
+ "afterEach": true,
27
+ "before": true,
28
+ "beforeEach": true,
29
+ "it": true,
30
+ "expect": true,
31
+ "sinon": true,
32
+ "fixture": true,
33
+ "chai": true
34
+ }
35
+ }
@@ -0,0 +1,57 @@
1
+ name: CI
2
+ on: [push]
3
+
4
+ jobs:
5
+ static_analysis:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v1
9
+ - uses: workarea-commerce/ci/bundler-audit@v1
10
+ - uses: workarea-commerce/ci/rubocop@v1
11
+ - uses: workarea-commerce/ci/eslint@v1
12
+ with:
13
+ args: '**/*.js'
14
+
15
+ admin_tests:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v1
19
+ - uses: actions/setup-ruby@v1
20
+ with:
21
+ ruby-version: 2.6.x
22
+ - uses: workarea-commerce/ci/test@v1
23
+ with:
24
+ command: bin/rails app:workarea:test:admin
25
+
26
+ core_tests:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v1
30
+ - uses: actions/setup-ruby@v1
31
+ with:
32
+ ruby-version: 2.6.x
33
+ - uses: workarea-commerce/ci/test@v1
34
+ with:
35
+ command: bin/rails app:workarea:test:core
36
+
37
+ storefront_tests:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v1
41
+ - uses: actions/setup-ruby@v1
42
+ with:
43
+ ruby-version: 2.6.x
44
+ - uses: workarea-commerce/ci/test@v1
45
+ with:
46
+ command: bin/rails app:workarea:test:storefront
47
+
48
+ plugins_tests:
49
+ runs-on: ubuntu-latest
50
+ steps:
51
+ - uses: actions/checkout@v1
52
+ - uses: actions/setup-ruby@v1
53
+ with:
54
+ ruby-version: 2.6.x
55
+ - uses: workarea-commerce/ci/test@v1
56
+ with:
57
+ command: bin/rails app:workarea:test:plugins
data/.gitignore CHANGED
@@ -13,4 +13,4 @@ node_modules
13
13
  test/reports
14
14
  package.json
15
15
  yarn.lock
16
- .rubocop-http*
16
+ .rubocop-http*
data/.rubocop.yml ADDED
@@ -0,0 +1,3 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/workarea-commerce/workarea/master/.rubocop.yml
3
+
data/.stylelintrc.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "stylelint-config-recommended-scss",
3
+ "rules": {
4
+ "block-no-empty": null,
5
+ "no-descending-specificity": null,
6
+ "property-no-unknown": [true, { "ignoreProperties": ["mso-hide"] }]
7
+ }
8
+ }
data/CHANGELOG.md CHANGED
@@ -1,18 +1,3 @@
1
- Workarea Google Analytics 2.1.6 (2020-02-04)
2
- --------------------------------------------------------------------------------
3
-
4
- * Don't Call Google Analytics Until It's Defined
5
-
6
- Instead of seeing whether the app is in the test environment, check
7
- whether the `ga()` function is present before sending any calls to it.
8
- This prevents a JS error that occurs when the
9
- `config.google_analytics_tracking_id` is missing.
10
-
11
- GOOGLEANALYTICS-4
12
- Tom Scott
13
-
14
-
15
-
16
1
  Workarea Google Analytics 2.1.5 (2019-08-21)
17
2
  --------------------------------------------------------------------------------
18
3
 
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
- git_source(:github) { |repo| "git@github.com:#{repo}.git" }
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
3
 
4
4
  gemspec
5
5
 
6
- gem 'workarea', github: 'workarea-commerce/workarea', branch: 'v3.5-stable'
6
+ gem 'workarea', github: 'workarea-commerce/workarea'
data/README.md CHANGED
@@ -30,22 +30,7 @@ bundle
30
30
  Configuration
31
31
  --------------------------------------------------------------------------------
32
32
 
33
- To integrate your Workarea application with Google Analytics you need configure your host application with your Google Analytics tracking ID.
34
-
35
- You should use application secrets to do this. Add the following to your `config/secrets.yml` file
36
-
37
- ```yaml
38
- google_analytics:
39
- :tracking_id: UA-2499240-11
40
- ```
41
-
42
- Then in workarea.rb add the following config:
43
-
44
- ```ruby
45
- Workarea.configure do |config|
46
- config.google_analytics_tracking_id = Rails.application.secrets.google_analytics[:tracking_id]
47
- end
48
- ```
33
+ To integrate your Workarea application with Google Analytics you need configure your host application with your Google Analytics tracking ID in the "Analytics" section on the configuration page within the admin UI.
49
34
 
50
35
  Shared Payloads
51
36
  --------------------------------------------------------------------------------
data/Rakefile CHANGED
@@ -16,12 +16,13 @@ desc "Release version #{Workarea::GoogleAnalytics::VERSION} of the gem"
16
16
  task :release do
17
17
  host = "https://#{ENV['BUNDLE_GEMS__WEBLINC__COM']}@gems.weblinc.com"
18
18
 
19
- Rake::Task['workarea:changelog'].execute
20
- system 'git add CHANGELOG.md'
21
- system 'git commit -m "Update CHANGELOG"'
19
+ #Rake::Task['workarea:changelog'].execute
20
+ #system 'git add CHANGELOG.md'
21
+ #system 'git commit -m "Update CHANGELOG"'
22
+ #system 'git push origin HEAD'
22
23
 
23
24
  system "git tag -a v#{Workarea::GoogleAnalytics::VERSION} -m 'Tagging #{Workarea::GoogleAnalytics::VERSION}'"
24
- system 'git push origin HEAD --follow-tags'
25
+ system 'git push --tags'
25
26
 
26
27
  system 'gem build workarea-google_analytics.gemspec'
27
28
  system "gem push workarea-google_analytics-#{Workarea::GoogleAnalytics::VERSION}.gem"
@@ -13,7 +13,7 @@ WORKAREA.analytics.registerAdapter('googleAnalytics', function () {
13
13
  console.log(arguments);
14
14
  }
15
15
 
16
- if (!WORKAREA.environment.isTest && !_.isUndefined(window.ga)) {
16
+ if (!WORKAREA.environment.isTest) {
17
17
  ga.apply(ga, arguments);
18
18
  }
19
19
  };
@@ -1,6 +1,7 @@
1
- %meta{ property: 'ga-tracking-id', content: Workarea.config.google_analytics_tracking_id }
2
- :javascript
3
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
1
+ - if Workarea.config.google_analytics_tracking_id.present?
2
+ %meta{ property: 'ga-tracking-id', content: Workarea.config.google_analytics_tracking_id }
3
+ :javascript
4
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
5
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
6
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
7
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
@@ -0,0 +1,8 @@
1
+ Workarea::Configuration.define_fields do
2
+ fieldset 'Analytics', namespaced: false do
3
+ field 'Google Analytics Tracking ID',
4
+ type: :string,
5
+ default: 'TODO',
6
+ description: 'Tracking id to use for tracking google analytics.'
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module GoogleAnalytics
3
- VERSION = '2.1.6'.freeze
3
+ VERSION = '2.2.0'.freeze
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails.application.config.session_store :cookie_store, key: '_dummy_session'
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session', expire_after: 30.minutes
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.required_ruby_version = '>= 2.0.0'
19
19
 
20
- s.add_dependency 'workarea', '~> 3.x'
20
+ s.add_dependency 'workarea', '~> 3.x', '>= 3.5.x'
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-google_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2019-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.x
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.5.x
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: 3.x
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.5.x
27
33
  description: Provides Google Analytics Enhanced Ecommerce integration for the Workarea
28
34
  Commerce Platform.
29
35
  email:
@@ -33,11 +39,15 @@ extensions: []
33
39
  extra_rdoc_files: []
34
40
  files:
35
41
  - ".editorconfig"
42
+ - ".eslintrc.json"
36
43
  - ".github/ISSUE_TEMPLATE/bug_report.md"
37
44
  - ".github/ISSUE_TEMPLATE/documentation-request.md"
38
45
  - ".github/ISSUE_TEMPLATE/feature_request.md"
46
+ - ".github/workflows/ci.yml"
39
47
  - ".gitignore"
40
48
  - ".rspec"
49
+ - ".rubocop.yml"
50
+ - ".stylelintrc.json"
41
51
  - ".yardopts"
42
52
  - CHANGELOG.md
43
53
  - CODE_OF_CONDUCT.md
@@ -50,7 +60,7 @@ files:
50
60
  - app/views/workarea/storefront/analytics/_google_analytics.html.haml
51
61
  - bin/rails
52
62
  - config/initializers/appends.rb
53
- - config/initializers/configuration.rb
63
+ - config/initializers/fields.rb
54
64
  - config/routes.rb
55
65
  - lib/tasks/google_analytics_tasks.rake
56
66
  - lib/workarea/google_analytics.rb
@@ -1 +0,0 @@
1
- Workarea.config.google_analytics_tracking_id = 'TODO'