Skip to content

Commit

Permalink
Workflows now accept not having an end user
Browse files Browse the repository at this point in the history
  • Loading branch information
Lut99 committed Oct 21, 2024
1 parent 3d0d3bf commit 3762d65
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/workflow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created:
// 08 Oct 2024, 16:16:26
// Last edited:
// 19 Oct 2024, 10:50:29
// 21 Oct 2024, 13:32:08
// Auto updated?
// Yes
//
Expand Down Expand Up @@ -86,7 +86,7 @@ pub struct Workflow {
pub start: Elem,

/// The user instigating this workflow (and thus getting the result, if any).
pub user: Entity,
pub user: Option<Entity>,
/// The metadata associated with this workflow as a whole.
pub metadata: Vec<Metadata>,
/// The signature verifying this workflow. If present, it's given as a pair of the person signing it and their signature.
Expand Down
4 changes: 2 additions & 2 deletions lib/workflow/src/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created:
// 08 Oct 2024, 17:34:14
// Last edited:
// 14 Oct 2024, 11:55:52
// 21 Oct 2024, 13:32:24
// Auto updated?
// Yes
//
Expand All @@ -28,7 +28,7 @@ mod tests {
/// Generates a workflow with minimal info
#[inline]
fn gen_wf(id: impl Into<String>, start: impl Into<Elem>) -> Workflow {
Workflow { id: id.into(), start: start.into(), user: Entity { id: "amy".into() }, metadata: vec![], signature: None }
Workflow { id: id.into(), start: start.into(), user: Some(Entity { id: "amy".into() }), metadata: vec![], signature: None }
}

/// Generates a branch.
Expand Down
4 changes: 2 additions & 2 deletions lib/workflow/src/visualize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created:
// 31 Oct 2023, 14:30:00
// Last edited:
// 08 Oct 2024, 18:15:02
// 21 Oct 2024, 13:33:05
// Auto updated?
// Yes
//
Expand Down Expand Up @@ -170,7 +170,7 @@ impl<'w> Display for WorkflowFormatter<'w> {
// Print global metadata
if !self.wf.metadata.is_empty() {
writeln!(f, "{} - id : {:?}", Indent(4), self.wf.id)?;
writeln!(f, "{} - user : {:?}", Indent(4), self.wf.user.id)?;
writeln!(f, "{} - user : {:?}", Indent(4), self.wf.user.as_ref().map(|ent| &ent.id))?;
writeln!(
f,
"{} - metadata: {:?}",
Expand Down

0 comments on commit 3762d65

Please sign in to comment.