feat(07-01): extend FieldDef with validate/tooltipText and add 3 validate rules
- Add validate?: { regex: RegExp; message: string } to FieldDef interface
- Add tooltipText?: string to FieldDef interface (prep for Plan 07-02)
- Add validate rule to azureblob.account: /^[a-z0-9]{3,24}$/
- Add validate rule to s3.region: /^[a-z][a-z0-9-]+[a-z0-9]$/
- Add validate rule to gcs.project_number: /^\d+$/
This commit is contained in:
@@ -14,6 +14,8 @@ export interface FieldDef {
|
|||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
helpText?: string;
|
helpText?: string;
|
||||||
options?: { value: string; label: string }[]; // for inputType: 'select'
|
options?: { value: string; label: string }[]; // for inputType: 'select'
|
||||||
|
validate?: { regex: RegExp; message: string };
|
||||||
|
tooltipText?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BACKEND_REGISTRY = {
|
export const BACKEND_REGISTRY = {
|
||||||
@@ -28,6 +30,10 @@ export const BACKEND_REGISTRY = {
|
|||||||
required: true,
|
required: true,
|
||||||
placeholder: 'mystorageaccount',
|
placeholder: 'mystorageaccount',
|
||||||
helpText: 'The storage account name (not the full URL)',
|
helpText: 'The storage account name (not the full URL)',
|
||||||
|
validate: {
|
||||||
|
regex: /^[a-z0-9]{3,24}$/,
|
||||||
|
message: 'Must be 3–24 lowercase alphanumeric characters (no hyphens or uppercase)',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'key',
|
key: 'key',
|
||||||
@@ -76,6 +82,10 @@ export const BACKEND_REGISTRY = {
|
|||||||
inputType: 'text',
|
inputType: 'text',
|
||||||
required: true,
|
required: true,
|
||||||
placeholder: 'us-east-1',
|
placeholder: 'us-east-1',
|
||||||
|
validate: {
|
||||||
|
regex: /^[a-z][a-z0-9-]+[a-z0-9]$/,
|
||||||
|
message: 'Must be a valid AWS region format (e.g. us-east-1)',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -166,6 +176,10 @@ export const BACKEND_REGISTRY = {
|
|||||||
required: true,
|
required: true,
|
||||||
placeholder: '123456789',
|
placeholder: '123456789',
|
||||||
helpText: 'Your GCP project number (not project ID)',
|
helpText: 'Your GCP project number (not project ID)',
|
||||||
|
validate: {
|
||||||
|
regex: /^\d+$/,
|
||||||
|
message: 'Must contain digits only',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'service_account_credentials',
|
key: 'service_account_credentials',
|
||||||
|
|||||||
Reference in New Issue
Block a user