mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Removed will_umount from components
This commit is contained in:
@@ -259,15 +259,6 @@ impl Component for FileList {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
fn should_umount(&self) -> bool {
|
|
||||||
// Never true
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component; basically remove focus
|
/// Blur component; basically remove focus
|
||||||
@@ -314,8 +305,6 @@ mod tests {
|
|||||||
// Increment list index
|
// Increment list index
|
||||||
component.states.list_index += 1;
|
component.states.list_index += 1;
|
||||||
assert_eq!(component.render().unwrap().cursor, 1);
|
assert_eq!(component.render().unwrap().cursor, 1);
|
||||||
// Should umount
|
|
||||||
assert_eq!(component.should_umount(), false);
|
|
||||||
// Update
|
// Update
|
||||||
component.update(
|
component.update(
|
||||||
component
|
component
|
||||||
|
|||||||
@@ -282,15 +282,6 @@ impl Component for Input {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
/// This component never umounts
|
|
||||||
fn should_umount(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component; basically remove focus
|
/// Blur component; basically remove focus
|
||||||
@@ -332,8 +323,6 @@ mod tests {
|
|||||||
assert_eq!(component.states.focus, true);
|
assert_eq!(component.states.focus, true);
|
||||||
component.blur();
|
component.blur();
|
||||||
assert_eq!(component.states.focus, false);
|
assert_eq!(component.states.focus, false);
|
||||||
// Should umount
|
|
||||||
assert_eq!(component.should_umount(), false);
|
|
||||||
// Get value
|
// Get value
|
||||||
assert_eq!(component.get_value(), Payload::Text(String::from("home")));
|
assert_eq!(component.get_value(), Payload::Text(String::from("home")));
|
||||||
// Render
|
// Render
|
||||||
|
|||||||
@@ -267,15 +267,6 @@ impl Component for LogBox {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
fn should_umount(&self) -> bool {
|
|
||||||
// Never true
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component; basically remove focus
|
/// Blur component; basically remove focus
|
||||||
@@ -327,8 +318,6 @@ mod tests {
|
|||||||
// Increment list index
|
// Increment list index
|
||||||
component.states.list_index -= 1;
|
component.states.list_index -= 1;
|
||||||
assert_eq!(component.render().unwrap().cursor, 0);
|
assert_eq!(component.render().unwrap().cursor, 0);
|
||||||
// Should umount
|
|
||||||
assert_eq!(component.should_umount(), false);
|
|
||||||
// Update
|
// Update
|
||||||
component.update(
|
component.update(
|
||||||
component
|
component
|
||||||
|
|||||||
@@ -154,15 +154,6 @@ impl Component for ProgressBar {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
/// Always false for this component
|
|
||||||
fn should_umount(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component
|
/// Blur component
|
||||||
@@ -202,8 +193,6 @@ mod tests {
|
|||||||
assert_eq!(component.states.focus, true);
|
assert_eq!(component.states.focus, true);
|
||||||
component.blur();
|
component.blur();
|
||||||
assert_eq!(component.states.focus, false);
|
assert_eq!(component.states.focus, false);
|
||||||
// Should umount
|
|
||||||
assert_eq!(component.should_umount(), false);
|
|
||||||
// Get value
|
// Get value
|
||||||
assert_eq!(component.get_value(), Payload::None);
|
assert_eq!(component.get_value(), Payload::None);
|
||||||
// Render
|
// Render
|
||||||
|
|||||||
@@ -237,15 +237,6 @@ impl Component for RadioGroup {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
/// Always false for this component
|
|
||||||
fn should_umount(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component; basically remove focus
|
/// Blur component; basically remove focus
|
||||||
@@ -294,8 +285,6 @@ mod tests {
|
|||||||
assert_eq!(component.states.focus, true);
|
assert_eq!(component.states.focus, true);
|
||||||
component.blur();
|
component.blur();
|
||||||
assert_eq!(component.states.focus, false);
|
assert_eq!(component.states.focus, false);
|
||||||
// Should umount
|
|
||||||
assert_eq!(component.should_umount(), false);
|
|
||||||
// Get value
|
// Get value
|
||||||
assert_eq!(component.get_value(), Payload::Unsigned(1));
|
assert_eq!(component.get_value(), Payload::Unsigned(1));
|
||||||
// Render
|
// Render
|
||||||
|
|||||||
@@ -167,15 +167,6 @@ impl Component for Table {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
/// Always false for this component
|
|
||||||
fn should_umount(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component
|
/// Blur component
|
||||||
@@ -221,8 +212,6 @@ mod tests {
|
|||||||
assert_eq!(component.states.focus, true);
|
assert_eq!(component.states.focus, true);
|
||||||
component.blur();
|
component.blur();
|
||||||
assert_eq!(component.states.focus, false);
|
assert_eq!(component.states.focus, false);
|
||||||
// Should umount
|
|
||||||
assert_eq!(component.should_umount(), false);
|
|
||||||
// Get value
|
// Get value
|
||||||
assert_eq!(component.get_value(), Payload::None);
|
assert_eq!(component.get_value(), Payload::None);
|
||||||
// Render
|
// Render
|
||||||
|
|||||||
@@ -150,15 +150,6 @@ impl Component for Text {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
/// Always false for this component
|
|
||||||
fn should_umount(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component
|
/// Blur component
|
||||||
@@ -206,8 +197,6 @@ mod tests {
|
|||||||
assert_eq!(component.states.focus, true);
|
assert_eq!(component.states.focus, true);
|
||||||
component.blur();
|
component.blur();
|
||||||
assert_eq!(component.states.focus, false);
|
assert_eq!(component.states.focus, false);
|
||||||
// Should umount
|
|
||||||
assert_eq!(component.should_umount(), false);
|
|
||||||
// Get value
|
// Get value
|
||||||
assert_eq!(component.get_value(), Payload::None);
|
assert_eq!(component.get_value(), Payload::None);
|
||||||
// Render
|
// Render
|
||||||
|
|||||||
@@ -111,12 +111,6 @@ pub trait Component {
|
|||||||
|
|
||||||
// -- events
|
// -- events
|
||||||
|
|
||||||
/// ### should_umount
|
|
||||||
///
|
|
||||||
/// The component must provide to the supervisor whether it should be umounted (destroyed)
|
|
||||||
/// This makes sense to be called after an `on` or after an `update`, where the states changes.
|
|
||||||
fn should_umount(&self) -> bool;
|
|
||||||
|
|
||||||
/// ### blur
|
/// ### blur
|
||||||
///
|
///
|
||||||
/// Blur component; basically remove focus
|
/// Blur component; basically remove focus
|
||||||
|
|||||||
Reference in New Issue
Block a user