workarea-product_grid_content 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.eslintrc +25 -0
  4. data/.eslintrc.json +35 -0
  5. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  6. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  7. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  8. data/.github/workflows/ci.yml +61 -0
  9. data/.gitignore +20 -0
  10. data/.rubocop.yml +2 -0
  11. data/.scss-lint.yml +192 -0
  12. data/.stylelintrc.json +8 -0
  13. data/CHANGELOG.md +104 -0
  14. data/CODE_OF_CONDUCT.md +3 -0
  15. data/CONTRIBUTING.md +3 -0
  16. data/Gemfile +5 -0
  17. data/LICENSE.md +3 -0
  18. data/README.md +72 -0
  19. data/Rakefile +59 -0
  20. data/app/assets/images/workarea/admin/content_block_types/insights_grid_cell.svg +1 -0
  21. data/app/assets/images/workarea/admin/content_block_types/product_grid_cell.svg +1 -0
  22. data/app/assets/javascripts/workarea/storefront/product_grid_content/modules/match_product_summary_height.js +53 -0
  23. data/app/assets/stylesheets/workarea/product_grid_content/components/_content_block_product_grid_cell.scss +45 -0
  24. data/app/assets/stylesheets/workarea/product_grid_content/components/_insights_grid_cell_content_block.scss +10 -0
  25. data/app/assets/stylesheets/workarea/product_grid_content/components/_pagination_product_grid_content.scss +9 -0
  26. data/app/assets/stylesheets/workarea/product_grid_content/components/_product_grid_cell_content_block.scss +30 -0
  27. data/app/controllers/workarea/storefront/content_blocks_controller.decorator +46 -0
  28. data/app/view_models/workarea/storefront/category_view_model.decorator +11 -0
  29. data/app/view_models/workarea/storefront/content_blocks/grid_content.rb +40 -0
  30. data/app/view_models/workarea/storefront/content_blocks/insights_grid_cell_view_model.rb +25 -0
  31. data/app/view_models/workarea/storefront/content_blocks/product_grid_cell_view_model.rb +23 -0
  32. data/app/view_models/workarea/storefront/product_grid_content.rb +17 -0
  33. data/app/view_models/workarea/storefront/search_view_model.decorator +12 -0
  34. data/app/views/layouts/workarea/storefront/in_grid_content_preview.html.haml +55 -0
  35. data/app/views/workarea/storefront/content_blocks/_insights_grid_cell.html.haml +8 -0
  36. data/app/views/workarea/storefront/content_blocks/_product_grid_cell.html.haml +10 -0
  37. data/app/views/workarea/storefront/shared/_product_grid_content_cell.html.haml +3 -0
  38. data/app/views/workarea/storefront/style_guides/components/_product_grid_cell_content_block.html.haml +27 -0
  39. data/bin/rails +25 -0
  40. data/config/initializers/appends.rb +23 -0
  41. data/config/initializers/content_block_config.rb +17 -0
  42. data/config/initializers/content_block_types.rb +48 -0
  43. data/lib/workarea/product_grid_content/engine.rb +8 -0
  44. data/lib/workarea/product_grid_content/version.rb +5 -0
  45. data/lib/workarea/product_grid_content.rb +11 -0
  46. data/package.json +9 -0
  47. data/public/sample_grid_content.png +0 -0
  48. data/test/dummy/Rakefile +6 -0
  49. data/test/dummy/bin/bundle +3 -0
  50. data/test/dummy/bin/rails +4 -0
  51. data/test/dummy/bin/rake +4 -0
  52. data/test/dummy/bin/setup +28 -0
  53. data/test/dummy/bin/update +28 -0
  54. data/test/dummy/bin/yarn +11 -0
  55. data/test/dummy/config/application.rb +31 -0
  56. data/test/dummy/config/boot.rb +5 -0
  57. data/test/dummy/config/environment.rb +5 -0
  58. data/test/dummy/config/environments/development.rb +52 -0
  59. data/test/dummy/config/environments/production.rb +83 -0
  60. data/test/dummy/config/environments/test.rb +45 -0
  61. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  62. data/test/dummy/config/initializers/assets.rb +14 -0
  63. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  64. data/test/dummy/config/initializers/content_security_policy.rb +25 -0
  65. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  66. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  67. data/test/dummy/config/initializers/inflections.rb +16 -0
  68. data/test/dummy/config/initializers/mime_types.rb +4 -0
  69. data/test/dummy/config/initializers/workarea.rb +5 -0
  70. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  71. data/test/dummy/config/locales/en.yml +33 -0
  72. data/test/dummy/config/puma.rb +34 -0
  73. data/test/dummy/config/routes.rb +5 -0
  74. data/test/dummy/config/secrets.yml +32 -0
  75. data/test/dummy/config/spring.rb +6 -0
  76. data/test/dummy/config.ru +5 -0
  77. data/test/dummy/db/seeds.rb +2 -0
  78. data/test/dummy/lib/assets/.keep +0 -0
  79. data/test/dummy/log/.keep +0 -0
  80. data/test/dummy/package.json +5 -0
  81. data/test/system/workarea/admin/in_grid_content_system_test.rb +67 -0
  82. data/test/teaspoon_env.rb +6 -0
  83. data/test/test_helper.rb +10 -0
  84. data/test/view_models/workarea/storefront/category_view_model_test.decorator +31 -0
  85. data/test/view_models/workarea/storefront/content_blocks/insights_grid_cell_view_model_test.rb +63 -0
  86. data/test/view_models/workarea/storefront/content_blocks/product_grid_cell_view_model_test.rb +77 -0
  87. data/workarea-product_grid_content.gemspec +16 -0
  88. data/yarn.lock +3290 -0
  89. metadata +150 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 36c0cf45e263a79e958e7b124c4ddab00674d6d290de192f040a813122c4dc21
4
+ data.tar.gz: d5d953862a2a8499e4e5b9279cf84d3cb910360024a1870a3dacb3b6a5355007
5
+ SHA512:
6
+ metadata.gz: e977ad075735a1d9c89137d4987b8ed98890e17bd8bf79fee7ca08ebc2c85870df1d9ffeb3f61e012d4892b536f09a3873cdb9fced546c0a80a9e8e83e21a4c8
7
+ data.tar.gz: c86a1dbac4eae00c8771e328bd30cd532fa43e2a570fe7efe8ed0fa69b27e9b5e26fab875a320a653d43ef640fb6546bd94cac69cfcd2c3dab55c1734665b359
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
data/.eslintrc ADDED
@@ -0,0 +1,25 @@
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
+ }
25
+ }
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,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.
@@ -0,0 +1,61 @@
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
+ - uses: workarea-commerce/ci/stylelint@v1
15
+ with:
16
+ args: '**/*.scss'
17
+
18
+ admin_tests:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v1
22
+ - uses: actions/setup-ruby@v1
23
+ with:
24
+ ruby-version: 2.6.x
25
+ - uses: workarea-commerce/ci/test@v1
26
+ with:
27
+ command: bin/rails app:workarea:test:admin
28
+
29
+ core_tests:
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v1
33
+ - uses: actions/setup-ruby@v1
34
+ with:
35
+ ruby-version: 2.6.x
36
+ - uses: workarea-commerce/ci/test@v1
37
+ with:
38
+ command: bin/rails app:workarea:test:core
39
+
40
+ storefront_tests:
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v1
44
+ - uses: actions/setup-ruby@v1
45
+ with:
46
+ ruby-version: 2.6.x
47
+ - uses: workarea-commerce/ci/test@v1
48
+ with:
49
+ command: bin/rails app:workarea:test:storefront
50
+
51
+ plugins_tests:
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v1
55
+ - uses: actions/setup-ruby@v1
56
+ with:
57
+ ruby-version: 2.6.x
58
+ - uses: workarea-commerce/ci/test@v1
59
+ with:
60
+ command: bin/rails app:workarea:test:plugins
61
+
data/.gitignore ADDED
@@ -0,0 +1,20 @@
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
20
+ node_modules/
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/workarea-commerce/workarea/master/.rubocop.yml
data/.scss-lint.yml ADDED
@@ -0,0 +1,192 @@
1
+ # Extension of the default configuration:
2
+ # https://github.com/causes/scss-lint/blob/master/config/default.yml
3
+
4
+ exclude: 'docs/**'
5
+
6
+ linters:
7
+ Comment:
8
+ enabled: false
9
+
10
+ DeclarationOrder:
11
+ enabled: true
12
+
13
+ ElsePlacement:
14
+ enabled: true
15
+
16
+ EmptyRule:
17
+ enabled: false
18
+
19
+ HexLength:
20
+ enabled: true
21
+ style: long
22
+
23
+ Indentation:
24
+ enabled: true
25
+ allow_non_nested_indentation: true
26
+ character: space
27
+ width: 4
28
+
29
+ LeadingZero:
30
+ enabled: true
31
+ style: include_zero
32
+
33
+ MergeableSelector:
34
+ enabled: true
35
+ force_nesting: false
36
+
37
+ PropertySortOrder:
38
+ enabled: true
39
+ ignore_unspecified: false
40
+ separate_groups: false
41
+ order:
42
+ - display
43
+ -
44
+ - position
45
+ - top
46
+ - right
47
+ - bottom
48
+ - left
49
+ - z-index
50
+ -
51
+ - margin
52
+ - margin-top
53
+ - margin-right
54
+ - margin-bottom
55
+ - margin-left
56
+ -
57
+ - margin-collapse
58
+ - margin-top-collapse
59
+ - margin-right-collapse
60
+ - margin-bottom-collapse
61
+ - margin-left-collapse
62
+ -
63
+ - padding
64
+ - padding-top
65
+ - padding-right
66
+ - padding-bottom
67
+ - padding-left
68
+ -
69
+ - width
70
+ - height
71
+ - max-width
72
+ - max-height
73
+ - min-width
74
+ - min-height
75
+ -
76
+ - float
77
+ - clear
78
+ -
79
+ - color
80
+ -
81
+ - font
82
+ - font-size
83
+ - font-style
84
+ - font-family
85
+ - font-weight
86
+ - font-variant
87
+ - font-smoothing
88
+ -
89
+ - line-height
90
+ - letter-spacing
91
+ - word-spacing
92
+ -
93
+ - text-align
94
+ - text-indent
95
+ - text-shadow
96
+ - text-overflow
97
+ - text-rendering
98
+ - text-transform
99
+ - text-decoration
100
+ - text-size-adjust
101
+ -
102
+ - word-break
103
+ - word-wrap
104
+ -
105
+ - white-space
106
+ -
107
+ - background
108
+ - background-size
109
+ - background-color
110
+ - background-image
111
+ - background-repeat
112
+ - background-position
113
+ - background-attachment
114
+ -
115
+ - border
116
+ - border-top
117
+ - border-right
118
+ - border-bottom
119
+ - border-left
120
+ -
121
+ - border-image
122
+ - border-spacing
123
+ - border-collapse
124
+ -
125
+ - border-color
126
+ - border-top-color
127
+ - border-right-color
128
+ - border-bottom-color
129
+ - border-left-color
130
+ -
131
+ - border-style
132
+ - border-top-style
133
+ - border-right-style
134
+ - border-bottom-style
135
+ - border-left-style
136
+ -
137
+ - border-width
138
+ - border-top-width
139
+ - border-right-width
140
+ - border-bottom-width
141
+ - border-left-width
142
+ -
143
+ - border-radius
144
+ - border-top-right-radius
145
+ - border-bottom-right-radius
146
+ - border-bottom-left-radius
147
+ - border-top-left-radius
148
+ - border-radius-topright
149
+ - border-radius-bottomright
150
+ - border-radius-bottomleft
151
+ - border-radius-topleft
152
+ -
153
+ - box-shadow
154
+
155
+ SelectorFormat:
156
+ enabled: true
157
+ convention: hyphenated_BEM
158
+
159
+ SingleLinePerSelector:
160
+ enabled: false
161
+
162
+ SpaceAfterPropertyColon:
163
+ enabled: true
164
+ style: at_least_one_space
165
+
166
+ SpaceBeforeBrace:
167
+ enabled: true
168
+ style: space
169
+ allow_single_line_padding: true
170
+
171
+ VariableForProperty:
172
+ enabled: true
173
+ properties:
174
+ - color
175
+ - font-family
176
+ - background-color
177
+
178
+ PseudoElement:
179
+ enabled: false
180
+
181
+ # These default settings may be problematic to implementors. They are not
182
+ # ommitted so that they may be adjusted as needed during an implementation.
183
+ #
184
+ # For documentation:
185
+ # https://github.com/causes/scss-lint/blob/master/lib/scss_lint/linter/README.md
186
+
187
+ DuplicateProperty:
188
+ enabled: true
189
+
190
+ PropertySpelling:
191
+ enabled: true
192
+ extra_properties: [] # Add experimental CSS to this array, if needed