mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
31 lines
924 B
Rust
31 lines
924 B
Rust
use crate::services::field::*;
|
|
use flowy_grid_data_model::entities::{BuildGridContext, FieldType};
|
|
use flowy_sync::client_grid::GridBuilder;
|
|
|
|
pub fn make_default_grid() -> BuildGridContext {
|
|
// text
|
|
let text_field = FieldBuilder::new(RichTextTypeOptionBuilder::default())
|
|
.name("Name")
|
|
.visibility(true)
|
|
.build();
|
|
|
|
// single select
|
|
let single_select = SingleSelectTypeOptionBuilder::default();
|
|
let single_select_field = FieldBuilder::new(single_select).name("Type").visibility(true).build();
|
|
|
|
// checkbox
|
|
let checkbox_field = FieldBuilder::from_field_type(&FieldType::Checkbox)
|
|
.name("Done")
|
|
.visibility(true)
|
|
.build();
|
|
|
|
GridBuilder::default()
|
|
.add_field(text_field)
|
|
.add_field(single_select_field)
|
|
.add_field(checkbox_field)
|
|
.add_empty_row()
|
|
.add_empty_row()
|
|
.add_empty_row()
|
|
.build()
|
|
}
|