mod-build 4.0.54-beta.1 → 4.0.54

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.54
4
+
5
+ - Added `GUTTERS` & `GUTTER_COVERS` to the `addTcpaAboveCta` and `addTcpaBelowCta` configurations.
6
+
3
7
  ## 4.0.53
4
8
 
5
9
  - Added `addTcpaAboveCta` and `addTcpaBelowCta` helper functions to determine where tcpa should be placed based on trade/branded conditions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.54-beta.1",
3
+ "version": "4.0.54",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -44,6 +44,8 @@ function handlebarsX(expression, context) {
44
44
  return result;
45
45
  }
46
46
 
47
+ const tradesWithTcpaAboveCta = ['SOLAR', 'HOME_SECURITY', 'GUTTERS', 'GUTTER_COVERS'];
48
+
47
49
  export const handlebarsHelpers = [
48
50
  // Run any js line
49
51
  {
@@ -186,21 +188,16 @@ export const handlebarsHelpers = [
186
188
  {
187
189
  name: 'addTcpaAboveCta',
188
190
  fn: function(page) {
189
- if (!page || !page.primary_trade) {
190
- return false;
191
- }
192
- const trade = page.primary_trade.toUpperCase();
193
- return trade === 'SOLAR' || trade === 'HOME_SECURITY' || page.isBranded;
191
+ const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
192
+ return tradesWithTcpaAboveCta.includes(trade) || page.isBranded;
194
193
  }
195
194
  },
196
195
  {
197
196
  name: 'addTcpaBelowCta',
198
197
  fn: function(page) {
199
- if (!page || !page.primary_trade) {
200
- return false;
201
- }
202
- const trade = page.primary_trade.toUpperCase();
203
- return trade !== 'SOLAR' && trade !== 'HOME_SECURITY' && !page.isBranded;
198
+ const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
199
+
200
+ return !tradesWithTcpaAboveCta.includes(trade) && !page.isBranded;
204
201
  }
205
202
  }
206
203
  ]