Added the ON_blank message.
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
7099e91f9d
commit
b665e63ad5
@ -2411,22 +2411,32 @@ mod additions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
enum OnType {
|
enum OnType {
|
||||||
Query,
|
Query,
|
||||||
Update,
|
Update,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
struct On;
|
struct On {
|
||||||
|
on_type: OnType,
|
||||||
|
oids: HashSet<Oid>,
|
||||||
|
}
|
||||||
|
|
||||||
impl On {
|
impl On {
|
||||||
fn new(on_type: OnType) -> Self {
|
fn new(on_type: OnType, oids: HashSet<Oid>) -> Self {
|
||||||
Self {}
|
Self {
|
||||||
|
on_type: on_type,
|
||||||
|
oids: oids,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_type(&self) -> &OnType {
|
fn get_type(&self) -> &OnType {
|
||||||
&OnType::Query
|
&self.on_type
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_oids(&self) -> &HashSet<Oid> {
|
||||||
|
&self.oids
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2435,14 +2445,17 @@ mod ons {
|
|||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
|
||||||
fn can_create_on_action() {
|
fn can_create_on_action() {
|
||||||
let value = OnType::Update;
|
let count = 5;
|
||||||
let on = On::new(value.clone());
|
let values = [OnType::Query, OnType::Update];
|
||||||
let on_type = on.get_type();
|
for on_type in values.iter() {
|
||||||
match on_type {
|
let mut oids: HashSet<Oid> = HashSet::new();
|
||||||
OnType::Update => {},
|
while oids.len() < count {
|
||||||
_ => unreachable!("got {:?}, should have been update", on_type),
|
oids.insert(Oid::new());
|
||||||
|
}
|
||||||
|
let result = On::new(on_type.clone(), oids.clone());
|
||||||
|
assert_eq!(result.get_type(), on_type);
|
||||||
|
assert_eq!(result.get_oids(), &oids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2965,13 +2978,11 @@ impl Calculation {
|
|||||||
}
|
}
|
||||||
let mut base = self.get_type();
|
let mut base = self.get_type();
|
||||||
match self.operation {
|
match self.operation {
|
||||||
Operand::Add => {
|
Operand::Add => match base {
|
||||||
match base {
|
|
||||||
FieldType::DateTime => base = FieldType::Duration,
|
FieldType::DateTime => base = FieldType::Duration,
|
||||||
_ => {},
|
_ => {}
|
||||||
}
|
},
|
||||||
}
|
_ => {}
|
||||||
_ => {},
|
|
||||||
}
|
}
|
||||||
let ftype = holder.get_type();
|
let ftype = holder.get_type();
|
||||||
if base == ftype {
|
if base == ftype {
|
||||||
@ -4338,12 +4349,6 @@ impl DocumentFile {
|
|||||||
}
|
}
|
||||||
records.into()
|
records.into()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
for (field_id, value) in addition.iter() {
|
for (field_id, value) in addition.iter() {
|
||||||
let id = match self.docdef.get_field_id(field_id) {
|
let id = match self.docdef.get_field_id(field_id) {
|
||||||
@ -4504,8 +4509,6 @@ impl DocumentFile {
|
|||||||
}
|
}
|
||||||
output.into()
|
output.into()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
let mut changes: HashMap<Uuid, Field> = HashMap::new();
|
let mut changes: HashMap<Uuid, Field> = HashMap::new();
|
||||||
for (key, value) in update.get_values().iter() {
|
for (key, value) in update.get_values().iter() {
|
||||||
@ -5197,7 +5200,7 @@ mod document_files {
|
|||||||
let action = result.get_action();
|
let action = result.get_action();
|
||||||
match action {
|
match action {
|
||||||
MsgAction::Error(data) => match data {
|
MsgAction::Error(data) => match data {
|
||||||
MTTError::FieldInvalidType => {},
|
MTTError::FieldInvalidType => {}
|
||||||
_ => unreachable!("got {:?}: should been invalid field type", data),
|
_ => unreachable!("got {:?}: should been invalid field type", data),
|
||||||
},
|
},
|
||||||
_ => unreachable!("got {:?}: should have been a error", action),
|
_ => unreachable!("got {:?}: should have been a error", action),
|
||||||
@ -5330,7 +5333,8 @@ mod document_files {
|
|||||||
doc.populate([id.into(), old.into()].to_vec());
|
doc.populate([id.into(), old.into()].to_vec());
|
||||||
let mut update = Update::new();
|
let mut update = Update::new();
|
||||||
let mut calc = Calculation::new(Operand::Equal);
|
let mut calc = Calculation::new(Operand::Equal);
|
||||||
calc.add_value(CalcValue::Existing(FieldType::Uuid)).unwrap();
|
calc.add_value(CalcValue::Existing(FieldType::Uuid))
|
||||||
|
.unwrap();
|
||||||
calc.add_value(id.clone()).unwrap();
|
calc.add_value(id.clone()).unwrap();
|
||||||
update.get_query_mut().add(Name::english("field0"), calc);
|
update.get_query_mut().add(Name::english("field0"), calc);
|
||||||
update
|
update
|
||||||
@ -5371,7 +5375,8 @@ mod document_files {
|
|||||||
let mut update = Update::new();
|
let mut update = Update::new();
|
||||||
let mut calc = Calculation::new(Operand::Equal);
|
let mut calc = Calculation::new(Operand::Equal);
|
||||||
calc.add_value(picked.clone()).unwrap();
|
calc.add_value(picked.clone()).unwrap();
|
||||||
calc.add_value(CalcValue::Existing(FieldType::Integer)).unwrap();
|
calc.add_value(CalcValue::Existing(FieldType::Integer))
|
||||||
|
.unwrap();
|
||||||
update.get_query_mut().add(Name::english("field0"), calc);
|
update.get_query_mut().add(Name::english("field0"), calc);
|
||||||
update
|
update
|
||||||
.get_values_mut()
|
.get_values_mut()
|
||||||
@ -5426,7 +5431,8 @@ mod document_files {
|
|||||||
let mut update = Update::new();
|
let mut update = Update::new();
|
||||||
let mut calc = Calculation::new(Operand::Equal);
|
let mut calc = Calculation::new(Operand::Equal);
|
||||||
calc.add_value(picked.clone()).unwrap();
|
calc.add_value(picked.clone()).unwrap();
|
||||||
calc.add_value(CalcValue::Existing(FieldType::Integer)).unwrap();
|
calc.add_value(CalcValue::Existing(FieldType::Integer))
|
||||||
|
.unwrap();
|
||||||
update.get_query_mut().add(Name::english("field0"), calc);
|
update.get_query_mut().add(Name::english("field0"), calc);
|
||||||
update
|
update
|
||||||
.get_values_mut()
|
.get_values_mut()
|
||||||
@ -5658,7 +5664,8 @@ mod document_files {
|
|||||||
let mut update = Update::new();
|
let mut update = Update::new();
|
||||||
let mut calc = Calculation::new(Operand::Equal);
|
let mut calc = Calculation::new(Operand::Equal);
|
||||||
calc.add_value(data).unwrap();
|
calc.add_value(data).unwrap();
|
||||||
calc.add_value(CalcValue::Existing(FieldType::StaticString)).unwrap();
|
calc.add_value(CalcValue::Existing(FieldType::StaticString))
|
||||||
|
.unwrap();
|
||||||
update.get_query_mut().add(&f1name, calc);
|
update.get_query_mut().add(&f1name, calc);
|
||||||
update.get_values_mut().add_field(&f0name, holder.clone());
|
update.get_values_mut().add_field(&f0name, holder.clone());
|
||||||
doc.send(update).unwrap();
|
doc.send(update).unwrap();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user