mod-build 3.4.13-beta.2 → 3.4.13-beta.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.4.13-beta.2",
3
+ "version": "3.4.13-beta.3",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -422,6 +422,7 @@ modForm.initQSForm = function() {
422
422
  this.opts.websiteName = window.location.host;
423
423
  this.opts.resultsPage = (this.opts.resultsPage ? this.opts.resultsPage : '/my/results/');
424
424
  this.opts.errorRedirectPath = (this.opts.errorRedirectPath ? this.opts.errorRedirectPath : '/my/results/');
425
+ this.opts.landingPage = window.location.hostname + window.location.pathname;
425
426
  this.opts.quadLinkParams = {};
426
427
 
427
428
  // We check if there's a quad link on the query string
@@ -679,8 +680,7 @@ modForm.processQSFormSubmitSuccess = function(response, xhr) {
679
680
 
680
681
  // If submission was succesful
681
682
  if (dataCaptureKey != null && xhr.status === 200) {
682
- var clickKeyUUID = this.opts.formData.CLK,
683
- landingPage = window.location.hostname + window.location.pathname;
683
+ var clickKeyUUID = this.opts.formData.CLK;
684
684
 
685
685
  // Setting GA User ID and several custom dimensions after a successful form submit request
686
686
  if (typeof dataLayer !== 'undefined') {
@@ -706,7 +706,7 @@ modForm.processQSFormSubmitSuccess = function(response, xhr) {
706
706
  // eslint-disable-next-line camelcase
707
707
  project_id: dataCaptureKey,
708
708
  // eslint-disable-next-line camelcase
709
- form_path: landingPage,
709
+ form_path: this.opts.landingPage,
710
710
  qsclickkey: clickKeyUUID
711
711
  });
712
712
 
@@ -795,11 +795,24 @@ modForm.processQSFormSubmitSuccess = function(response, xhr) {
795
795
  * @returns {Boolean}
796
796
  */
797
797
  modForm.isQsSiteEligibleForHrc = function() {
798
- var eligibleDomains = [
799
- 'modernize.local',
800
- 'qa.modernize.com',
801
- 'modernize.com'
802
- ];
803
-
804
- return eligibleDomains.indexOf(this.getDefaultSiteByDomain()) > -1;
798
+ var landingPage = this.opts.landingPage,
799
+ eligibleDomains = [
800
+ 'modernize.local',
801
+ 'qa.modernize.com',
802
+ 'modernize.com'
803
+ ],
804
+ nonEligiblePaths = [
805
+ 'gutter-guards',
806
+ 'home-warranty',
807
+ 'home-security',
808
+ 'medicalalerts',
809
+ 'bathandshowerremodel'
810
+ ];
811
+
812
+ var isEligible = (eligibleDomains.indexOf(this.getDefaultSiteByDomain()) > -1 &&
813
+ !nonEligiblePaths.some(function(path) {
814
+ return landingPage.indexOf(path) > -1;
815
+ }));
816
+
817
+ return isEligible;
805
818
  };