mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-11-30 10:12:50 +03:00
chore: update single select
This commit is contained in:
parent
bda56defaf
commit
b4d03c0097
@ -211,6 +211,12 @@ pub struct SingleSelectTypeOptionPB {
|
||||
|
||||
#[pb(index = 2)]
|
||||
pub disable_color: bool,
|
||||
|
||||
#[pb(index = 3)]
|
||||
ai_fill_enabled: bool,
|
||||
|
||||
#[pb(index = 4)]
|
||||
generated_options: Vec<SelectOptionPB>,
|
||||
}
|
||||
|
||||
impl From<SingleSelectTypeOption> for SingleSelectTypeOptionPB {
|
||||
@ -222,6 +228,12 @@ impl From<SingleSelectTypeOption> for SingleSelectTypeOptionPB {
|
||||
.map(|option| option.into())
|
||||
.collect(),
|
||||
disable_color: data.disable_color,
|
||||
ai_fill_enabled: data.ai_fill_enabled,
|
||||
generated_options: data
|
||||
.generated_options
|
||||
.into_iter()
|
||||
.map(|option| option.into())
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -235,6 +247,13 @@ impl From<SingleSelectTypeOptionPB> for SingleSelectTypeOption {
|
||||
.map(|option| option.into())
|
||||
.collect(),
|
||||
disable_color: data.disable_color,
|
||||
version: 1,
|
||||
ai_fill_enabled: data.ai_fill_enabled,
|
||||
generated_options: data
|
||||
.generated_options
|
||||
.into_iter()
|
||||
.map(|option| option.into())
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ impl SelectOption {
|
||||
impl From<AnyMap> for SelectOption {
|
||||
fn from(map: AnyMap) -> Self {
|
||||
SelectOption {
|
||||
id: map.get_str("id").unwrap_or_default(),
|
||||
name: map.get_str("name").unwrap_or_default(),
|
||||
id: map.get_str_value("id").unwrap_or_default(),
|
||||
name: map.get_str_value("name").unwrap_or_default(),
|
||||
color: SelectOptionColor::from(map.get_i64_value("color").unwrap_or(0)),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user