Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"src/Preview Content\"";
ENABLE_PREVIEWS = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/src",
Expand Down Expand Up @@ -459,6 +460,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"src/Preview Content\"";
ENABLE_PREVIEWS = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/src",
Expand Down
36 changes: 16 additions & 20 deletions iosApp/src/Components/AddToCalendarButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,25 @@ struct AddToCalendarButton: View {
// MARK: - Preview

#Preview {
let now = ISO8601DateFormatter().string(from: Date())

VStack(spacing: 20) {
AddToCalendarButton(
event: Event(
Comment thread
guyghost marked this conversation as resolved.
id: "event-1",
organizerId: "user-1",
title: "Team Meeting",
description: "Q4 Planning",
organizerId: "user-1",
participants: [],
proposedSlots: [],
status: "CONFIRMED",
deadline: ISO8601DateFormatter().string(from: Date()),
status: .confirmed,
finalDate: ISO8601DateFormatter().string(from: Date().addingTimeInterval(86400)),
createdAt: ISO8601DateFormatter().string(from: Date()),
updatedAt: ISO8601DateFormatter().string(from: Date()),
eventType: .teamBuilding,
createdAt: now,
updatedAt: now,
version: 1,
eventType: "TEAM_BUILDING",
eventTypeCustom: nil,
minParticipants: nil,
maxParticipants: nil,
expectedParticipants: nil,
heroImageUrl: nil
expectedParticipants: nil
),
isLoading: false,
isEnabled: true,
Expand All @@ -72,22 +71,19 @@ struct AddToCalendarButton: View {
AddToCalendarButton(
event: Event(
Comment thread
guyghost marked this conversation as resolved.
id: "event-2",
organizerId: "user-1",
title: "Team Meeting",
description: "Q4 Planning",
organizerId: "user-1",
participants: [],
proposedSlots: [],
status: "POLLING",
deadline: ISO8601DateFormatter().string(from: Date()),
status: .polling,
finalDate: nil,
createdAt: ISO8601DateFormatter().string(from: Date()),
updatedAt: ISO8601DateFormatter().string(from: Date()),
eventType: .teamBuilding,
createdAt: now,
updatedAt: now,
version: 1,
eventType: "TEAM_BUILDING",
eventTypeCustom: nil,
minParticipants: nil,
maxParticipants: nil,
expectedParticipants: nil,
heroImageUrl: nil
expectedParticipants: nil
),
isLoading: true,
isEnabled: false,
Expand Down
66 changes: 50 additions & 16 deletions iosApp/src/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct AuthenticatedView: View {
let userId: String
@State private var selectedTab: WakeveTab = .home
@State private var currentView: AppView = .eventList
@State private var selectedEvent: Event?
@State private var selectedEvent: Event_?
Comment thread
guyghost marked this conversation as resolved.
Comment thread
guyghost marked this conversation as resolved.
// Use persistent database-backed repository instead of in-memory mock
private let repository: EventRepositoryInterface = RepositoryProvider.shared.repository
@State private var showEventCreationSheet = false
Expand Down Expand Up @@ -229,10 +229,26 @@ struct AuthenticatedView: View {
.foregroundColor(.secondary)

case .eventDetail:
if selectedEvent != nil {
Text("Event Detail - Coming Soon")
.font(.title2)
.foregroundColor(.secondary)
if let event = selectedEvent {
EventDetailExperienceView(
event: event,
repository: repository,
onBack: {
currentView = .eventList
},
onOpenParticipants: {
currentView = .participantManagement
},
onOpenVote: {
currentView = .pollVoting
},
onOpenTransport: {
currentView = .transportPlan
},
onOpenMessages: {
selectedTab = .inbox
}
)
}

case .participantManagement:
Expand All @@ -242,9 +258,7 @@ struct AuthenticatedView: View {
repository: repository,
onParticipantsUpdated: {
// Refresh the event data
if let updatedEvent = repository.getEvent(id: event.id) {
selectedEvent = updatedEvent
}
refreshSelectedEvent()
},
onBack: {
currentView = .eventDetail
Expand All @@ -259,6 +273,7 @@ struct AuthenticatedView: View {
repository: repository,
participantId: userId,
onVoteSubmitted: {
refreshSelectedEvent()
currentView = .eventDetail
},
onBack: {
Expand All @@ -281,6 +296,17 @@ struct AuthenticatedView: View {
}
)
}

case .transportPlan:
if let event = selectedEvent {
TransportPlanView(
event: event,
repository: repository,
onBack: {
currentView = .eventDetail
}
)
}

// MARK: - New PRD Features Navigation Cases

Expand Down Expand Up @@ -370,6 +396,13 @@ struct AuthenticatedView: View {
ExploreTabView()
}
}

private func refreshSelectedEvent() {
guard let eventId = selectedEvent?.id else { return }
if let updatedEvent = repository.getEvent(id: eventId) {
selectedEvent = updatedEvent
}
}
}


Expand All @@ -385,6 +418,7 @@ enum AppView {
case participantManagement
case pollVoting
case pollResults
case transportPlan
// New PRD features
case scenarioList
case scenarioDetail
Expand All @@ -403,10 +437,10 @@ enum AppView {

struct EventListView: View {
let repository: EventRepository
let onEventSelected: (Event) -> Void
let onEventSelected: (Event_) -> Void
let onCreateEvent: () -> Void

@State private var events: [Event] = []
@State private var events: [Event_] = []
@State private var isLoading = true
Comment thread
guyghost marked this conversation as resolved.

var body: some View {
Expand Down Expand Up @@ -507,7 +541,7 @@ struct EventListView: View {
}

struct EventCard: View {
let event: Event
let event: Event_
Comment thread
guyghost marked this conversation as resolved.
let onTap: () -> Void

var body: some View {
Expand All @@ -519,8 +553,8 @@ struct EventCard: View {
.font(.system(size: 18, weight: .semibold, design: .rounded))
.foregroundColor(.primary)

if !event.description.isEmpty {
Text(event.description)
if !event.description_.isEmpty {
Text(event.description_)
.font(.system(size: 14, design: .rounded))
.foregroundColor(.secondary)
.lineLimit(2)
Expand Down Expand Up @@ -600,7 +634,7 @@ struct EventCard: View {
}

struct EventDetailView: View {
let event: Event
let event: Event_
Comment thread
guyghost marked this conversation as resolved.
let repository: EventRepository
let onManageParticipants: () -> Void
let onVote: () -> Void
Expand Down Expand Up @@ -647,8 +681,8 @@ struct EventDetailView: View {
Spacer()
}

if !event.description.isEmpty {
Text(event.description)
if !event.description_.isEmpty {
Text(event.description_)
.font(.system(size: 14, design: .rounded))
.foregroundColor(.secondary)
.multilineTextAlignment(.leading)
Expand Down
Loading
Loading