mod-build 4.0.54-beta.1 → 4.0.55-beta.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.55
4
+
5
+ - Added extra conditions for `addTcpaAboveCta` and `addTcpaBelowCta` helper functions to not break when required data is not passed.
6
+
7
+ ## 4.0.54
8
+
9
+ - Added `GUTTERS` & `GUTTER_COVERS` to the `addTcpaAboveCta` and `addTcpaBelowCta` configurations.
10
+
3
11
  ## 4.0.53
4
12
 
5
13
  - 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.55-beta.2",
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
  {
@@ -189,8 +191,8 @@ export const handlebarsHelpers = [
189
191
  if (!page || !page.primary_trade) {
190
192
  return false;
191
193
  }
192
- const trade = page.primary_trade.toUpperCase();
193
- return trade === 'SOLAR' || trade === 'HOME_SECURITY' || page.isBranded;
194
+ const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
195
+ return tradesWithTcpaAboveCta.includes(trade) || page.isBranded;
194
196
  }
195
197
  },
196
198
  {
@@ -199,8 +201,8 @@ export const handlebarsHelpers = [
199
201
  if (!page || !page.primary_trade) {
200
202
  return false;
201
203
  }
202
- const trade = page.primary_trade.toUpperCase();
203
- return trade !== 'SOLAR' && trade !== 'HOME_SECURITY' && !page.isBranded;
204
+ const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
205
+ return !tradesWithTcpaAboveCta.includes(trade) && !page.isBranded;
204
206
  }
205
207
  }
206
208
  ]