use once_cell::sync::Lazy; use crate::models::{Dimension, Marker, MarkerPlacement, RepositoryConfiguration}; /// Pre-configured repository configuration for task management. #[allow(non_upper_case_globals)] pub static TaskConfiguration: Lazy = Lazy::new(|| { RepositoryConfiguration::new() .with_dimension( "task", Dimension::new("Task") .with_comment( "If placed, the given shard is a task. The placement determines the state.", ) .with_propagate(false), ) .with_dimension( "project", Dimension::new("Project") .with_comment("Project the task is attached to") .with_propagate(true), ) .with_marker( "Task", Marker::new("Task").with_placements(vec![ MarkerPlacement::new("task").with_value("open"), MarkerPlacement::new("task") .with_if_with(vec!["Done"]) .with_value("done"), MarkerPlacement::new("task") .with_if_with(vec!["Waiting"]) .with_value("waiting"), MarkerPlacement::new("task") .with_if_with(vec!["Cancelled"]) .with_value("cancelled"), MarkerPlacement::new("task") .with_if_with(vec!["NotDone"]) .with_value("cancelled"), ]), ) .with_marker( "WaitingFor", Marker::new("Task") .with_placements(vec![MarkerPlacement::new("task").with_value("waiting")]), ) });