mod-build 4.0.99 → 4.0.100-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
+ ## 4.0.100
4
+
5
+ - Added field-level `move` support in `get-default-trade-questions` (e.g. `move: [{ from: 3, to: 0 }]`) to reorder default options while merging
6
+
3
7
  ## 4.0.99
4
8
 
5
9
  - Added `grab-bbb-logo` task to fetch the updated BBB logo and replace existing `bbb.svg` and/or `<symbol id="bbb">` in the sprite. Also updates current `BBB Accredited Business` alt text in `.html` / `template.js`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.99",
3
+ "version": "4.0.100-beta.1",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -90,6 +90,17 @@ function mergeDefaultTradeQuestionsConfig(config, steps) {
90
90
  }
91
91
  }
92
92
 
93
+ if (field && field.move) {
94
+ // field.move will look like [{from: 0, to: 1}]
95
+ // we need to remove option at from index and insert at to index
96
+ field.move.forEach((move) => {
97
+ const fromIndex = move.from;
98
+ const toIndex = move.to;
99
+ const fromOption = defaultStepOptions.splice(fromIndex, 1);
100
+ defaultStepOptions.splice(toIndex, 0, fromOption[0]);
101
+ });
102
+ }
103
+
93
104
  if (field.fieldType === 'radio' || field.fieldType === 'checkbox-group') {
94
105
  if (!field.errorMessage) {
95
106
  field.errorMessage = field.fieldType === 'checkbox-group' ? 'Please select at least one option.' : 'Professionals need this info to generate a quote.';