mod-build 3.6.39--beta.1 → 3.6.40-beta.1
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,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.40
|
|
4
|
+
|
|
5
|
+
- added functionality to fetch & merge default form filed config in templateData
|
|
6
|
+
|
|
3
7
|
## 3.6.39
|
|
4
8
|
|
|
5
9
|
- implementing a buffer to our `grab-shared-scripts` task, which fixes the hashing issue we were facing for our larger files. updated the hashing algorithm to MD5, so it matches our CircleCI CLI hash. updated `mod-form-beta.min.js` to `homeowner.min.js`
|
package/gulp-tasks/templates.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var merge = require('lodash.merge');
|
|
2
|
+
var request = require('request');
|
|
2
3
|
|
|
3
4
|
module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
4
5
|
// Merge site's data with shared data
|
|
@@ -144,7 +145,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
144
145
|
fn: function(obj) {
|
|
145
146
|
var output = '';
|
|
146
147
|
var ignoreKeys = Array.prototype.slice.call(arguments, 1, -1);
|
|
147
|
-
|
|
148
|
+
|
|
148
149
|
for (var key in obj.attributes) {
|
|
149
150
|
if (ignoreKeys.indexOf(key) === -1) {
|
|
150
151
|
if (typeof obj.attributes[key] !== 'object') {
|
|
@@ -165,7 +166,36 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
165
166
|
}
|
|
166
167
|
];
|
|
167
168
|
|
|
168
|
-
|
|
169
|
+
var getDefaultFormFieldConfig = async function() {
|
|
170
|
+
const siteData = templatesData;
|
|
171
|
+
await new Promise((resolve) => {
|
|
172
|
+
request(`https://${siteSettings.nodeEnv}/quote/resources/mod-site/shared-components/input/defaultFormFieldConfig.json`, async function(err, xhr, response) {
|
|
173
|
+
if (xhr.statusCode !== 200) {
|
|
174
|
+
throw new Error(`${xhr.statusCode}: Error while fetching shared-components/defaultFormFieldConfig.json`);
|
|
175
|
+
}
|
|
176
|
+
if (!siteData.steps) {
|
|
177
|
+
throw new Error('steps not found!');
|
|
178
|
+
}
|
|
179
|
+
response = await JSON.parse(response);
|
|
180
|
+
siteData.steps.items.forEach(item => {
|
|
181
|
+
item.fields = item.fields.map(field => {
|
|
182
|
+
if (field.name && response[field.name]) {
|
|
183
|
+
field = Object.assign(response[field.name], field);
|
|
184
|
+
}
|
|
185
|
+
return field;
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
resolve();
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
return siteData;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
return async function() {
|
|
195
|
+
if (templatesData.useDefaultFieldConfig) {
|
|
196
|
+
await getDefaultFormFieldConfig();
|
|
197
|
+
}
|
|
198
|
+
|
|
169
199
|
return gulp.src([
|
|
170
200
|
siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/**/*.html',
|
|
171
201
|
'!' + siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/_partials/**/*.html'
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
modForm.getTradeFromUrl = function() {
|
|
20
|
-
var trades = ['solar', 'roofing', 'windows', 'hvac', 'siding', 'gutters', 'bathrooms', 'kitchen-remodeling', 'cabinets', 'home-security', 'home-warranty', 'medical-alerts', 'stair-lifts', 'walk-in-tubs', 'hot-tubs', 'flooring'
|
|
20
|
+
var trades = ['solar', 'roofing', 'windows', 'hvac', 'siding', 'gutters', 'bathrooms', 'kitchen-remodeling', 'cabinets', 'home-security', 'home-warranty', 'medical-alerts', 'stair-lifts', 'walk-in-tubs', 'hot-tubs', 'flooring'],
|
|
21
21
|
queryParamString = (location.search.slice(1) !== '') ? location.search.slice(1) : '',
|
|
22
22
|
params = queryParamString.toLowerCase(),
|
|
23
23
|
filteredTrades = trades.filter(function(trade) {
|