mirror of
https://github.com/readur/readur.git
synced 2025-12-30 11:00:17 -06:00
feat(ui): make sure UI shows that commas are not allowed in labels
This commit is contained in:
@@ -1023,6 +1023,7 @@
|
||||
"inUse": "Cannot delete label because it is currently assigned to documents. Please remove the label from all documents first.",
|
||||
"systemDelete": "System labels cannot be deleted. Only user-created labels can be removed.",
|
||||
"invalidName": "Label name contains invalid characters. Please use only letters, numbers, and basic punctuation.",
|
||||
"commaNotAllowed": "Label names cannot contain commas.",
|
||||
"invalidColor": "Invalid color format. Please use a valid hex color like #0969da.",
|
||||
"maxLabelsReached": "Maximum number of labels reached. Please delete some labels before creating new ones."
|
||||
}
|
||||
|
||||
@@ -121,6 +121,13 @@ const LabelCreateDialog: React.FC<LabelCreateDialogProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
// Disallow commas in label names (breaks comma-separated search filters)
|
||||
// Also check for URL-encoded commas (%2c) which could cause issues in query parameters
|
||||
if (formData.name.includes(',') || formData.name.toLowerCase().includes('%2c')) {
|
||||
setNameError(t('labels.errors.commaNotAllowed'));
|
||||
return;
|
||||
}
|
||||
|
||||
setLoading(true);
|
||||
try {
|
||||
await onSubmit({
|
||||
|
||||
Reference in New Issue
Block a user