Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
issue: Adjust available operations
Erik Kundt committed 2 years ago
commit 4339e29e2f0de4d404e8bd08e0e8a7dc178b154b
parent 6ee251af09584ff7c3a94d8df68c95ae64f70660
2 files changed +3 -33
modified bin/commands/issue/common.rs
@@ -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")
            }
        }
    }
modified bin/commands/issue/flux/select/ui.rs
@@ -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 {
@@ -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);
            }