removing decimal with precision and decimal count

This commit is contained in:
Filipriec
2026-08-24 21:31:06 +02:00
parent 16670f4375
commit 5e9b86c1fb
22 changed files with 50 additions and 467 deletions

View File

@@ -57,12 +57,6 @@ pub(crate) struct BuilderForm {
#[serde(default)]
pub link_table_input: String,
#[serde(default)]
pub decimal_precision_input: String,
#[serde(default)]
pub decimal_scale_input: String,
#[serde(default)]
pub fixed_decimal_input: String,
#[serde(default)]
pub column_indexing_input: String,
#[serde(default)]
pub column_quantity_ledger_input: String,
@@ -128,9 +122,6 @@ impl BuilderForm {
temporal_type_input: self.temporal_type_input.clone(),
gtin_type_input: self.gtin_type_input.clone(),
link_table_input: self.link_table_input.clone(),
decimal_precision_input: self.decimal_precision_input.clone(),
decimal_scale_input: self.decimal_scale_input.clone(),
fixed_decimal_input: self.fixed_decimal_input.clone(),
indexing_input: self.column_indexing_input.clone(),
quantity_ledger_input: self.column_quantity_ledger_input.clone(),
required_input: self.column_required_input.clone(),

View File

@@ -245,20 +245,13 @@ mod tests {
assert!(html.contains("Every profile can use this shared table."));
}
/// Fixed-scale decimal is the one intentionally gated type; enabling the
/// advanced control makes it reachable without removing server support.
/// Every type the server accepts has to be reachable from the picker, or
/// the web UI silently offers less than the backend does.
#[test]
fn the_type_picker_offers_the_parameterised_and_interval_types() {
let mut state = page();
let html = render_builder(&state);
fn the_type_picker_offers_interval_and_accounting_types() {
let html = render_builder(&page());
assert!(!html.contains(r#"<option value="decimal""#));
assert!(html.contains(r#"name="fixed_decimal_input""#));
state.draft.columns.fixed_decimal_input = "yes".to_string();
let html = render_builder(&state);
for column_type in ["decimal", "duration", "period", "accounting"] {
for column_type in ["duration", "period", "accounting"] {
assert!(
html.contains(&format!(r#"<option value="{column_type}""#)),
"the type picker is missing {column_type}"
@@ -279,14 +272,6 @@ mod tests {
state.draft.columns.type_input = "gtin".to_string();
assert!(render_builder(&state).contains(r#"name="gtin_type_input""#));
// Decimal reveals its precision and scale.
state.draft.columns.fixed_decimal_input = "yes".to_string();
state.draft.columns.type_input = "decimal".to_string();
let html = render_builder(&state);
assert!(html.contains(r#"name="decimal_precision_input""#));
assert!(html.contains(r#"name="decimal_scale_input""#));
assert!(html.contains("Advanced fixed-scale decimal"));
// Money reveals its currency and rounding inputs.
state.draft.columns.type_input = "money".to_string();
let html = render_builder(&state);