Removed old code.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
parent
586ccd99bd
commit
a326c1c262
@ -1139,8 +1139,6 @@ mod fields {
|
|||||||
struct FieldSetting {
|
struct FieldSetting {
|
||||||
fieldtype: FieldType,
|
fieldtype: FieldType,
|
||||||
default_value: Option<Calculation>,
|
default_value: Option<Calculation>,
|
||||||
// use_default: bool,
|
|
||||||
// default_value: Field,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FieldSetting {
|
impl FieldSetting {
|
||||||
@ -1148,8 +1146,6 @@ impl FieldSetting {
|
|||||||
Self {
|
Self {
|
||||||
fieldtype: ftype,
|
fieldtype: ftype,
|
||||||
default_value: None,
|
default_value: None,
|
||||||
// use_default: false,
|
|
||||||
// default_value: Field::None,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1163,23 +1159,6 @@ impl FieldSetting {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
fn set_default(&mut self, value: Option<Field>) -> Result<(), MTTError> {
|
|
||||||
match value {
|
|
||||||
Some(data) => {
|
|
||||||
match self.validate(Some(data.clone())) {
|
|
||||||
Ok(_) => {}
|
|
||||||
Err(err) => return Err(err),
|
|
||||||
}
|
|
||||||
self.default_value = data.clone();
|
|
||||||
}
|
|
||||||
None => self.default_value = Field::None,
|
|
||||||
}
|
|
||||||
self.use_default = true;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
fn validate(&self, value: Option<Field>) -> Result<Field, MTTError> {
|
fn validate(&self, value: Option<Field>) -> Result<Field, MTTError> {
|
||||||
match value {
|
match value {
|
||||||
Some(data) => {
|
Some(data) => {
|
||||||
@ -1197,16 +1176,6 @@ impl FieldSetting {
|
|||||||
Some(calc) => Ok(calc.calculate()),
|
Some(calc) => Ok(calc.calculate()),
|
||||||
None => Err(MTTError::DocumentFieldMissing("".to_string())),
|
None => Err(MTTError::DocumentFieldMissing("".to_string())),
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if self.use_default {
|
|
||||||
match self.default_value {
|
|
||||||
Field::None => Ok(self.fieldtype.get_default()),
|
|
||||||
_ => Ok(self.default_value.clone()),
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Err(MTTError::DocumentFieldMissing("".to_string()))
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user