feat(oa): allow dept and ownerDept in condition publish whitelist
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
86dd605ac5
commit
d2de132853
2 files changed
+43
No files matched your search
@@ -357,6 +357,47 @@ class TestConditionPublish(unittest.TestCase):
|
||||
)
|
||||
self.assertTrue(any("发起人" in e and "包含" in e for e in errs))
|
||||
|
||||
def test_dept_condition_field_allowed(self):
|
||||
errs = validate_condition_rules_against_form(
|
||||
{
|
||||
"rule": [
|
||||
{
|
||||
"type": "dept",
|
||||
"field": "Fdept",
|
||||
"title": "部门",
|
||||
"useInCondition": True,
|
||||
"$required": True,
|
||||
"props": {"multiple": True},
|
||||
}
|
||||
]
|
||||
},
|
||||
_condition_flow(
|
||||
rules=[
|
||||
{"field": "Fdept", "op": "contains", "value": ["d1", "d2"]}
|
||||
]
|
||||
),
|
||||
)
|
||||
self.assertEqual(errs, [])
|
||||
|
||||
def test_owner_dept_condition_field_allowed(self):
|
||||
errs = validate_condition_rules_against_form(
|
||||
{
|
||||
"rule": [
|
||||
{
|
||||
"type": "ownerDept",
|
||||
"field": "Fod",
|
||||
"title": "归属部门",
|
||||
"useInCondition": True,
|
||||
"$required": True,
|
||||
}
|
||||
]
|
||||
},
|
||||
_condition_flow(
|
||||
rules=[{"field": "Fod", "op": "contains", "value": ["d1"]}]
|
||||
),
|
||||
)
|
||||
self.assertEqual(errs, [])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user