feat(tui): remove label from repo identity widget
All checks were successful
Rust / build (push) Successful in 10m11s
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
Release Please / Release-plz (push) Successful in 2m1s
All checks were successful
Rust / build (push) Successful in 10m11s
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
Release Please / Release-plz (push) Successful in 2m1s
This commit is contained in:
parent
9720fd01fc
commit
be41842dae
2 changed files with 1 additions and 10 deletions
|
@ -10,7 +10,6 @@ use ratatui::{
|
|||
use crate::tui::actor::RepoMessage;
|
||||
|
||||
pub struct Identity<'a> {
|
||||
pub label: &'a str,
|
||||
pub repo_alias: &'a RepoAlias,
|
||||
pub alert: Option<&'a str>,
|
||||
pub message: &'a RepoMessage,
|
||||
|
@ -18,14 +17,12 @@ pub struct Identity<'a> {
|
|||
}
|
||||
impl<'a> Identity<'a> {
|
||||
pub const fn new(
|
||||
label: &'a str,
|
||||
repo_alias: &'a RepoAlias,
|
||||
alert: Option<&'a str>,
|
||||
message: &'a RepoMessage,
|
||||
repo_branches: Option<&'a RepoBranches>,
|
||||
) -> Self {
|
||||
Self {
|
||||
label,
|
||||
repo_alias,
|
||||
alert,
|
||||
message,
|
||||
|
@ -35,7 +32,6 @@ impl<'a> Identity<'a> {
|
|||
}
|
||||
impl<'a> Identity<'a> {
|
||||
fn spans(self) -> Vec<Span<'a>> {
|
||||
let label = self.label;
|
||||
let repo_alias = Span::from(self.repo_alias.to_string()).style(if self.alert.is_some() {
|
||||
Style::default().fg(Color::Black).bg(Color::Red)
|
||||
} else {
|
||||
|
@ -62,7 +58,7 @@ impl<'a> Identity<'a> {
|
|||
vec![
|
||||
" ".into(),
|
||||
repo_alias,
|
||||
format!(" ({label}) ").into(),
|
||||
" ".into(),
|
||||
alert,
|
||||
format!("({main}/{next}/{dev}) [").into(),
|
||||
message.into(),
|
||||
|
|
|
@ -39,7 +39,6 @@ impl<'a> RepoWidget<'a> {
|
|||
message,
|
||||
alert,
|
||||
} => InnerRepoWidget {
|
||||
label: "identified",
|
||||
repo_alias,
|
||||
message,
|
||||
alert: alert.as_ref().map(String::as_str),
|
||||
|
@ -54,7 +53,6 @@ impl<'a> RepoWidget<'a> {
|
|||
branches,
|
||||
log,
|
||||
} => InnerRepoWidget {
|
||||
label: "configured",
|
||||
repo_alias,
|
||||
message,
|
||||
alert: alert.as_ref().map(String::as_str),
|
||||
|
@ -74,7 +72,6 @@ impl<'a> RepoWidget<'a> {
|
|||
// dev,
|
||||
..
|
||||
} => InnerRepoWidget {
|
||||
label: "ready",
|
||||
repo_alias,
|
||||
message,
|
||||
alert: alert.as_ref().map(String::as_str),
|
||||
|
@ -98,7 +95,6 @@ impl<'a> Widget for RepoWidget<'a> {
|
|||
}
|
||||
|
||||
struct InnerRepoWidget<'a> {
|
||||
pub label: &'a str,
|
||||
pub repo_alias: &'a RepoAlias,
|
||||
pub message: &'a RepoMessage,
|
||||
pub alert: Option<&'a str>,
|
||||
|
@ -123,7 +119,6 @@ impl<'a> Widget for InnerRepoWidget<'a> {
|
|||
{
|
||||
let block = Block::default()
|
||||
.title(Identity::new(
|
||||
self.label,
|
||||
self.repo_alias,
|
||||
self.alert,
|
||||
self.message,
|
||||
|
|
Loading…
Reference in a new issue