Skip to content

Commit

Permalink
add comments for form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
theaddonn committed Oct 3, 2024
1 parent 4f7292e commit b151c61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/form/src/forms/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct CustomForm {
/// Refers to the title.
pub title: String,
/// All elements in the [`CustomForm`](CustomForm). Sequence is maintained.
#[serde(rename = "content")]
pub elements: Vec<Element>,
}
4 changes: 4 additions & 0 deletions crates/form/src/forms/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ModalForm {
/// Refers to the title.
pub title: String,
/// Refers to the body.
#[serde(rename = "content")]
pub body: String,
/// Refers to the first displayed button.
pub button1: Button,
/// Refers to the second displayed button.
pub button2: Button,
}
3 changes: 3 additions & 0 deletions crates/form/src/forms/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct SimpleForm {
/// Refers to the title.
pub title: String,
/// Refers to the body.
#[serde(rename = "content")]
pub body: String,
/// Refers to all available buttons. Sequence is maintained.
pub buttons: Vec<Button>,
}

0 comments on commit b151c61

Please sign in to comment.