removed formatter for rules
This commit is contained in:
@@ -282,17 +282,6 @@ mask:
|
||||
Canvas uses this for display/editing. Backend expects raw values without mask
|
||||
literals.
|
||||
|
||||
### Formatter
|
||||
|
||||
```text
|
||||
formatter:
|
||||
type: "PhoneFormatter"
|
||||
options: []
|
||||
description: optional
|
||||
```
|
||||
|
||||
Formatter is resolved client-side. Backend stores it but does not execute it.
|
||||
|
||||
### External Validation
|
||||
|
||||
```text
|
||||
@@ -331,7 +320,6 @@ limits section
|
||||
pattern section
|
||||
allowed values section
|
||||
mask section
|
||||
formatter section
|
||||
external validation toggle
|
||||
```
|
||||
|
||||
|
||||
@@ -42,19 +42,6 @@ impl AllowedValues {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FormatterSettings {
|
||||
pub formatter_type: String,
|
||||
pub options: Vec<FormatterOption>,
|
||||
pub description: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FormatterOption {
|
||||
pub key: String,
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub enum CharacterFilterSettings {
|
||||
Alphabetic,
|
||||
@@ -129,7 +116,6 @@ pub struct ValidationSettings {
|
||||
pub pattern: Option<PatternSettings>,
|
||||
pub allowed_values: Option<AllowedValues>,
|
||||
pub display_mask: Option<DisplayMask>,
|
||||
pub formatter: Option<FormatterSettings>,
|
||||
pub external_validation_enabled: bool,
|
||||
}
|
||||
|
||||
@@ -141,7 +127,6 @@ impl ValidationSettings {
|
||||
pattern_filters: self.pattern.as_ref().map(PatternSettings::resolve),
|
||||
allowed_values: self.allowed_values.clone(),
|
||||
display_mask: self.display_mask.clone(),
|
||||
formatter: self.formatter.clone(),
|
||||
external_validation_enabled: self.external_validation_enabled,
|
||||
}
|
||||
}
|
||||
@@ -173,7 +158,6 @@ impl ValidationSettings {
|
||||
&rule.allowed_values,
|
||||
)?;
|
||||
merge_singleton("display_mask", &mut self.display_mask, &rule.display_mask)?;
|
||||
merge_singleton("formatter", &mut self.formatter, &rule.formatter)?;
|
||||
|
||||
if let Some(pattern) = &rule.pattern {
|
||||
match &mut self.pattern {
|
||||
@@ -220,7 +204,6 @@ pub struct ValidationConfig {
|
||||
pub pattern_filters: Option<PatternFilters>,
|
||||
pub allowed_values: Option<AllowedValues>,
|
||||
pub display_mask: Option<DisplayMask>,
|
||||
pub formatter: Option<FormatterSettings>,
|
||||
pub external_validation_enabled: bool,
|
||||
}
|
||||
|
||||
@@ -269,7 +252,6 @@ impl ValidationConfig {
|
||||
|| self.pattern_filters.is_some()
|
||||
|| self.allowed_values.is_some()
|
||||
|| self.display_mask.is_some()
|
||||
|| self.formatter.is_some()
|
||||
|| self.external_validation_enabled
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@ pub mod rules;
|
||||
pub mod set;
|
||||
|
||||
pub use config::{
|
||||
AllowedValues, CharacterFilterSettings, FormatterOption, FormatterSettings, PatternSettings,
|
||||
PositionFilterSettings, ValidationConfig, ValidationMergeError, ValidationResult,
|
||||
ValidationSettings,
|
||||
AllowedValues, CharacterFilterSettings, PatternSettings, PositionFilterSettings,
|
||||
ValidationConfig, ValidationMergeError, ValidationResult, ValidationSettings,
|
||||
};
|
||||
pub use rules::{
|
||||
count_text, CharacterFilter, CharacterLimits, CountMode, DisplayMask, LimitCheckResult,
|
||||
|
||||
Reference in New Issue
Block a user