diff --git a/src/app.rs b/src/app.rs index 30ebdecd..3e814058 100644 --- a/src/app.rs +++ b/src/app.rs @@ -330,13 +330,13 @@ impl App { &mut self, title: String, description: String, - tags: String, + labels: String, assignees: String, ) -> Result { let repository = self.context.repository(); let signer = self.context.signer(); - let tags = cob::parse_tags(tags)?; + let labels = cob::parse_labels(labels)?; let assignees = cob::parse_assignees(assignees)?; cob::issue::create( @@ -344,7 +344,7 @@ impl App { signer, title, description, - tags.as_slice(), + labels.as_slice(), assignees.as_slice(), ) } diff --git a/src/cob.rs b/src/cob.rs index 4f7469ba..059fac5f 100644 --- a/src/cob.rs +++ b/src/cob.rs @@ -1,31 +1,33 @@ use std::str::FromStr; use anyhow::Result; -use radicle::cob::{ActorId, Tag}; + +use radicle::cob::Label; +use radicle::prelude::Did; pub mod issue; pub mod patch; -pub fn parse_tags(input: String) -> Result> { - let mut tags = vec![]; +pub fn parse_labels(input: String) -> Result> { + let mut labels = vec![]; if !input.is_empty() { for name in input.split(',') { - match Tag::new(name.trim()) { - Ok(tag) => tags.push(tag), - Err(err) => return Err(anyhow::anyhow!(err).context("Can't parse tags.")), + match Label::new(name.trim()) { + Ok(label) => labels.push(label), + Err(err) => return Err(anyhow::anyhow!(err).context("Can't parse labels.")), } } } - Ok(tags) + Ok(labels) } -pub fn parse_assignees(input: String) -> Result> { +pub fn parse_assignees(input: String) -> Result> { let mut assignees = vec![]; if !input.is_empty() { for did in input.split(',') { - match ActorId::from_str(did) { - Ok(actor) => assignees.push(actor), + match Did::from_str(did) { + Ok(did) => assignees.push(did), Err(err) => return Err(anyhow::anyhow!(err).context("Can't parse assignees.")), } } diff --git a/src/cob/issue.rs b/src/cob/issue.rs index 70be7a86..00c46661 100644 --- a/src/cob/issue.rs +++ b/src/cob/issue.rs @@ -1,7 +1,7 @@ use anyhow::Result; use radicle::cob::issue::{Issue, IssueId, Issues}; -use radicle::cob::{ActorId, Tag}; -use radicle::prelude::Signer; +use radicle::cob::Label; +use radicle::prelude::{Did, Signer}; use radicle::storage::git::Repository; pub fn all(repository: &Repository) -> Result> { @@ -25,11 +25,11 @@ pub fn create( signer: &G, title: String, description: String, - tags: &[Tag], - assignees: &[ActorId], + labels: &[Label], + assignees: &[Did], ) -> Result { let mut issues = Issues::open(repository)?; - let issue = issues.create(title, description.trim(), tags, assignees, signer)?; + let issue = issues.create(title, description.trim(), labels, assignees, signer)?; Ok(*issue.id()) } diff --git a/src/ui/widget/issue.rs b/src/ui/widget/issue.rs index ccd68830..b048b92d 100644 --- a/src/ui/widget/issue.rs +++ b/src/ui/widget/issue.rs @@ -109,7 +109,7 @@ impl IssueHeader { ); let labels = Property::new( - common::label("Tags").foreground(theme.colors.property_name_fg), + common::label("Labels").foreground(theme.colors.property_name_fg), common::label(&cob::format_labels(item.labels())) .foreground(theme.colors.browser_list_labels), ); @@ -263,7 +263,7 @@ impl NewForm { use tuirealm::props::Layout; let title = Widget::new(TextInput::new(theme.clone(), "Title")); - let tags = Widget::new(TextInput::new(theme.clone(), "Tags (tag1, tag2, ...)")); + let tags = Widget::new(TextInput::new(theme.clone(), "Labels (bug, ...)")); let assignees = Widget::new(TextInput::new( theme.clone(), "Assignees (z6MkvAdxCp1oLVVTsqYvev9YrhSN3gBQNUSM45hhy4pgkexk, ...)",