refactor: merge workspace state into app root
This commit is contained in:
@@ -27,13 +27,13 @@ use ui::theme::ActiveTheme as _;
|
||||
use utils::relative_time;
|
||||
|
||||
use super::dialogs;
|
||||
use crate::app::AppRoot;
|
||||
use crate::issues::helpers::{comment_form, comments_section, sidebar_section};
|
||||
use crate::repo::commit_diff::{CommitDiffView, DiffPane};
|
||||
use crate::shared::event_list::commit_list;
|
||||
use crate::shared::log_dropped;
|
||||
use crate::shared::panels::open_detail;
|
||||
use crate::shared::widgets::status_badge;
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
const NOT_FOUND: &str = "Pull request not found";
|
||||
|
||||
@@ -49,7 +49,7 @@ struct PrBinding {
|
||||
}
|
||||
|
||||
pub struct PullRequestDetailView {
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
store: Entity<RepoStore>,
|
||||
pr_id: EventId,
|
||||
update_dialog: Option<Entity<dialogs::update::UpdatePrDialog>>,
|
||||
@@ -72,7 +72,7 @@ pub struct PullRequestDetailView {
|
||||
|
||||
impl PullRequestDetailView {
|
||||
pub fn new(
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
store: Entity<RepoStore>,
|
||||
pr_id: EventId,
|
||||
_window: &mut Window,
|
||||
|
||||
@@ -29,15 +29,15 @@ use helpers::PullRequestFilter;
|
||||
pub use new::NewPullRequestView;
|
||||
pub use send_patch::SendPatchView;
|
||||
|
||||
use crate::app::AppRoot;
|
||||
use crate::issues::helpers::{StatusCounts, filter_by_status};
|
||||
use crate::repo::helpers::short_id;
|
||||
use crate::shared::event_list::{EventHandler, EventList, EventRow, filter_toolbar};
|
||||
use crate::shared::log_dropped;
|
||||
use crate::shared::panels::open_detail;
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
pub struct PullRequestsView {
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
store: Entity<RepoStore>,
|
||||
filter: PullRequestFilter,
|
||||
visible_prs: Vec<usize>,
|
||||
@@ -51,7 +51,7 @@ pub struct PullRequestsView {
|
||||
|
||||
impl PullRequestsView {
|
||||
pub fn new(
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
store: Entity<RepoStore>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Self {
|
||||
|
||||
@@ -23,16 +23,16 @@ use ui::spinner::Spinner;
|
||||
use ui::tabs::{Tab, Tabs};
|
||||
|
||||
use super::helpers::{ForkCompare, truncate_label};
|
||||
use crate::app::AppRoot;
|
||||
use crate::repo::commit_diff::{CommitDiffView, DiffPane};
|
||||
use crate::repo::helpers::announcement_display_name;
|
||||
use crate::shared::event_list::commit_list;
|
||||
use crate::shared::log_dropped;
|
||||
use crate::shared::panels::open_detail;
|
||||
use crate::shared::progress::error_row;
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
pub struct NewPullRequestView {
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
panel_id: SharedString,
|
||||
pub(super) store: Entity<RepoStore>,
|
||||
pub(super) repo_path: Option<PathBuf>,
|
||||
@@ -61,7 +61,7 @@ pub struct NewPullRequestView {
|
||||
|
||||
impl NewPullRequestView {
|
||||
pub fn new(
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
panel_id: SharedString,
|
||||
store: Entity<RepoStore>,
|
||||
window: &mut Window,
|
||||
|
||||
@@ -11,12 +11,12 @@ use ui::input::{Input, InputState};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::theme::ActiveTheme as _;
|
||||
|
||||
use crate::app::AppRoot;
|
||||
use crate::shared::log_dropped;
|
||||
use crate::shared::progress::error_row;
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
pub struct SendPatchView {
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
panel_id: SharedString,
|
||||
store: Entity<RepoStore>,
|
||||
subject: Entity<InputState>,
|
||||
@@ -28,7 +28,7 @@ pub struct SendPatchView {
|
||||
|
||||
impl SendPatchView {
|
||||
pub fn new(
|
||||
workspace: WeakEntity<Workspace>,
|
||||
workspace: WeakEntity<AppRoot>,
|
||||
panel_id: SharedString,
|
||||
store: Entity<RepoStore>,
|
||||
_window: &mut Window,
|
||||
|
||||
Reference in New Issue
Block a user