mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 18:40:46 +08:00
patch-select: Fix operations
This commit is contained in:
@@ -66,7 +66,6 @@ pub enum Subject {
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
|
||||
pub enum PatchOperation {
|
||||
Show,
|
||||
Update,
|
||||
Checkout,
|
||||
Review,
|
||||
Delete,
|
||||
@@ -80,9 +79,6 @@ impl Display for PatchOperation {
|
||||
PatchOperation::Show => {
|
||||
write!(f, "show")
|
||||
}
|
||||
PatchOperation::Update => {
|
||||
write!(f, "update")
|
||||
}
|
||||
PatchOperation::Checkout => {
|
||||
write!(f, "checkout")
|
||||
}
|
||||
|
||||
@@ -111,13 +111,6 @@ impl tuirealm::Component<Message, NoUserEvent> for Widget<OperationSelect> {
|
||||
let output = Output::new(Some(PatchOperation::Show), PatchId::from(id));
|
||||
Message::Quit(Some(output))
|
||||
}),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('u'),
|
||||
..
|
||||
}) => submit().map(|id| {
|
||||
let output = Output::new(Some(PatchOperation::Update), PatchId::from(id));
|
||||
Message::Quit(Some(output))
|
||||
}),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('c'),
|
||||
..
|
||||
@@ -125,6 +118,13 @@ impl tuirealm::Component<Message, NoUserEvent> for Widget<OperationSelect> {
|
||||
let output = Output::new(Some(PatchOperation::Checkout), PatchId::from(id));
|
||||
Message::Quit(Some(output))
|
||||
}),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('r'),
|
||||
..
|
||||
}) => submit().map(|id| {
|
||||
let output = Output::new(Some(PatchOperation::Review), PatchId::from(id));
|
||||
Message::Quit(Some(output))
|
||||
}),
|
||||
Event::Keyboard(KeyEvent {
|
||||
code: Key::Char('d'),
|
||||
..
|
||||
|
||||
@@ -92,7 +92,6 @@ impl OperationSelect {
|
||||
vec![
|
||||
tui::ui::shortcut(&self.theme, "↑/↓", "navigate"),
|
||||
tui::ui::shortcut(&self.theme, "enter", "show"),
|
||||
tui::ui::shortcut(&self.theme, "u", "update"),
|
||||
tui::ui::shortcut(&self.theme, "c", "checkout"),
|
||||
tui::ui::shortcut(&self.theme, "r", "review"),
|
||||
tui::ui::shortcut(&self.theme, "d", "delete"),
|
||||
|
||||
Reference in New Issue
Block a user