talbe definition web

This commit is contained in:
Priec
2026-08-06 17:47:53 +02:00
parent f13def52c1
commit 5f4b026624
14 changed files with 870 additions and 273 deletions

View File

@@ -5,7 +5,7 @@
//! write: the response is rebuilt from the live profile tree rather than from
//! whatever the browser still had on screen.
use crate::schema::ColumnDraft;
use crate::schema::{ColumnCatalog, ColumnDraft};
/// The profile and table the workspace is pointed at. Arrives as a query
/// string on the selector and on the column-panel endpoints, and as hidden
@@ -82,6 +82,9 @@ impl TableDetailView {
pub(crate) struct DetailColumn {
pub name: String,
pub field_type: String,
/// The PostgreSQL type the column is stored as, from the column-type
/// catalog. Empty for a type the catalog does not describe.
pub sql_type: String,
pub currency: String,
pub quantity_ledger: bool,
pub rounded: bool,
@@ -225,10 +228,12 @@ pub(crate) struct PageInputs {
}
impl PageInputs {
/// A page with an empty append panel. The panel's vocabulary is filled in
/// by the loader, which is the only thing that knows it.
pub(crate) fn for_selection(selection: Selection) -> Self {
Self {
selection,
columns: ColumnDraft::for_append(),
columns: ColumnDraft::for_append(ColumnCatalog::default()),
..Self::default()
}
}
@@ -315,6 +320,7 @@ mod tests {
DetailColumn {
name: "work_phone".to_string(),
field_type: "phone".to_string(),
sql_type: "TEXT".to_string(),
currency: String::new(),
quantity_ledger: false,
rounded: false,
@@ -325,6 +331,7 @@ mod tests {
DetailColumn {
name: "work_phone_country".to_string(),
field_type: "phone_country".to_string(),
sql_type: "TEXT".to_string(),
currency: String::new(),
quantity_ledger: false,
rounded: false,