Enable meeting creation from a conversation with auto-filled details

This commit is contained in:
Benoit Martins 2024-11-14 10:15:57 +01:00
parent d4b6fe6d8e
commit ecea020da3
4 changed files with 39 additions and 7 deletions

View file

@ -39,6 +39,7 @@ struct CallView: View {
@ObservedObject var conversationForwardMessageViewModel: ConversationForwardMessageViewModel
@ObservedObject var contactViewModel: ContactViewModel
@ObservedObject var editContactViewModel: EditContactViewModel
@ObservedObject var meetingViewModel: MeetingViewModel
@State private var addParticipantsViewModel: AddParticipantsViewModel?
@ -76,6 +77,8 @@ struct CallView: View {
@Binding var isShowEditContactFragment: Bool
@Binding var indexPage: Int
@Binding var isShowScheduleMeetingFragment: Bool
var body: some View {
GeometryReader { geo in
ZStack {
@ -207,10 +210,12 @@ struct CallView: View {
conversationForwardMessageViewModel: conversationForwardMessageViewModel,
contactViewModel: contactViewModel,
editContactViewModel: editContactViewModel,
meetingViewModel: meetingViewModel,
isShowConversationFragment: $isShowConversationFragment,
isShowStartCallGroupPopup: $isShowStartCallGroupPopup,
isShowEditContactFragment: $isShowEditContactFragment,
indexPage: $indexPage
indexPage: $indexPage,
isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment
)
.frame(maxWidth: .infinity)
.background(Color.gray100)
@ -2836,12 +2841,14 @@ struct PressedButtonStyle: ButtonStyle {
conversationForwardMessageViewModel: ConversationForwardMessageViewModel(),
contactViewModel: ContactViewModel(),
editContactViewModel: EditContactViewModel(),
meetingViewModel: MeetingViewModel(),
fullscreenVideo: .constant(false),
isShowStartCallFragment: .constant(false),
isShowConversationFragment: .constant(false),
isShowStartCallGroupPopup: .constant(false),
isShowEditContactFragment: .constant(false),
indexPage: .constant(0)
indexPage: .constant(0),
isShowScheduleMeetingFragment: .constant(false)
)
}
// swiftlint:enable type_body_length

View file

@ -864,10 +864,12 @@ struct ContentView: View {
conversationForwardMessageViewModel: conversationForwardMessageViewModel,
contactViewModel: contactViewModel,
editContactViewModel: editContactViewModel,
meetingViewModel: meetingViewModel,
isShowConversationFragment: $isShowConversationFragment,
isShowStartCallGroupPopup: $isShowStartCallGroupPopup,
isShowEditContactFragment: $isShowEditContactFragment,
indexPage: $index
indexPage: $index,
isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment
)
.frame(maxWidth: .infinity)
.background(Color.gray100)
@ -1239,12 +1241,14 @@ struct ContentView: View {
conversationForwardMessageViewModel: conversationForwardMessageViewModel,
contactViewModel: contactViewModel,
editContactViewModel: editContactViewModel,
meetingViewModel: meetingViewModel,
fullscreenVideo: $fullscreenVideo,
isShowStartCallFragment: $isShowStartCallFragment,
isShowConversationFragment: $isShowConversationFragment,
isShowStartCallGroupPopup: $isShowStartCallGroupPopup,
isShowEditContactFragment: $isShowEditContactFragment,
indexPage: $index
indexPage: $index,
isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment
)
.zIndex(5)
.transition(.scale.combined(with: .move(edge: .top)))

View file

@ -35,6 +35,7 @@ struct ConversationFragment: View {
@ObservedObject var conversationForwardMessageViewModel: ConversationForwardMessageViewModel
@ObservedObject var contactViewModel: ContactViewModel
@ObservedObject var editContactViewModel: EditContactViewModel
@ObservedObject var meetingViewModel: MeetingViewModel
@State var isMenuOpen = false
@State private var isMuted: Bool = false
@ -68,6 +69,8 @@ struct ConversationFragment: View {
@Binding var isShowEditContactFragment: Bool
@Binding var indexPage: Int
@Binding var isShowScheduleMeetingFragment: Bool
var body: some View {
NavigationView {
GeometryReader { geometry in
@ -984,12 +987,14 @@ struct ConversationFragment: View {
conversationsListViewModel: conversationsListViewModel,
contactViewModel: contactViewModel,
editContactViewModel: editContactViewModel,
meetingViewModel: meetingViewModel,
isMuted: $isMuted,
isShowEphemeralFragment: $isShowEphemeralFragment,
isShowStartCallGroupPopup: $isShowStartCallGroupPopup,
isShowInfoConversationFragment: $isShowInfoConversationFragment,
isShowEditContactFragment: $isShowEditContactFragment,
indexPage: $indexPage
indexPage: $indexPage,
isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment
)
.zIndex(5)
.transition(.move(edge: .trailing))

View file

@ -30,6 +30,7 @@ struct ConversationInfoFragment: View {
@ObservedObject var conversationsListViewModel: ConversationsListViewModel
@ObservedObject var contactViewModel: ContactViewModel
@ObservedObject var editContactViewModel: EditContactViewModel
@ObservedObject var meetingViewModel: MeetingViewModel
@State var addParticipantsViewModel = AddParticipantsViewModel()
@ -40,6 +41,8 @@ struct ConversationInfoFragment: View {
@Binding var isShowEditContactFragment: Bool
@Binding var indexPage: Int
@Binding var isShowScheduleMeetingFragment: Bool
@State private var participantListIsOpen = true
var body: some View {
@ -217,7 +220,15 @@ struct ConversationInfoFragment: View {
Spacer()
Button(action: {
// TODO Create Meeting
if conversationViewModel.displayedConversation != nil {
meetingViewModel.subject = conversationViewModel.displayedConversation!.subject
meetingViewModel.participants = conversationViewModel.participants
conversationViewModel.displayedConversation = nil
indexPage = 3
withAnimation {
isShowScheduleMeetingFragment = true
}
}
}, label: {
VStack {
HStack(alignment: .center) {
@ -636,6 +647,9 @@ struct ConversationInfoFragment: View {
}
.background(.white)
.navigationBarHidden(true)
.onAppear {
conversationViewModel.getParticipants()
}
.onRotate { newOrientation in
orientation = newOrientation
}
@ -652,13 +666,15 @@ struct ConversationInfoFragment: View {
conversationsListViewModel: ConversationsListViewModel(),
contactViewModel: ContactViewModel(),
editContactViewModel: EditContactViewModel(),
meetingViewModel: MeetingViewModel(),
addParticipantsViewModel: AddParticipantsViewModel(),
isMuted: .constant(false),
isShowEphemeralFragment: .constant(false),
isShowStartCallGroupPopup: .constant(false),
isShowInfoConversationFragment: .constant(true),
isShowEditContactFragment: .constant(false),
indexPage: .constant(0)
indexPage: .constant(0),
isShowScheduleMeetingFragment: .constant(false)
)
}
// swiftlint:enable type_body_length