add summary field for modules

This commit is contained in:
Ruben Fiszel
2022-08-06 23:37:17 +02:00
parent b1216c5615
commit fbe878407c
3 changed files with 8 additions and 0 deletions
+5
View File
@@ -81,6 +81,7 @@ pub struct FlowModule {
pub value: FlowModuleValue,
pub stop_after_if_expr: Option<String>,
pub skip_if_stopped: Option<bool>,
pub summary: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
@@ -422,6 +423,7 @@ mod tests {
value: FlowModuleValue::Script { path: "test".to_string() },
stop_after_if_expr: None,
skip_if_stopped: Some(false),
summary: None,
},
FlowModule {
input_transform: HashMap::new(),
@@ -432,6 +434,7 @@ mod tests {
}),
stop_after_if_expr: Some("foo = 'bar'".to_string()),
skip_if_stopped: None,
summary: None,
},
FlowModule {
input_transform: [(
@@ -446,6 +449,7 @@ mod tests {
},
stop_after_if_expr: Some("previous.isEmpty()".to_string()),
skip_if_stopped: None,
summary: None,
},
],
failure_module: Some(FlowModule {
@@ -453,6 +457,7 @@ mod tests {
value: FlowModuleValue::Flow { path: "test".to_string() },
stop_after_if_expr: Some("previous.isEmpty()".to_string()),
skip_if_stopped: None,
summary: None,
}),
};
println!("{}", serde_json::json!(fv).to_string());
@@ -108,6 +108,7 @@
</div>
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4 w-full">
<div class="w-full">
<span class="text-black">{mod?.summary ?? ''}</span>
<p class="text-sm text-gray-500">
{#if mod?.value?.type == 'script'}
Script at path <a
+2
View File
@@ -58,6 +58,8 @@ components:
type: string
skip_if_stopped:
type: boolean
summary:
type: string
required:
- input_transform
- value