Minor fixes
This commit is contained in:
parent
08a5c01990
commit
deb3dae992
@ -1693,7 +1693,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 143;
|
||||
CURRENT_PROJECT_VERSION = 144;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
@ -1720,7 +1720,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 143;
|
||||
CURRENT_PROJECT_VERSION = 144;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
|
||||
@ -73,12 +73,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
HUD.allowsInteraction = false
|
||||
|
||||
registerServices()
|
||||
setupAppearance()
|
||||
|
||||
//Logging.URLRequests = { _ in false };
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func setupAppearance() {
|
||||
|
||||
let tabBarAppearance = UITabBarAppearance()
|
||||
tabBarAppearance.configureWithDefaultBackground()
|
||||
UITabBar.appearance().standardAppearance = tabBarAppearance
|
||||
UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
|
||||
|
||||
let navigationBarAppearance = UINavigationBarAppearance()
|
||||
navigationBarAppearance.configureWithDefaultBackground()
|
||||
UINavigationBar.appearance().standardAppearance = navigationBarAppearance
|
||||
UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance
|
||||
}
|
||||
|
||||
func registerServices() {
|
||||
|
||||
let container = ServiceContainer.shared
|
||||
|
||||
@ -105,11 +105,6 @@ struct EventsScreen: View {
|
||||
|
||||
@ViewBuilder
|
||||
func makeActions(for event: EventModel, useLabels: Bool = false) -> some View {
|
||||
Button(role: .destructive) {
|
||||
Task { await viewModel.deleteEvent(event) }
|
||||
} label: {
|
||||
Label(useLabels ? "Delete" : "", systemImage: "trash")
|
||||
}
|
||||
|
||||
Button() {
|
||||
Task { await viewModel.editEvent(event) }
|
||||
@ -134,6 +129,12 @@ struct EventsScreen: View {
|
||||
ShareLink(item: link)
|
||||
}
|
||||
}
|
||||
|
||||
Button(role: .destructive) {
|
||||
Task { await viewModel.deleteEvent(event) }
|
||||
} label: {
|
||||
Label(useLabels ? "Delete" : "", systemImage: "trash")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,11 +63,6 @@ struct NotesScreen: View {
|
||||
|
||||
@ViewBuilder
|
||||
func makeActions(for note: VehicleNoteDto, useLabels: Bool = false) -> some View {
|
||||
Button(role: .destructive) {
|
||||
Task { await viewModel.deleteNote(id: note.id) }
|
||||
} label: {
|
||||
Label(useLabels ? "Delete" : "", systemImage: "trash")
|
||||
}
|
||||
|
||||
Button() {
|
||||
selectedNoteId = note.id
|
||||
@ -82,6 +77,12 @@ struct NotesScreen: View {
|
||||
} label: {
|
||||
Label(useLabels ? "Copy" : "", systemImage: "doc.on.doc")
|
||||
}
|
||||
|
||||
Button(role: .destructive) {
|
||||
Task { await viewModel.deleteNote(id: note.id) }
|
||||
} label: {
|
||||
Label(useLabels ? "Delete" : "", systemImage: "trash")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,14 @@ struct EventsTests {
|
||||
given(settingsServiceMock)
|
||||
.user.willReturn(User())
|
||||
}
|
||||
|
||||
func makeViewModel(vehicle: VehicleDto) -> EventsViewModel {
|
||||
|
||||
EventsViewModel(apiService: apiServiceMock,
|
||||
storageService: storageServiceMock,
|
||||
settingsService: settingsServiceMock,
|
||||
vehicle: vehicle)
|
||||
}
|
||||
|
||||
@Test("Add event", arguments: [true, false])
|
||||
mutating func addEvent(isUnrecognized: Bool) async throws {
|
||||
@ -55,7 +63,7 @@ struct EventsTests {
|
||||
.add(event: .value(.valid), to: .value(VehicleDto.validNumber))
|
||||
.willReturn(unrecognizedVehicleWithEvent)
|
||||
|
||||
viewModel.vehicle = isUnrecognized ? .unrecognized : .normal
|
||||
viewModel = makeViewModel(vehicle: isUnrecognized ? .unrecognized : .normal)
|
||||
await viewModel.addEvent(.valid)
|
||||
|
||||
verify(apiServiceMock)
|
||||
@ -95,7 +103,7 @@ struct EventsTests {
|
||||
.remove(event: .value(VehicleEventDto.validId), from: .value(VehicleDto.validNumber))
|
||||
.willReturn(.unrecognized)
|
||||
|
||||
viewModel.vehicle = vehicleWithEvent
|
||||
viewModel = makeViewModel(vehicle: vehicleWithEvent)
|
||||
await viewModel.deleteEvent(VehicleEventDto.valid.viewModel)
|
||||
|
||||
verify(apiServiceMock)
|
||||
|
||||
@ -18,6 +18,9 @@ extension VehicleEventDto {
|
||||
static let validLatitude: Double = 42
|
||||
static let validLongitude: Double = 24
|
||||
|
||||
static let testAddress = "testAddress"
|
||||
static let testAddressModified = "testAddressModified"
|
||||
|
||||
static var valid: VehicleEventDto {
|
||||
|
||||
var event = VehicleEventDto(
|
||||
@ -28,6 +31,7 @@ extension VehicleEventDto {
|
||||
|
||||
event.id = validId
|
||||
event.date = 0
|
||||
event.address = testAddress
|
||||
return event
|
||||
}
|
||||
|
||||
@ -37,7 +41,7 @@ extension VehicleEventDto {
|
||||
id: id,
|
||||
date: "",
|
||||
coordinate: CLLocationCoordinate2DMake(latitude, longitude),
|
||||
address: "",
|
||||
address: address ?? "",
|
||||
isMe: true
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user