GUI plugins #9
1 changed files with 5 additions and 5 deletions
pinakes-plugin-api: add reserved-route and required-endpoint validation
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Id85a7e729b26af8eb028e19418a5a1706a6a6964
commit
7989d4c4dd
|
|
@ -801,11 +801,6 @@ impl UiElement {
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Self::Form { fields, .. } if fields.is_empty() => {
|
|
||||||
return Err(SchemaError::ValidationError(
|
|
||||||
"Form must have at least one field".to_string(),
|
|
||||||
));
|
|
||||||
},
|
|
||||||
Self::Chart { data, .. } if !page.data_sources.contains_key(data) => {
|
Self::Chart { data, .. } if !page.data_sources.contains_key(data) => {
|
||||||
return Err(SchemaError::ValidationError(format!(
|
return Err(SchemaError::ValidationError(format!(
|
||||||
"Chart references unknown data source: {data}"
|
"Chart references unknown data source: {data}"
|
||||||
|
|
@ -867,6 +862,11 @@ impl UiElement {
|
||||||
submit_action,
|
submit_action,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
|
if fields.is_empty() {
|
||||||
|
return Err(SchemaError::ValidationError(
|
||||||
|
"Form must have at least one field".to_string(),
|
||||||
|
));
|
||||||
|
}
|
||||||
for field in fields {
|
for field in fields {
|
||||||
validate_id(&field.id)?;
|
validate_id(&field.id)?;
|
||||||
if field.label.is_empty() {
|
if field.label.is_empty() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue