From ae292eff98ede638f75b912c0bca69d83b4c8b92 Mon Sep 17 00:00:00 2001 From: Mohammed Khalid Date: Fri, 16 Jan 2026 14:47:52 +0000 Subject: [PATCH 1/2] fix(text): update hint text for national grid --- designer/package.json | 2 +- .../forms/editor-v2/advanced-settings-mappers.test.js | 4 ++-- .../src/models/forms/editor-v2/location-hint-defaults.js | 2 +- .../models/forms/editor-v2/location-hint-defaults.test.js | 4 ++-- .../models/forms/editor-v2/location-instruction-defaults.js | 2 +- model/src/__stubs__/components.ts | 2 +- model/src/components/component-types.ts | 2 +- model/src/form/form-editor/preview/national-grid.test.js | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/designer/package.json b/designer/package.json index 9f2fddd720..1f6f5b20cd 100644 --- a/designer/package.json +++ b/designer/package.json @@ -36,7 +36,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/preset-react": "^7.26.3", "@dagrejs/dagre": "^1.1.5", - "@defra/forms-engine-plugin": "^4.0.28", + "@defra/forms-engine-plugin": "^4.0.29", "@defra/forms-model": "^3.0.601", "@defra/hapi-tracing": "^1.28.0", "@elastic/ecs-pino-format": "^1.5.0", diff --git a/designer/server/src/models/forms/editor-v2/advanced-settings-mappers.test.js b/designer/server/src/models/forms/editor-v2/advanced-settings-mappers.test.js index 71b30ecd5a..0536d5490b 100644 --- a/designer/server/src/models/forms/editor-v2/advanced-settings-mappers.test.js +++ b/designer/server/src/models/forms/editor-v2/advanced-settings-mappers.test.js @@ -72,7 +72,7 @@ describe('advanced-settings-mappers', () => { const result = mapBaseQuestionDetails(payload) expect(/** @type {{ hint?: string }} */ (result).hint).toBe( - 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589' + 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678' ) }) @@ -133,7 +133,7 @@ describe('advanced-settings-mappers', () => { const result = mapBaseQuestionDetails(payload) expect(/** @type {{ hint?: string }} */ (result).hint).toBe( - 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589' + 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678' ) }) diff --git a/designer/server/src/models/forms/editor-v2/location-hint-defaults.js b/designer/server/src/models/forms/editor-v2/location-hint-defaults.js index 627029e238..9e990e6d89 100644 --- a/designer/server/src/models/forms/editor-v2/location-hint-defaults.js +++ b/designer/server/src/models/forms/editor-v2/location-hint-defaults.js @@ -9,7 +9,7 @@ export const locationHintDefaults = { 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456', NationalGridFieldNumberField: - 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589', + 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678', LatLongField: 'For Great Britain, the latitude will be a number between 49.850 and 60.859. The longitude will be a number between -13.687 and 1.767' diff --git a/designer/server/src/models/forms/editor-v2/location-hint-defaults.test.js b/designer/server/src/models/forms/editor-v2/location-hint-defaults.test.js index 7e3d080feb..6892ff8b0a 100644 --- a/designer/server/src/models/forms/editor-v2/location-hint-defaults.test.js +++ b/designer/server/src/models/forms/editor-v2/location-hint-defaults.test.js @@ -15,7 +15,7 @@ describe('location-hint-defaults', () => { 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456' ) expect(locationHintDefaults.NationalGridFieldNumberField).toBe( - 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589' + 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678' ) expect(locationHintDefaults.LatLongField).toBe( 'For Great Britain, the latitude will be a number between 49.850 and 60.859. The longitude will be a number between -13.687 and 1.767' @@ -41,7 +41,7 @@ describe('location-hint-defaults', () => { ComponentType.NationalGridFieldNumberField ) expect(hint).toBe( - 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589' + 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678' ) }) diff --git a/designer/server/src/models/forms/editor-v2/location-instruction-defaults.js b/designer/server/src/models/forms/editor-v2/location-instruction-defaults.js index 684790c45a..e810d6ae2e 100644 --- a/designer/server/src/models/forms/editor-v2/location-instruction-defaults.js +++ b/designer/server/src/models/forms/editor-v2/location-instruction-defaults.js @@ -25,7 +25,7 @@ export const locationInstructionDefaults = { 3. Using the map, locate the land or building. Use the +/- icons to zoom in and out. 4. In the top toolbar, select the fourth icon along ('Where am I?') - it looks like a target. 5. Click on the land or building. - 6. A pop-up box will appear showing the land details for this location. The National Grid field number is the third number from the top of the list. It is made up of 2 letters and 8 numbers, for example, SO04188589.`, + 6. A pop-up box will appear showing the land details for this location. The National Grid field number is the third number from the top of the list. It is made up of 2 letters and 8 numbers, for example, NG 1234 5678.`, LatLongField: `Use the [MAGIC map tool](https://magic.defra.gov.uk/) to find the latitude and longitude for your land or buildings. Follow these instructions: diff --git a/model/src/__stubs__/components.ts b/model/src/__stubs__/components.ts index 8ee9ed99c6..3625b2f899 100644 --- a/model/src/__stubs__/components.ts +++ b/model/src/__stubs__/components.ts @@ -411,7 +411,7 @@ export function buildNationalGridFieldNumberFieldComponent( id: '3c4d5e6f-7g8h-9i0j-1k2l-3m4n5o6p7q8r', name: 'NationalGridFieldNumberField', title: 'National Grid field number', - hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589', + hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678', options: {}, ...partialComponent, type: ComponentType.NationalGridFieldNumberField diff --git a/model/src/components/component-types.ts b/model/src/components/component-types.ts index efb59f90e2..2141c6b91a 100644 --- a/model/src/components/component-types.ts +++ b/model/src/components/component-types.ts @@ -170,7 +170,7 @@ export const ComponentTypes: readonly ComponentDef[] = Object.freeze([ name: 'NationalGridFieldNumberField', title: 'National Grid field number', type: ComponentType.NationalGridFieldNumberField, - hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589', + hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678', options: {} }, { diff --git a/model/src/form/form-editor/preview/national-grid.test.js b/model/src/form/form-editor/preview/national-grid.test.js index a5c971015c..cba53c3be3 100644 --- a/model/src/form/form-editor/preview/national-grid.test.js +++ b/model/src/form/form-editor/preview/national-grid.test.js @@ -16,7 +16,7 @@ describe('national-grid', () => { it('should create instance from component', () => { const component = buildNationalGridFieldNumberFieldComponent({ title: 'Enter National Grid field number', - hint: 'For example, SO04188589', + hint: 'For example, NG 1234 5678', options: { instructionText: 'Enter the 10-character field number' } @@ -26,7 +26,7 @@ describe('national-grid', () => { const values = /** @type {LocationSettings} */ (elements.values) expect(values.question).toBe('Enter National Grid field number') - expect(values.hintText).toBe('For example, SO04188589') + expect(values.hintText).toBe('For example, NG 1234 5678') expect(values.instructionText).toBe('Enter the 10-character field number') }) }) @@ -52,7 +52,7 @@ describe('national-grid', () => { const elements = new LocationPreviewElements({ ...baseElements, question: 'Enter field number', - hintText: 'Example: SO04188589', + hintText: 'Example: NG 1234 5678', instructionText: 'Use National Grid format', userClasses: 'custom-class' }) From a7d9e8a05e234c8de73fbbcfbcc3fb99f870587b Mon Sep 17 00:00:00 2001 From: Mohammed Khalid Date: Fri, 16 Jan 2026 15:35:40 +0000 Subject: [PATCH 2/2] chore(deps): update @defra/forms-engine-plugin to version 4.0.37 and @defra/forms-model to version 3.0.597 --- designer/package.json | 2 +- package-lock.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer/package.json b/designer/package.json index f83bfc0775..eae6704170 100644 --- a/designer/package.json +++ b/designer/package.json @@ -36,7 +36,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/preset-react": "^7.26.3", "@dagrejs/dagre": "^1.1.5", - "@defra/forms-engine-plugin": "^4.0.28", + "@defra/forms-engine-plugin": "^4.0.37", "@defra/forms-model": "^3.0.603", "@defra/hapi-tracing": "^1.28.0", "@elastic/ecs-pino-format": "^1.5.0", diff --git a/package-lock.json b/package-lock.json index 04a0a0a93b..d6b909bde8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/preset-react": "^7.26.3", "@dagrejs/dagre": "^1.1.5", - "@defra/forms-engine-plugin": "^4.0.28", + "@defra/forms-engine-plugin": "^4.0.37", "@defra/forms-model": "^3.0.603", "@defra/hapi-tracing": "^1.28.0", "@elastic/ecs-pino-format": "^1.5.0", @@ -2912,13 +2912,13 @@ "link": true }, "node_modules/@defra/forms-engine-plugin": { - "version": "4.0.28", - "resolved": "https://registry.npmjs.org/@defra/forms-engine-plugin/-/forms-engine-plugin-4.0.28.tgz", - "integrity": "sha512-nwqKPeZsGVtj7vQ2ShzqEn0fU4qg6v5H8HnyrpnmGiI0BhP2KHxGgf5TlIrOlUz0sRUDM6xr2MuXTUDvuh6Avg==", + "version": "4.0.37", + "resolved": "https://registry.npmjs.org/@defra/forms-engine-plugin/-/forms-engine-plugin-4.0.37.tgz", + "integrity": "sha512-G9z+QpK5veyIkpkT2jYJGeAd+TTZaB5r3DHotVAqEeKZBKtNCG/Asknc3Rw4QLtdKE7fM4k/P8pqRl4p/mX0hQ==", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { - "@defra/forms-model": "^3.0.585", + "@defra/forms-model": "^3.0.597", "@defra/hapi-tracing": "^1.29.0", "@elastic/ecs-pino-format": "^1.5.0", "@hapi/boom": "^10.0.1",