hidden columns from clients
This commit is contained in:
@@ -159,6 +159,7 @@ pub(crate) struct DetailColumn {
|
||||
pub read_only: bool,
|
||||
pub generated_from: String,
|
||||
pub renameable: bool,
|
||||
pub hidden_from_forms: bool,
|
||||
}
|
||||
|
||||
impl DetailColumn {
|
||||
@@ -186,6 +187,9 @@ impl DetailColumn {
|
||||
if self.read_only {
|
||||
flags.push(crate::tr!(*locale, "column-flag-read-only"));
|
||||
}
|
||||
if self.hidden_from_forms {
|
||||
flags.push(crate::tr!(*locale, "column-flag-hidden-from-forms"));
|
||||
}
|
||||
if !self.generated_from.is_empty() {
|
||||
flags.push(crate::tr!(
|
||||
*locale,
|
||||
@@ -266,6 +270,20 @@ pub(crate) struct OrderForm {
|
||||
pub column_ids: Vec<i64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, serde::Deserialize)]
|
||||
pub(crate) struct VisibilityForm {
|
||||
#[serde(default)]
|
||||
pub profile: String,
|
||||
#[serde(default)]
|
||||
pub table: String,
|
||||
#[serde(default)]
|
||||
pub expected_row_version: i64,
|
||||
#[serde(default)]
|
||||
pub column_id: i64,
|
||||
#[serde(default)]
|
||||
pub hidden_from_forms: bool,
|
||||
}
|
||||
|
||||
/// The copy-profile panel. An empty `table_names` copies the whole profile,
|
||||
/// which is what the backend takes an empty list to mean.
|
||||
#[derive(Clone, Debug, Default, serde::Deserialize)]
|
||||
@@ -515,6 +533,7 @@ mod tests {
|
||||
read_only: false,
|
||||
generated_from: String::new(),
|
||||
renameable: true,
|
||||
hidden_from_forms: false,
|
||||
},
|
||||
DetailColumn {
|
||||
column_id: 2,
|
||||
@@ -528,6 +547,7 @@ mod tests {
|
||||
read_only: true,
|
||||
generated_from: "work_phone".to_string(),
|
||||
renameable: false,
|
||||
hidden_from_forms: false,
|
||||
},
|
||||
DetailColumn {
|
||||
column_id: 3,
|
||||
@@ -541,6 +561,7 @@ mod tests {
|
||||
read_only: false,
|
||||
generated_from: "accounting".to_string(),
|
||||
renameable: true,
|
||||
hidden_from_forms: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user