@planning-inspectorate/dynamic-forms 2.2.0 → 2.3.0

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.
@@ -27,10 +27,19 @@ extends:
27
27
  validationJobs:
28
28
  - name: Run Linting & Tests
29
29
  steps:
30
+ - task: Cache@2
31
+ inputs:
32
+ key: 'npm | "$(Agent.OS)" | package-lock.json'
33
+ restoreKeys: |
34
+ npm | "$(Agent.OS)" | package-lock.json
35
+ path: $(Pipeline.Workspace)/.npm
36
+ displayName: Cache NPM
30
37
  - template: ../steps/node_script.yml
31
38
  parameters:
32
39
  nodeVersion: 22
33
40
  script: npm ci
41
+ environmentVariables:
42
+ npm_config_cache: $(Pipeline.Workspace)/.npm
34
43
  - template: ../steps/node_script.yml
35
44
  parameters:
36
45
  # only run commitlint on branches, not main
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/dynamic-forms",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "This package is for building GDS forms using a configuration-based approach.",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/section.js CHANGED
@@ -5,7 +5,6 @@
5
5
  */
6
6
 
7
7
  import RequiredValidator from './validator/required-validator.js';
8
- import MultiFieldInputQuestion from './components/multi-field-input/question.js';
9
8
 
10
9
  /**
11
10
  * Defines a section for a questionnaire, a set of Questions
@@ -200,7 +199,7 @@ export class Section {
200
199
  continue;
201
200
  }
202
201
  // if question is a multi field input question, check all fields
203
- if (question instanceof MultiFieldInputQuestion) {
202
+ if (question.inputFields) {
204
203
  for (const field of question.inputFields) {
205
204
  if (question.fieldIsRequired(field.fieldName)) {
206
205
  requiredQuestionCount++;