Revision control
Copy as Markdown
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
use crate::{
config::{Component, TeamConfig},
schema::{CustomVariable, CustomVariableSelection, DashboardBuilder},
util::Join,
};
pub fn start_dashboard(config: &TeamConfig) -> DashboardBuilder {
let mut builder = DashboardBuilder::new(
config.team_name.to_string(),
format!("{}-main", config.team_slug()),
);
// Components variable
builder.add_variable(CustomVariable {
label: "Components".into(),
name: "components".into(),
multi: true,
query: config.components.iter().map(Component::slug).join(","),
current: CustomVariableSelection::multi(config.components.iter().map(Component::slug)),
..CustomVariable::default()
});
builder
}