Skip to content

Commit b3e0114

Browse files
Copilothotlong
andcommitted
Address code review feedback - clarify qrErrorCorrection and remove unused import
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 5a56c69 commit b3e0114

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

content/docs/references/data/core/Field.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ description: Field Schema Reference
4646
| **showValue** | `boolean` | optional | Display current value on slider |
4747
| **marks** | `Record<string, string>` | optional | Custom marks/labels at specific values (e.g., `{0: "Low", 50: "Medium", 100: "High"}`) |
4848
| **barcodeFormat** | `Enum<'qr' \| 'ean13' \| 'ean8' \| 'code128' \| 'code39' \| 'upca' \| 'upce'>` | optional | Barcode format type |
49-
| **qrErrorCorrection** | `Enum<'L' \| 'M' \| 'Q' \| 'H'>` | optional | QR code error correction level (L=7%, M=15%, Q=25%, H=30%) |
49+
| **qrErrorCorrection** | `Enum<'L' \| 'M' \| 'Q' \| 'H'>` | optional | QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr" |
5050
| **displayValue** | `boolean` | optional | Display human-readable value below barcode/QR code |
5151
| **allowScanning** | `boolean` | optional | Enable camera scanning for barcode/QR code input |
5252
| **hidden** | `boolean` | optional | Hidden from default UI |

examples/modern-fields/src/event.object.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ObjectSchema, Field } from '@objectstack/spec/data';
2-
import { ValidationRuleSchema } from '@objectstack/spec/data';
32

43
/**
54
* Event Object - Demonstrates Cross-Field Validation

packages/spec/json-schema/Field.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
"Q",
294294
"H"
295295
],
296-
"description": "QR code error correction level (L=7%, M=15%, Q=25%, H=30%)"
296+
"description": "QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is \"qr\""
297297
},
298298
"displayValue": {
299299
"type": "boolean",

packages/spec/json-schema/FieldWidgetProps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"Q",
314314
"H"
315315
],
316-
"description": "QR code error correction level (L=7%, M=15%, Q=25%, H=30%)"
316+
"description": "QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is \"qr\""
317317
},
318318
"displayValue": {
319319
"type": "boolean",

packages/spec/json-schema/Object.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
"Q",
334334
"H"
335335
],
336-
"description": "QR code error correction level (L=7%, M=15%, Q=25%, H=30%)"
336+
"description": "QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is \"qr\""
337337
},
338338
"displayValue": {
339339
"type": "boolean",

packages/spec/src/data/field.zod.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ export const FieldSchema = z.object({
145145
marks: z.record(z.string()).optional().describe('Custom marks/labels at specific values (e.g., {0: "Low", 50: "Medium", 100: "High"})'),
146146

147147
// QR Code / Barcode field config
148+
// Note: qrErrorCorrection is only applicable when barcodeFormat='qr'
149+
// Runtime validation should enforce this constraint
148150
barcodeFormat: z.enum(['qr', 'ean13', 'ean8', 'code128', 'code39', 'upca', 'upce']).optional().describe('Barcode format type'),
149-
qrErrorCorrection: z.enum(['L', 'M', 'Q', 'H']).optional().describe('QR code error correction level (L=7%, M=15%, Q=25%, H=30%)'),
151+
qrErrorCorrection: z.enum(['L', 'M', 'Q', 'H']).optional().describe('QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr"'),
150152
displayValue: z.boolean().optional().describe('Display human-readable value below barcode/QR code'),
151153
allowScanning: z.boolean().optional().describe('Enable camera scanning for barcode/QR code input'),
152154

0 commit comments

Comments
 (0)