leadconduit-trustedform 2.3.1 → 2.3.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.
@@ -1,4 +1,3 @@
1
- const { get } = require('lodash');
2
1
  const request = require('request');
3
2
 
4
3
  module.exports = (req, res) => {
@@ -11,8 +10,7 @@ module.exports = (req, res) => {
11
10
  'test': 'https://app.staging.trustedform.com/account',
12
11
  'development': 'https://app.trustedform-dev.com/account',
13
12
  };
14
- const environment = get(process, 'env.NODE_ENV') || 'development';
15
- const url = trustedFormUrl[environment];
13
+ const url = trustedFormUrl[process.env.NODE_ENV] || trustedFormUrl['development'];
16
14
 
17
15
  const options = {
18
16
  url,
@@ -16,7 +16,7 @@
16
16
  their lead forms.
17
17
  </p>
18
18
  </section>
19
- <Navigation :onNext="onNext"/>
19
+ <Navigation :onConfirm="onConfirm"/>
20
20
  </div>
21
21
  <div v-else-if="!isDataService">
22
22
  <LoadingScreen :module-name="'TrustedForm ' + moduleName"/>
@@ -53,7 +53,7 @@ export default {
53
53
  }
54
54
  },
55
55
  methods: {
56
- onNext () {
56
+ onConfirm () {
57
57
  this.$router.push('/2');
58
58
  }
59
59
  },
@@ -27,7 +27,7 @@
27
27
  </table>
28
28
  </div>
29
29
  </section>
30
- <Navigation :onNext="onNext"/>
30
+ <Navigation :onConfirm="confirm"/>
31
31
  </div>
32
32
  </template>
33
33
 
@@ -44,7 +44,7 @@ export default {
44
44
  Navigation
45
45
  },
46
46
  methods: {
47
- onNext () {
47
+ confirm () {
48
48
  this.$router.push('/3');
49
49
  }
50
50
  }
@@ -8,7 +8,7 @@
8
8
  Now you’re ready to map your fields and set up the associated filters in your LeadConduit flow.
9
9
  </p>
10
10
  </section>
11
- <Navigation :onFinish="finish"/>
11
+ <Navigation :onConfirm="confirm"/>
12
12
  </div>
13
13
  </template>
14
14
 
@@ -17,8 +17,8 @@ import { Navigation } from '@activeprospect/integration-components';
17
17
 
18
18
  export default {
19
19
  methods: {
20
- finish () {
21
- this.$store.dispatch('finish');
20
+ confirm () {
21
+ this.$store.dispatch('confirm');
22
22
  }
23
23
  },
24
24
  components: {
@@ -9,25 +9,30 @@
9
9
  <p>You may select all products that you would like to add to your flow. Each product will be charged depending on your contract. {{errors}}</p>
10
10
  <ul>
11
11
  <li>
12
- <input type="checkbox" :disabled="!products.retain.enabled" v-model="products.retain.selected"><span> Retain</span>
13
- <p class="help-text">Store consent in TrustedForm certificates for legal (TCPA) compliance.</p>
12
+ <label>
13
+ <input type="checkbox" class="fancy-checkbox" :disabled="!products.retain.enabled" v-model="products.retain.selected" id="retain"><label for="retain">Retain</label>
14
+ <p class="help-text">Store consent in TrustedForm certificates for legal (TCPA) compliance.</p>
15
+ </label>
14
16
  </li>
15
17
  <li>
16
- <input type="checkbox" :disabled="!products.insights.enabled" v-model="products.insights.selected"><span> Insights</span>
17
- <p class="help-text">TrustedForm Insights helps buyers identify the leads that are most likely to convert and effectively manage returns and rejections.</p>
18
+ <label>
19
+ <input type="checkbox" class="fancy-checkbox" :disabled="!products.insights.enabled" v-model="products.insights.selected" id="insights"><label for="insights">Insights</label>
20
+ <p class="help-text">TrustedForm Insights helps buyers identify the leads that are most likely to convert and effectively manage returns and rejections.</p>
21
+ </label>
18
22
  </li>
19
23
  <li>
20
- <input type="checkbox" :disabled="!products.verify.enabled" v-model="products.verify.selected"><span> Verify</span>
21
- <p class="help-text">Confirm that your leads were shown consent language that meets your compliance requirements.</p>
24
+ <label>
25
+ <input type="checkbox" class="fancy-checkbox" :disabled="!products.verify.enabled" v-model="products.verify.selected" id="verify"><label for="verify">Verify</label>
26
+ <p class="help-text">Confirm that your leads were shown consent language that meets your compliance requirements.</p>
27
+ </label>
22
28
  </li>
23
29
  </ul>
24
30
  </form>
25
31
  </section>
26
32
  <Navigation
27
33
  :showPrevious="false"
28
- :onNext="!showFinish ? next : undefined"
29
- :onFinish="showFinish ? finish : undefined"
30
- :disableNext="!products.retain.selected && !products.insights.selected && !products.verify.selected"
34
+ :onConfirm="confirm"
35
+ :disableConfirm="!products.retain.selected && !products.insights.selected && !products.verify.selected"
31
36
  />
32
37
  </div>
33
38
  </template>
@@ -44,19 +49,14 @@ export default {
44
49
  components: {
45
50
  Navigation
46
51
  },
47
- computed: {
48
- showFinish () {
49
- return (this.products.retain.selected ||this.products.verify.selected ) && !this.products.insights.selected;
50
- }
51
- },
52
52
  methods: {
53
- next () {
53
+ confirm () {
54
54
  this.$store.state.products = this.products;
55
- this.$router.push('/5');
56
- },
57
- finish () {
58
- this.$store.state.products = this.products;
59
- this.$store.dispatch('finish');
55
+ if (this.products.insights.selected) {
56
+ this.$router.push('/5');
57
+ } else {
58
+ this.$store.dispatch('confirm');
59
+ }
60
60
  }
61
61
  },
62
62
  created () {
@@ -64,3 +64,9 @@ export default {
64
64
  }
65
65
  };
66
66
  </script>
67
+
68
+ <style scoped>
69
+ ul {
70
+ padding-top: 1em;
71
+ }
72
+ </style>
@@ -1,24 +1,30 @@
1
1
  <template>
2
2
  <div>
3
3
  <header>
4
- TrustedForm Insights Configuration
4
+ Configure TrustedForm Insights
5
5
  </header>
6
6
  <section>
7
7
  <form>
8
- <h3>Select Data Points</h3>
8
+ <h3>Select Insights Data Points</h3>
9
9
  <p>TrustedForm Insights provides the following data related to the lead that filled out the form. Each selection of data points will be charged individually.</p>
10
10
  <table>
11
11
  <thead>
12
12
  <tr>
13
- <th><input type="checkbox" v-model="header" :indeterminate.prop="selected === 'some'" @click="toggleAll"></th>
14
- <th>Select All</th>
15
- <th></th>
13
+ <th>
14
+ <input id="select-all" type="checkbox" class="fancy-checkbox" v-model="header" :indeterminate.prop="selected === 'some'" @click="toggleAll">
15
+ <label for="select-all" class="checkbox-label"></label>
16
+ </th>
17
+ <th><label for="select-all" class="text-label">Data Point</label></th>
18
+ <th>Description</th>
16
19
  </tr>
17
20
  </thead>
18
21
  <tbody>
19
22
  <tr v-for="field in Object.keys(fields)" :key="fields[field].name">
20
- <td><input type="checkbox" v-model="fields[field].selected" @change="updateHeader"></td>
21
- <td>{{fields[field].name}}</td>
23
+ <td>
24
+ <input :id="field" type="checkbox" class="fancy-checkbox" v-model="fields[field].selected" @change="updateHeader">
25
+ <label :for="field" class="checkbox-label"></label>
26
+ </td>
27
+ <td><label :for="field" class="text-label">{{fields[field].name}}</label></td>
22
28
  <td v-html="fields[field].description"></td>
23
29
  </tr>
24
30
  </tbody>
@@ -26,8 +32,8 @@
26
32
  </form>
27
33
  </section>
28
34
  <Navigation
29
- :onFinish="finish"
30
- :disableFinish="selected === 'none'"
35
+ :onConfirm="confirm"
36
+ :disableConfirm="selected === 'none'"
31
37
  />
32
38
  </div>
33
39
  </template>
@@ -67,9 +73,9 @@ export default {
67
73
  this.selected = this.amountSelected();
68
74
  this.header = this.selected === 'all';
69
75
  },
70
- finish () {
76
+ confirm () {
71
77
  this.$store.state.v4Fields = this.fields;
72
- this.$store.dispatch('finish');
78
+ this.$store.dispatch('confirm');
73
79
  }
74
80
  },
75
81
  mounted () {
@@ -78,3 +84,32 @@ export default {
78
84
  }
79
85
  }
80
86
  </script>
87
+
88
+ <style scoped>
89
+ table {
90
+ position: relative;
91
+ }
92
+
93
+ th {
94
+ position: sticky;
95
+ top: 0;
96
+ background-color: #f4f6f8;
97
+ border-bottom: 1px solid #dfe4e8;
98
+ }
99
+
100
+ /*
101
+ We are using "fancy-checkbox" in an atypical way;
102
+ Typically, the <label> and <input> components are siblings, and there is only 1 label for the checkbox.
103
+ However, since our fancy-checkbox is supposed to be placed in a separate <td> and have additional padding,
104
+ We have to add some additional styling and a second <label> element.
105
+ */
106
+ .checkbox-label {
107
+ /* !important is needed because of this style https://github.com/activeprospect/leadconduit-client/blob/618797873a9fc485bf2d51873043700aae9d496e/public/css/core/forms.styl#L495 */
108
+ padding: 1.2em !important;
109
+ }
110
+
111
+ .text-label {
112
+ /* !important is needed because of this style https://github.com/activeprospect/leadconduit-client/blob/618797873a9fc485bf2d51873043700aae9d496e/public/css/core/forms.styl#L429 */
113
+ margin: 0 !important;
114
+ }
115
+ </style>
@@ -87,7 +87,7 @@ const initStore = (config, ui) => new Vuex.Store({
87
87
  };
88
88
  context.commit('setFilters', [...context.state.filters, filter]);
89
89
  },
90
- async finish (context) {
90
+ async confirm (context) {
91
91
  const { products, v4Fields } = context.state;
92
92
  const flow = {
93
93
  steps: [{