mod-build 4.0.33-beta.1 → 4.0.33

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,3 +1,7 @@
1
+ ## 4.0.33
2
+
3
+ - Adding current logic for appending the Modernize consent checkbox in the TCPA for sites using Vite
4
+
1
5
  ## 4.0.32
2
6
 
3
7
  - Updating the `grab-form-helpers.js` task to not have a double slash when copying files over
@@ -247,15 +247,8 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
247
247
  let finalTCPA = await (company === 'Modernize' || templatesData.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
248
248
  const removeInlineStyleRegex = / style="[^"]*"/g;
249
249
  finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
250
-
251
- // Adjustments for Modernize Consent Capture (will be adjusted with O&O Consent Implementation)
252
- if (finalTCPA.includes('Modernize and up to ')) {
253
- finalTCPA = finalTCPA.replace('Modernize', '<label><input class="consent-capture" type="checkbox" data-name="Modernize" data-key="33940610" checked /> Modernize</label>');
254
- const tcpaPrivacyAndTerms = ` Please see our <a id="tcpaPrivacy" href="/?modal=tcpaPrivacy" data-load="${pathSubdirectory ? pathSubdirectory : '/'}resources/templates/modals/privacy/" data-bind="modal-page">Privacy Notice</a> and our <a id="tcpaTerms" href="/?modal=tcpaTerms" data-load="${pathSubdirectory ? pathSubdirectory : '/'}resources/templates/modals/terms/" data-bind="modal-page">Terms of Use</a>.`;
255
- finalTCPA += tcpaPrivacyAndTerms;
256
- }
257
-
258
250
  templatesData.tcpaText = await finalTCPA;
251
+
259
252
  resolve();
260
253
  });
261
254
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.33-beta.1",
3
+ "version": "4.0.33",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -70,7 +70,7 @@ const getDefaultFormFieldConfig = async (config, folder = 'accessible-components
70
70
  });
71
71
  };
72
72
 
73
- const fetchTcpaFromSitegenie = async (config, tempConfig) => {
73
+ const fetchTcpaFromSitegenie = async (config, tempConfig, pathSubdirectory) => {
74
74
  const company = config.company_name;
75
75
  const companyPlaceholder = "<%=company_name%>";
76
76
  const website = config.website_name;
@@ -104,6 +104,14 @@ const fetchTcpaFromSitegenie = async (config, tempConfig) => {
104
104
  if (finalTCPA.includes(companyPlaceholder)) {
105
105
  finalTCPA = finalTCPA.replace(new RegExp(companyPlaceholder, 'g'), company);
106
106
  }
107
+
108
+ // Adjustments for Modernize Consent Capture (will be adjusted with O&O Consent Implementation)
109
+ if (finalTCPA.includes('Modernize and up to ')) {
110
+ finalTCPA = finalTCPA.replace('Modernize', '<label><input class="consent-capture" type="checkbox" data-name="Modernize" data-key="33940610" checked /> Modernize</label>');
111
+ const tcpaPrivacyAndTerms = ` Please see our <a id="tcpaPrivacy" href="/?modal=tcpaPrivacy" data-load="${pathSubdirectory ? pathSubdirectory : '/'}resources/templates/modals/privacy/" data-bind="modal-page">Privacy Notice</a> and our <a id="tcpaTerms" href="/?modal=tcpaTerms" data-load="${pathSubdirectory ? pathSubdirectory : '/'}resources/templates/modals/terms/" data-bind="modal-page">Terms of Use</a>.`;
112
+ finalTCPA += tcpaPrivacyAndTerms;
113
+ }
114
+
107
115
  tempConfig.tcpaText = finalTCPA;
108
116
  resolve(finalTCPA);
109
117
  })
@@ -115,6 +123,21 @@ const fetchTcpaFromSitegenie = async (config, tempConfig) => {
115
123
  }
116
124
 
117
125
  let defaultTcpa = JSON.parse(fs.readFileSync('src/resources/data/tcpa.json', 'utf8'));
126
+ defaultTcpa.tcpaText.replace(/QuinStreet/g, 'Modernize');
127
+
128
+ const removeInlineStyleRegex = / style="[^"]*"/g;
129
+ defaultTcpa.tcpaText = finalTCPA.replace(removeInlineStyleRegex, '');
130
+ if (defaultTcpa.tcpaText.includes(companyPlaceholder)) {
131
+ defaultTcpa.tcpaText = defaultTcpa.tcpaText.replace(new RegExp(companyPlaceholder, 'g'), company);
132
+ }
133
+
134
+ // Adjustments for Modernize Consent Capture (will be adjusted with O&O Consent Implementation)
135
+ if (defaultTcpa.tcpaText.includes('Modernize and up to ')) {
136
+ defaultTcpa.tcpaText = defaultTcpa.tcpaText.replace('Modernize', '<label><input class="consent-capture" type="checkbox" data-name="Modernize" data-key="33940610" checked /> Modernize</label>');
137
+ const tcpaPrivacyAndTerms = ` Please see our <a id="tcpaPrivacy" href="/?modal=tcpaPrivacy" data-load="${pathSubdirectory ? pathSubdirectory : '/'}resources/templates/modals/privacy/" data-bind="modal-page">Privacy Notice</a> and our <a id="tcpaTerms" href="/?modal=tcpaTerms" data-load="${pathSubdirectory ? pathSubdirectory : '/'}resources/templates/modals/terms/" data-bind="modal-page">Terms of Use</a>.`;
138
+ defaultTcpa.tcpaText += tcpaPrivacyAndTerms;
139
+ }
140
+
118
141
  tempConfig.tcpaText = defaultTcpa.tcpaText;
119
142
  resolve(error);
120
143
  }).finally(() => {
@@ -128,6 +151,8 @@ export default async function(config) {
128
151
  const { isWhiteLabel } = config;
129
152
  const assetsPath = isWhiteLabel ? '' : (isLocal ? '/temp/assets' : `https://${nodeEnv}/quote/resources/assets`);
130
153
  const tempConfigCreated = fs.existsSync(`${defaultSettings.srcFolder}/${defaultSettings.tmpFolder}/config.json`);
154
+ const isPathSubdirectory = typeof config.pathSubdirectory !== 'undefined';
155
+ const pathSubdirectory = !isLocal && isPathSubdirectory ? isPathSubdirectory : '';
131
156
 
132
157
  const activeSeason = getActiveSeasons();
133
158
 
@@ -197,7 +222,7 @@ export default async function(config) {
197
222
  }
198
223
  }
199
224
  if (!config.tcpaText && config.primary_trade && !tempConfigCreated) {
200
- await fetchTcpaFromSitegenie(config, tempConfig);
225
+ await fetchTcpaFromSitegenie(config, tempConfig, pathSubdirectory);
201
226
  }
202
227
  }
203
228