mod-build 3.6.61-beta.5 → 3.6.61-beta.7
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 +1 -1
- package/gulp-tasks/templates.js +11 -20
- package/package.json +1 -1
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
|
|
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 }}`;
|
|
6
6
|
|
|
7
7
|
## 3.6.60
|
|
8
8
|
|
package/gulp-tasks/templates.js
CHANGED
|
@@ -64,21 +64,8 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
64
64
|
{
|
|
65
65
|
name: 'xif',
|
|
66
66
|
fn: function(expression, options) {
|
|
67
|
-
|
|
68
|
-
if (result) {
|
|
69
|
-
return options.fn(this);
|
|
70
|
-
} else {
|
|
71
|
-
return options.inverse(this);
|
|
72
|
-
}
|
|
67
|
+
return handlebarsX(expression, this, options) ? options.fn(this) : options.inverse(this);
|
|
73
68
|
},
|
|
74
|
-
inverse: function(expression, options) {
|
|
75
|
-
const result = handlebarsX(expression, this, options);
|
|
76
|
-
if (result) {
|
|
77
|
-
return options.inverse(this);
|
|
78
|
-
} else {
|
|
79
|
-
return options.fn(this);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
69
|
},
|
|
83
70
|
// Reverse array
|
|
84
71
|
{
|
|
@@ -180,7 +167,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
180
167
|
}
|
|
181
168
|
];
|
|
182
169
|
|
|
183
|
-
var mergeDefaultFormFieldConfig = function(steps, defaultConfig) {
|
|
170
|
+
var mergeDefaultFormFieldConfig = function(steps, defaultConfig, folder) {
|
|
184
171
|
if (!steps.items) {
|
|
185
172
|
console.error('No items[ ] found in steps{}!');
|
|
186
173
|
return steps;
|
|
@@ -188,9 +175,12 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
188
175
|
steps.items.forEach(item => {
|
|
189
176
|
if (item.fields) {
|
|
190
177
|
item.fields = item.fields.map(field => {
|
|
191
|
-
if (field.name && defaultConfig[field.name]) {
|
|
178
|
+
if (folder === 'shared-components' && field.name && defaultConfig[field.name]) {
|
|
192
179
|
field = Object.assign(defaultConfig[field.name], field);
|
|
193
180
|
}
|
|
181
|
+
if (folder === 'accessible-components' && field.attributes && field.attributes.name && defaultConfig[field.attributes.name]) {
|
|
182
|
+
field = merge(defaultConfig[field.attributes.name], field);
|
|
183
|
+
}
|
|
194
184
|
return field;
|
|
195
185
|
});
|
|
196
186
|
}
|
|
@@ -209,15 +199,16 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
209
199
|
}
|
|
210
200
|
|
|
211
201
|
const defaultConfig = await JSON.parse(response);
|
|
202
|
+
console.log(defaultConfig)
|
|
212
203
|
|
|
213
204
|
if (templatesData.steps) {
|
|
214
|
-
templatesData.steps = await mergeDefaultFormFieldConfig(templatesData.steps, defaultConfig);
|
|
205
|
+
templatesData.steps = await mergeDefaultFormFieldConfig(templatesData.steps, defaultConfig, folder);
|
|
215
206
|
}
|
|
216
207
|
if (templatesData.qsSteps) {
|
|
217
|
-
templatesData.qsSteps = await mergeDefaultFormFieldConfig(templatesData.qsSteps, defaultConfig);
|
|
208
|
+
templatesData.qsSteps = await mergeDefaultFormFieldConfig(templatesData.qsSteps, defaultConfig, folder);
|
|
218
209
|
}
|
|
219
210
|
if (templatesData.modSteps) {
|
|
220
|
-
templatesData.modSteps = await mergeDefaultFormFieldConfig(templatesData.modSteps, defaultConfig);
|
|
211
|
+
templatesData.modSteps = await mergeDefaultFormFieldConfig(templatesData.modSteps, defaultConfig, folder);
|
|
221
212
|
}
|
|
222
213
|
|
|
223
214
|
templatesData.defaultConfigCompleted = true;
|
|
@@ -279,4 +270,4 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
279
270
|
}))
|
|
280
271
|
.pipe(gulp.dest(siteSettings.tmpFolder));
|
|
281
272
|
};
|
|
282
|
-
};
|
|
273
|
+
};
|