Skip to content

Commit

Permalink
issue: Adjust available operations
Browse files Browse the repository at this point in the history
  • Loading branch information
erak committed Mar 5, 2024
1 parent 6ee251a commit 4339e29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
14 changes: 3 additions & 11 deletions bin/commands/issue/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,18 @@ pub enum Mode {
/// selection widget.
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub enum IssueOperation {
Show,
Delete,
Edit,
Comment,
Show,
}

impl Display for IssueOperation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
IssueOperation::Show => {
write!(f, "show")
}
IssueOperation::Delete => {
write!(f, "delete")
}
IssueOperation::Edit => {
write!(f, "edit")
}
IssueOperation::Comment => {
write!(f, "comment")
IssueOperation::Show => {
write!(f, "show")
}
}
}
Expand Down
22 changes: 0 additions & 22 deletions bin/commands/issue/flux/select/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,6 @@ impl Widget<IssuesState, Action> for ListPage {
});
}
}
Key::Char('c') => {
if let Some(selected) = &self.props.selected {
let _ = self.action_tx.send(Action::Exit {
selection: Some(Selection {
operation: Some(IssueOperation::Comment.to_string()),
ids: vec![selected.id],
args: vec![],
}),
});
}
}
Key::Char('e') => {
if let Some(selected) = &self.props.selected {
let _ = self.action_tx.send(Action::Exit {
Expand All @@ -124,17 +113,6 @@ impl Widget<IssuesState, Action> for ListPage {
});
}
}
Key::Char('d') => {
if let Some(selected) = &self.props.selected {
let _ = self.action_tx.send(Action::Exit {
selection: Some(Selection {
operation: Some(IssueOperation::Delete.to_string()),
ids: vec![selected.id],
args: vec![],
}),
});
}
}
_ => {
<Issues as Widget<IssuesState, Action>>::handle_key_event(&mut self.issues, key);
}
Expand Down

0 comments on commit 4339e29

Please sign in to comment.