This commit is contained in:
Max Brunsfeld 2023-08-02 15:52:56 -07:00
parent 4d55110452
commit 0ae1f29be8
9 changed files with 24 additions and 28 deletions

View file

@ -115,10 +115,6 @@ impl ChannelStore {
} }
} }
pub fn is_channel_invite_pending(&self, channel: &Arc<Channel>) -> bool {
false
}
pub fn remove_channel(&self, channel_id: ChannelId) -> impl Future<Output = Result<()>> { pub fn remove_channel(&self, channel_id: ChannelId) -> impl Future<Output = Result<()>> {
let client = self.client.clone(); let client = self.client.clone();
async move { async move {
@ -127,6 +123,10 @@ impl ChannelStore {
} }
} }
pub fn is_channel_invite_pending(&self, _: &Arc<Channel>) -> bool {
false
}
pub fn remove_member( pub fn remove_member(
&self, &self,
channel_id: ChannelId, channel_id: ChannelId,
@ -144,10 +144,6 @@ impl ChannelStore {
todo!() todo!()
} }
pub fn add_guest_channel(&self, channel_id: ChannelId) -> Task<Result<()>> {
todo!()
}
async fn handle_update_channels( async fn handle_update_channels(
this: ModelHandle<Self>, this: ModelHandle<Self>,
message: TypedEnvelope<proto::UpdateChannels>, message: TypedEnvelope<proto::UpdateChannels>,

View file

@ -1080,7 +1080,7 @@ test_both_dbs!(
test_channel_invites_sqlite, test_channel_invites_sqlite,
db, db,
{ {
let owner_id = db.create_server("test").await.unwrap().0 as u32; db.create_server("test").await.unwrap();
let user_1 = db let user_1 = db
.create_user( .create_user(

View file

@ -10,8 +10,6 @@ use gpui::{
AnyElement, Axis, Element, LayoutContext, SceneBuilder, View, ViewContext, AnyElement, Axis, Element, LayoutContext, SceneBuilder, View, ViewContext,
}; };
use crate::CollabTitlebarItem;
pub(crate) struct FacePile<V: View> { pub(crate) struct FacePile<V: View> {
overlap: f32, overlap: f32,
faces: Vec<AnyElement<V>>, faces: Vec<AnyElement<V>>,

View file

@ -1259,8 +1259,8 @@ impl CollabPanel {
fn render_channel_editor( fn render_channel_editor(
&self, &self,
theme: &theme::CollabPanel, _theme: &theme::CollabPanel,
depth: usize, _depth: usize,
cx: &AppContext, cx: &AppContext,
) -> AnyElement<Self> { ) -> AnyElement<Self> {
ChildView::new(&self.channel_name_editor, cx).into_any() ChildView::new(&self.channel_name_editor, cx).into_any()
@ -1276,7 +1276,7 @@ impl CollabPanel {
let channel_id = channel.id; let channel_id = channel.id;
MouseEventHandler::<Channel, Self>::new(channel.id as usize, cx, |state, cx| { MouseEventHandler::<Channel, Self>::new(channel.id as usize, cx, |state, cx| {
Flex::row() Flex::row()
.with_child({ Svg::new("icons/file_icons/hash.svg").aligned().left() }) .with_child(Svg::new("icons/file_icons/hash.svg").aligned().left())
.with_child( .with_child(
Label::new(channel.name.clone(), theme.contact_username.text.clone()) Label::new(channel.name.clone(), theme.contact_username.text.clone())
.contained() .contained()
@ -1329,12 +1329,7 @@ impl CollabPanel {
let button_spacing = theme.contact_button_spacing; let button_spacing = theme.contact_button_spacing;
Flex::row() Flex::row()
.with_child({ .with_child(Svg::new("icons/file_icons/hash.svg").aligned().left())
Svg::new("icons/file_icons/hash.svg")
// .with_style(theme.contact_avatar)
.aligned()
.left()
})
.with_child( .with_child(
Label::new(channel.name.clone(), theme.contact_username.text.clone()) Label::new(channel.name.clone(), theme.contact_username.text.clone())
.contained() .contained()
@ -1616,7 +1611,7 @@ impl CollabPanel {
} }
} }
} else if let Some((editing_state, channel_name)) = self.take_editing_state(cx) { } else if let Some((editing_state, channel_name)) = self.take_editing_state(cx) {
let create_channel = self.channel_store.update(cx, |channel_store, cx| { let create_channel = self.channel_store.update(cx, |channel_store, _| {
channel_store.create_channel(&channel_name, editing_state.parent_id) channel_store.create_channel(&channel_name, editing_state.parent_id)
}); });
@ -1687,7 +1682,7 @@ impl CollabPanel {
cx.spawn(|_, mut cx| async move { cx.spawn(|_, mut cx| async move {
if answer.next().await == Some(0) { if answer.next().await == Some(0) {
if let Err(e) = channel_store if let Err(e) = channel_store
.update(&mut cx, |channels, cx| channels.remove_channel(channel_id)) .update(&mut cx, |channels, _| channels.remove_channel(channel_id))
.await .await
{ {
cx.prompt( cx.prompt(

View file

@ -9,7 +9,7 @@ pub fn init(cx: &mut AppContext) {
pub struct ChannelModal { pub struct ChannelModal {
has_focus: bool, has_focus: bool,
input_editor: ViewHandle<Editor>, filter_editor: ViewHandle<Editor>,
} }
pub enum Event { pub enum Event {
@ -30,7 +30,7 @@ impl ChannelModal {
ChannelModal { ChannelModal {
has_focus: false, has_focus: false,
input_editor, filter_editor: input_editor,
} }
} }
@ -55,7 +55,7 @@ impl View for ChannelModal {
enum ChannelModal {} enum ChannelModal {}
MouseEventHandler::<ChannelModal, _>::new(0, cx, |_, cx| { MouseEventHandler::<ChannelModal, _>::new(0, cx, |_, cx| {
Flex::column() Flex::column()
.with_child(ChildView::new(self.input_editor.as_any(), cx)) .with_child(ChildView::new(self.filter_editor.as_any(), cx))
.with_child(Label::new("ADD OR BROWSE CHANNELS HERE", style)) .with_child(Label::new("ADD OR BROWSE CHANNELS HERE", style))
.contained() .contained()
.with_style(modal_container) .with_style(modal_container)
@ -71,7 +71,7 @@ impl View for ChannelModal {
fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) { fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
self.has_focus = true; self.has_focus = true;
if cx.is_self_focused() { if cx.is_self_focused() {
cx.focus(&self.input_editor); cx.focus(&self.filter_editor);
} }
} }

View file

@ -1,3 +1,6 @@
#!/bin/bash #!/bin/bash
ZED_ADMIN_API_TOKEN=secret ZED_IMPERSONATE=as-cii ZED_SERVER_URL=http://localhost:8080 cargo run $@ : "${ZED_IMPERSONATE:=as-cii}"
export ZED_IMPERSONATE
ZED_ADMIN_API_TOKEN=secret ZED_SERVER_URL=http://localhost:8080 cargo run $@

View file

@ -28,6 +28,7 @@ module.exports = {
}, },
rules: { rules: {
"linebreak-style": ["error", "unix"], "linebreak-style": ["error", "unix"],
"@typescript-eslint/no-explicit-any": "off",
semi: ["error", "never"], semi: ["error", "never"],
}, },
} }

View file

@ -8,6 +8,7 @@ import {
import { interactive, toggleable } from "../element" import { interactive, toggleable } from "../element"
import { useTheme } from "../theme" import { useTheme } from "../theme"
export default function contacts_panel(): any { export default function contacts_panel(): any {
const theme = useTheme() const theme = useTheme()

View file

@ -24,5 +24,7 @@
"useUnknownInCatchVariables": false, "useUnknownInCatchVariables": false,
"baseUrl": "." "baseUrl": "."
}, },
"exclude": ["node_modules"] "exclude": [
"node_modules"
]
} }