|
|
|
@ -1,17 +1,7 @@
|
|
|
|
|
use super::{
|
|
|
|
|
utils::scroll_vertical::VerticalScroll, Component, DatabaseFilterComponent, DrawableComponent,
|
|
|
|
|
EventState,
|
|
|
|
|
};
|
|
|
|
|
use crate::components::command::{self, CommandInfo};
|
|
|
|
|
use crate::config::{Connection, KeyConfig};
|
|
|
|
|
use crate::database::Pool;
|
|
|
|
|
use crate::event::Key;
|
|
|
|
|
use crate::ui::common_nav;
|
|
|
|
|
use crate::ui::scrolllist::draw_list_block;
|
|
|
|
|
use std::{collections::BTreeSet, convert::From};
|
|
|
|
|
|
|
|
|
|
use anyhow::Result;
|
|
|
|
|
use database_tree::{Database, DatabaseTree, DatabaseTreeItem};
|
|
|
|
|
use std::collections::BTreeSet;
|
|
|
|
|
use std::convert::From;
|
|
|
|
|
use tui::{
|
|
|
|
|
backend::Backend,
|
|
|
|
|
layout::{Constraint, Direction, Layout, Rect},
|
|
|
|
@ -21,6 +11,18 @@ use tui::{
|
|
|
|
|
Frame,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
use super::{
|
|
|
|
|
utils::scroll_vertical::VerticalScroll, Component, DatabaseFilterComponent, DrawableComponent,
|
|
|
|
|
EventState,
|
|
|
|
|
};
|
|
|
|
|
use crate::{
|
|
|
|
|
components::command::{self, CommandInfo},
|
|
|
|
|
config::{Connection, KeyConfig},
|
|
|
|
|
database::Pool,
|
|
|
|
|
event::Key,
|
|
|
|
|
ui::{common_nav, scrolllist::draw_list_block},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ▸
|
|
|
|
|
const FOLDER_ICON_COLLAPSED: &str = "\u{25b8}";
|
|
|
|
|
// ▾
|
|
|
|
@ -274,9 +276,10 @@ fn tree_nav(tree: &mut DatabaseTree, key: Key, key_config: &KeyConfig) -> bool {
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
|
mod test {
|
|
|
|
|
use super::{Color, Database, DatabaseTreeItem, DatabasesComponent, Span, Spans, Style};
|
|
|
|
|
use database_tree::Table;
|
|
|
|
|
|
|
|
|
|
use super::{Color, Database, DatabaseTreeItem, DatabasesComponent, Span, Spans, Style};
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_tree_database_tree_item_to_span() {
|
|
|
|
|
const WIDTH: u16 = 10;
|
|
|
|
|