mod-build 3.6.61-beta.7 → 3.6.61-beta.9

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 3.6.61
4
4
 
5
- - Adding the accessible components to the `grab-shared-components` task; As well as pulling the accessible `defaultFormFieldConfig` for the new template.js configuration; As well as adding the ability to add an `{{else}}` block when using `{{#xif }}`;
5
+ - Adding the accessible components to the `grab-shared-components` task; As well as pulling the accessible `defaultFormFieldConfig` for the new template.js configuration (& merging to the new template stucture appropriately);
6
6
 
7
7
  ## 3.6.60
8
8
 
@@ -18,18 +18,19 @@ const fileNames = {
18
18
  var isQuotePageOrUseRelativePath = false;
19
19
  var resourceURL = '';
20
20
  var pathSubdirectory = '';
21
+ var componentFolderPath = '';
21
22
 
22
23
  function replaceModalyticsSrc(gulp, gulpPlugins, siteSettings, siteData) {
23
24
  const resourcePath = isQuotePageOrUseRelativePath ? `${pathSubdirectory}{{#if this.src}}{{this.src}}{{/if}}resources/scripts/mod-alytics/` : '/resources/scripts/mod-alytics/';
24
25
  console.log(`>> VARIABLE modAlyticsFileName = ${fileNames.modAlyticsFileName}`)
25
- return gulp.src(siteSettings.srcFolder + '/shared-components/head/head.html')
26
+ return gulp.src(`${siteSettings.srcFolder}/${componentFolderPath}/head/head.html`)
26
27
  .pipe(replace(/".*(modalytics).*"/, `"${resourcePath}${fileNames.modAlyticsFileName}"`))
27
- .pipe(gulp.dest(siteSettings.srcFolder + '/shared-components/head'));
28
+ .pipe(gulp.dest(`${siteSettings.srcFolder}/${componentFolderPath}/head`));
28
29
  }
29
30
  function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
30
31
  console.log('>> STARTING replacing foot asset scripts');
31
32
  const resourcePath = isQuotePageOrUseRelativePath ? `${pathSubdirectory}{{#if this.nodeModulesPath}}{{this.nodeModulesPath}}{{/if}}resources/scripts` : '/resources/scripts';
32
- return gulp.src(siteSettings.srcFolder + '/shared-components/foot-assets/foot-assets.html')
33
+ return gulp.src(`${siteSettings.srcFolder}/${componentFolderPath}/foot-assets/foot-assets.html`)
33
34
  .pipe(replace(/"(?:(?!"|js")[\s\S])+(modutils|mod-utils.*?)js"|"(?:(?!"|")[\s\S])+(footer\/footer-component.*?)js"|"(?:(?!"|")[\s\S])+(mod-form\/form.*?)js"/g, function(match) {
34
35
  if (match.includes('mod-form/form')) {
35
36
  console.log(`>> VARIABLE homeownerFormFileName = ${fileNames.homeownerFormFileName}`);
@@ -42,7 +43,7 @@ function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
42
43
  return `"${resourcePath}/footer/${fileNames.footerComponentJsFileName}"`;
43
44
  }
44
45
  }))
45
- .pipe(gulp.dest(siteSettings.srcFolder + '/shared-components/foot-assets'))
46
+ .pipe(gulp.dest(`${siteSettings.srcFolder}/${componentFolderPath}/foot-assets`))
46
47
  .on('end', function() {
47
48
  console.log('>> FINISHED replacing foot asset scripts');
48
49
  });
@@ -234,7 +235,9 @@ const TASKS = {
234
235
  module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
235
236
  const { isLocal } = siteSettings
236
237
  const isQuotePage = siteData.siteData && siteData.siteData.isQuotePage || siteData && siteData.isQuotePage;
238
+ const useAccessibleComponents = siteData.siteData && siteData.siteData.useAccessibleConfig || siteData && siteData.useAccessibleConfig;
237
239
  const useRelativePathForResources = siteData.siteData && siteData.siteData.useRelativePathForResources || siteData && siteData.useRelativePathForResources;
240
+ componentFolderPath = useAccessibleComponents === true ? 'accessible-components' : 'shared-components';
238
241
  isQuotePageOrUseRelativePath = isQuotePage === true || useRelativePathForResources === true;
239
242
  resourceURL = `https://${siteSettings.nodeEnv}/quote/resources`;
240
243
  const isPathSubdirectory = siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory;
@@ -246,6 +249,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
246
249
  }
247
250
  return (function() {
248
251
  const tasks = Object.values(TASKS)
252
+ console.log(`****COMPONENT FOLDER PATH = ${componentFolderPath}`)
249
253
  if (tasks.length) {
250
254
  var getAllResources = tasks.map(function(task) {
251
255
  Object.assign(task.config, { gulp, gulpPlugins, siteSettings, siteData });
@@ -256,7 +260,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
256
260
  return Promise.all(getAllResources)
257
261
  .then(() => {
258
262
  console.log(`>> FILENAMES object = ${JSON.stringify(fileNames)}`);
259
- return gulp.src(siteSettings.srcFolder + '/shared-components/foot-assets/foot-assets.html')
263
+ return gulp.src(`${siteSettings.srcFolder}/${componentFolderPath}/foot-assets/foot-assets.html`)
260
264
  .on('data', function (file) {
261
265
  console.log(`>> FOOT ASSETS HTML = ${file.contents.toString()}`);
262
266
  });
@@ -199,7 +199,6 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
199
199
  }
200
200
 
201
201
  const defaultConfig = await JSON.parse(response);
202
- console.log(defaultConfig)
203
202
 
204
203
  if (templatesData.steps) {
205
204
  templatesData.steps = await mergeDefaultFormFieldConfig(templatesData.steps, defaultConfig, folder);
@@ -235,8 +234,9 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
235
234
  throw new Error(`${xhr.statusCode}: Error while fetching TCPA`);
236
235
  }
237
236
  const responseJson = await JSON.parse(response);
238
- const finalTCPA = await (company === 'Modernize' || templatesData.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
239
-
237
+ let finalTCPA = await (company === 'Modernize' || templatesData.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
238
+ const removeInlineStyleRegex = / style="[^"]*"/g;
239
+ finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
240
240
  templatesData.tcpaText = await finalTCPA;
241
241
 
242
242
  resolve();
@@ -248,7 +248,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
248
248
  return async function() {
249
249
  if (Object.keys(siteData).length > 0) {
250
250
  if (!templatesData.doNotUseDefaultFieldConfig && !templatesData.defaultConfigCompleted) {
251
- if (templatesData.siteData.useAccessibleFormConfig) {
251
+ if (templatesData.siteData.useAccessibleConfig) {
252
252
  await getDefaultFormFieldConfig('accessible-components');
253
253
  } else {
254
254
  await getDefaultFormFieldConfig('shared-components');
@@ -270,4 +270,4 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
270
270
  }))
271
271
  .pipe(gulp.dest(siteSettings.tmpFolder));
272
272
  };
273
- };
273
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.61-beta.7",
3
+ "version": "3.6.61-beta.9",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",