mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: fmt
This commit is contained in:
parent
d86431dfbc
commit
05bdd052ab
@ -218,18 +218,14 @@ impl TryInto<CreateFieldParams> for CreateFieldPayloadPB {
|
||||
OrderObjectPosition::End
|
||||
},
|
||||
CreateFieldPosition::Before => {
|
||||
let field_id = self
|
||||
.target_field_id
|
||||
.ok_or(ErrorCode::InvalidParams)?;
|
||||
let field_id = self.target_field_id.ok_or(ErrorCode::InvalidParams)?;
|
||||
let field_id = NotEmptyStr::parse(field_id)
|
||||
.map_err(|_| ErrorCode::InvalidParams)?
|
||||
.0;
|
||||
OrderObjectPosition::Before(field_id)
|
||||
},
|
||||
CreateFieldPosition::After => {
|
||||
let field_id = self
|
||||
.target_field_id
|
||||
.ok_or(ErrorCode::InvalidParams)?;
|
||||
let field_id = self.target_field_id.ok_or(ErrorCode::InvalidParams)?;
|
||||
let field_id = NotEmptyStr::parse(field_id)
|
||||
.map_err(|_| ErrorCode::InvalidParams)?
|
||||
.0;
|
||||
|
@ -136,26 +136,16 @@ impl DatabaseLayoutDepsResolver {
|
||||
let field_type = FieldType::DateTime;
|
||||
let default_date_type_option = DateTypeOption::default();
|
||||
let field_id = gen_field_id();
|
||||
Field::new(
|
||||
field_id,
|
||||
"Date".to_string(),
|
||||
field_type.into(),
|
||||
false,
|
||||
)
|
||||
.with_type_option_data(field_type, default_date_type_option.into())
|
||||
Field::new(field_id, "Date".to_string(), field_type.into(), false)
|
||||
.with_type_option_data(field_type, default_date_type_option.into())
|
||||
}
|
||||
|
||||
fn create_select_field(&self) -> Field {
|
||||
let field_type = FieldType::SingleSelect;
|
||||
let default_select_type_option = SingleSelectTypeOption::default();
|
||||
let field_id = gen_field_id();
|
||||
Field::new(
|
||||
field_id,
|
||||
"Status".to_string(),
|
||||
field_type.into(),
|
||||
false,
|
||||
)
|
||||
.with_type_option_data(field_type, default_select_type_option.into())
|
||||
Field::new(field_id, "Status".to_string(), field_type.into(), false)
|
||||
.with_type_option_data(field_type, default_select_type_option.into())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,12 +9,7 @@ pub struct FieldBuilder {
|
||||
|
||||
impl FieldBuilder {
|
||||
pub fn new<T: Into<TypeOptionData>>(field_type: FieldType, type_option_data: T) -> Self {
|
||||
let mut field = Field::new(
|
||||
gen_field_id(),
|
||||
"".to_string(),
|
||||
field_type.into(),
|
||||
false,
|
||||
);
|
||||
let mut field = Field::new(gen_field_id(), "".to_string(), field_type.into(), false);
|
||||
field.width = 150;
|
||||
field
|
||||
.type_options
|
||||
|
@ -144,13 +144,8 @@ fn database_from_fields_and_rows(
|
||||
fn default_field(field_str: String, is_primary: bool) -> Field {
|
||||
let field_type = FieldType::RichText;
|
||||
let type_option_data = default_type_option_data_from_type(&field_type);
|
||||
Field::new(
|
||||
gen_field_id(),
|
||||
field_str,
|
||||
field_type.into(),
|
||||
is_primary,
|
||||
)
|
||||
.with_type_option_data(field_type, type_option_data)
|
||||
Field::new(gen_field_id(), field_str, field_type.into(), is_primary)
|
||||
.with_type_option_data(field_type, type_option_data)
|
||||
}
|
||||
|
||||
struct FieldsRows {
|
||||
|
Loading…
Reference in New Issue
Block a user