Skip to content

Commit ad82e19

Browse files
committed
Merge branch 'develop'
2 parents f855872 + f18a294 commit ad82e19

20 files changed

+1587
-155
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ Adheres to [Semantic Versioning](http://semver.org/).
55
---
66
## 4.0.2
77

8+
##### Features
9+
* Long secondary fields are now ellipsized
10+
* When all events but one are deleted from the user, they are still shown the event picker
11+
* Observation table immediately updates when an attachment is pushed
12+
13+
##### Bug Fixes
14+
* Fix navigation bar colors after using the camera
15+
* Crash when switching quickly between attachment view and observation list
16+
* Extra space at the top of the event chooser view
17+
* Cannot clear the observation geometry
18+
* iPad Navigation Options Setting does not open
19+
* Tapping a local attachment does not show the attachment
20+
* Distance is not being calculated correctly when navigation lines are updated
21+
822
##### Bug Fixes
923
* Navigation bar colors were incorrect after using the camera
1024
* long secondary fields are now ellipsized

MAGE.xcodeproj/project.pbxproj

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
F7098F2A2497C75F00313703 /* FeedItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7098F292497C75F00313703 /* FeedItemViewController.swift */; };
112112
F7098F2C2497D6E700313703 /* FeedItemPropertyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7098F2B2497D6E600313703 /* FeedItemPropertyCell.swift */; };
113113
F7098F2E24980DD000313703 /* FeedItemRetriever.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7098F2D24980DD000313703 /* FeedItemRetriever.swift */; };
114+
F709F02D28297AD2002EA135 /* threeEvents.json in Resources */ = {isa = PBXBuildFile; fileRef = F709F02C28297AD2002EA135 /* threeEvents.json */; };
115+
F709F02F2829870B002EA135 /* twoEvents.json in Resources */ = {isa = PBXBuildFile; fileRef = F709F02E2829870B002EA135 /* twoEvents.json */; };
114116
F70A708C27D932FE000881F5 /* FilteredUsersMapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70A708B27D932FE000881F5 /* FilteredUsersMapTests.swift */; };
115117
F70B47B224B5F27A00D0BFE5 /* FeedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70B47B124B5F27A00D0BFE5 /* FeedTests.swift */; };
116118
F70B47B424B5F7AF00D0BFE5 /* feeds.json in Resources */ = {isa = PBXBuildFile; fileRef = F70B47B324B5F7AF00D0BFE5 /* feeds.json */; };
@@ -389,6 +391,7 @@
389391
F7974CD5252DF56E000CC266 /* SignupViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7974CD4252DF56E000CC266 /* SignupViewControllerTests.swift */; };
390392
F7994AB7190EF7BD00A90A1D /* MageRootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7994AB6190EF7BD00A90A1D /* MageRootViewController.swift */; };
391393
F79A09472694D1A200EB2ABA /* AttachmentPushServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79A09462694D1A200EB2ABA /* AttachmentPushServiceTests.swift */; };
394+
F79B5DE32821D94C001A5844 /* EventChooserCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79B5DE22821D94C001A5844 /* EventChooserCoordinatorTests.swift */; };
392395
F79CC3E7252F6875005692DC /* ServerURLControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79CC3E6252F6875005692DC /* ServerURLControllerTests.swift */; };
393396
F79CC3EB252F832E005692DC /* ChangePasswordViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79CC3EA252F832E005692DC /* ChangePasswordViewTests.swift */; };
394397
F79CC3EF2530AC4B005692DC /* LocalLoginViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79CC3EE2530AC4B005692DC /* LocalLoginViewTests.swift */; };
@@ -498,7 +501,7 @@
498501
F7E40A6C2693B1A700E50E26 /* UserActionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E40A6B2693B1A700E50E26 /* UserActionsView.swift */; };
499502
F7E40A6E2693B52200E50E26 /* UserActionsDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E40A6D2693B52200E50E26 /* UserActionsDelegate.swift */; };
500503
F7E457641F61C14F0082F527 /* EventCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7E457631F61C14F0082F527 /* EventCell.xib */; };
501-
F7E457671F61E2380082F527 /* EventChooserCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = F7E457661F61E2380082F527 /* EventChooserCoordinator.m */; };
504+
F7E457671F61E2380082F527 /* EventChooserCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E457661F61E2380082F527 /* EventChooserCoordinator.swift */; };
502505
F7E5748C27DA7BEA009A6E0D /* PersistedMapStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E5748B27DA7BEA009A6E0D /* PersistedMapStateTests.swift */; };
503506
F7E5748E27DA818A009A6E0D /* HasMapSettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E5748D27DA818A009A6E0D /* HasMapSettingsTests.swift */; };
504507
F7E5749027DA8D21009A6E0D /* CanCreateObservationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E5748F27DA8D21009A6E0D /* CanCreateObservationTests.swift */; };
@@ -768,6 +771,8 @@
768771
F7098F292497C75F00313703 /* FeedItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedItemViewController.swift; sourceTree = "<group>"; };
769772
F7098F2B2497D6E600313703 /* FeedItemPropertyCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedItemPropertyCell.swift; sourceTree = "<group>"; };
770773
F7098F2D24980DD000313703 /* FeedItemRetriever.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedItemRetriever.swift; sourceTree = "<group>"; };
774+
F709F02C28297AD2002EA135 /* threeEvents.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = threeEvents.json; sourceTree = "<group>"; };
775+
F709F02E2829870B002EA135 /* twoEvents.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = twoEvents.json; sourceTree = "<group>"; };
771776
F70A708B27D932FE000881F5 /* FilteredUsersMapTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilteredUsersMapTests.swift; sourceTree = "<group>"; };
772777
F70B47B124B5F27A00D0BFE5 /* FeedTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedTests.swift; sourceTree = "<group>"; };
773778
F70B47B324B5F7AF00D0BFE5 /* feeds.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = feeds.json; sourceTree = "<group>"; };
@@ -1117,6 +1122,7 @@
11171122
F7974CD4252DF56E000CC266 /* SignupViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignupViewControllerTests.swift; sourceTree = "<group>"; };
11181123
F7994AB6190EF7BD00A90A1D /* MageRootViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MageRootViewController.swift; sourceTree = "<group>"; };
11191124
F79A09462694D1A200EB2ABA /* AttachmentPushServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttachmentPushServiceTests.swift; sourceTree = "<group>"; };
1125+
F79B5DE22821D94C001A5844 /* EventChooserCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventChooserCoordinatorTests.swift; sourceTree = "<group>"; };
11201126
F79CC3E6252F6875005692DC /* ServerURLControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerURLControllerTests.swift; sourceTree = "<group>"; };
11211127
F79CC3EA252F832E005692DC /* ChangePasswordViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangePasswordViewTests.swift; sourceTree = "<group>"; };
11221128
F79CC3EE2530AC4B005692DC /* LocalLoginViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalLoginViewTests.swift; sourceTree = "<group>"; };
@@ -1251,8 +1257,7 @@
12511257
F7E40A6B2693B1A700E50E26 /* UserActionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserActionsView.swift; sourceTree = "<group>"; };
12521258
F7E40A6D2693B52200E50E26 /* UserActionsDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserActionsDelegate.swift; sourceTree = "<group>"; };
12531259
F7E457631F61C14F0082F527 /* EventCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EventCell.xib; sourceTree = "<group>"; };
1254-
F7E457651F61E2380082F527 /* EventChooserCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventChooserCoordinator.h; sourceTree = "<group>"; };
1255-
F7E457661F61E2380082F527 /* EventChooserCoordinator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EventChooserCoordinator.m; sourceTree = "<group>"; };
1260+
F7E457661F61E2380082F527 /* EventChooserCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventChooserCoordinator.swift; sourceTree = "<group>"; };
12561261
F7E5748B27DA7BEA009A6E0D /* PersistedMapStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistedMapStateTests.swift; sourceTree = "<group>"; };
12571262
F7E5748D27DA818A009A6E0D /* HasMapSettingsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasMapSettingsTests.swift; sourceTree = "<group>"; };
12581263
F7E5748F27DA8D21009A6E0D /* CanCreateObservationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CanCreateObservationTests.swift; sourceTree = "<group>"; };
@@ -2141,6 +2146,8 @@
21412146
F760910123FDA78F000233A6 /* authorizeLocalSuccess.json */,
21422147
F7CE2303254369BD00D710DE /* checkboxForm.json */,
21432148
F7F15B16274596B1008FF6C2 /* events.json */,
2149+
F709F02C28297AD2002EA135 /* threeEvents.json */,
2150+
F709F02E2829870B002EA135 /* twoEvents.json */,
21442151
F71446F424A3FAF5005A5EC1 /* feedContent.json */,
21452152
F70B47B324B5F7AF00D0BFE5 /* feeds.json */,
21462153
F7C640FE257EB29100C02335 /* geometryField.json */,
@@ -2187,8 +2194,7 @@
21872194
children = (
21882195
F76A15BC1A93C33300F2BDF1 /* Constraints */,
21892196
F76949151AA6436000CB680B /* EventChooserController.swift */,
2190-
F7E457651F61E2380082F527 /* EventChooserCoordinator.h */,
2191-
F7E457661F61E2380082F527 /* EventChooserCoordinator.m */,
2197+
F7E457661F61E2380082F527 /* EventChooserCoordinator.swift */,
21922198
2F8A2C102200FD2F007FE473 /* EventInformationController.h */,
21932199
2F8A2C112200FD2F007FE473 /* EventInformationController.m */,
21942200
2F8A2C0D2200FC2C007FE473 /* EventInformationCoordinator.h */,
@@ -2776,6 +2782,7 @@
27762782
isa = PBXGroup;
27772783
children = (
27782784
F7F264382806FDF100758C5B /* EventChooserControllerTests.swift */,
2785+
F79B5DE22821D94C001A5844 /* EventChooserCoordinatorTests.swift */,
27792786
);
27802787
path = Event;
27812788
sourceTree = "<group>";
@@ -2980,7 +2987,9 @@
29802987
F70D19E32742CE0D006E12F8 /* plantsAnimalsBuildingsIcons.zip in Resources */,
29812988
F795ED1424BD061C0028FBFC /* observations.json in Resources */,
29822989
F7098F262492C36700313703 /* test_marker.png in Resources */,
2990+
F709F02D28297AD2002EA135 /* threeEvents.json in Resources */,
29832991
F7CDD7132601194600F3294C /* polygonObservation.json in Resources */,
2992+
F709F02F2829870B002EA135 /* twoEvents.json in Resources */,
29842993
F70039442006BA1700E6E660 /* apiSuccess.json in Resources */,
29852994
F71446F1249BB5BC005A5EC1 /* icon27.png in Resources */,
29862995
F777B00A252CF13F00B88BD4 /* apiSuccessNoDisclaimer.json in Resources */,
@@ -3552,7 +3561,7 @@
35523561
F72D43192694B60300F9AC3B /* Model6To15.xcmappingmodel in Sources */,
35533562
F7813A8A2466037B003666ED /* GeometryView.swift in Sources */,
35543563
F718CF32271A1A8500A669D5 /* PersonAnnotationView.swift in Sources */,
3555-
F7E457671F61E2380082F527 /* EventChooserCoordinator.m in Sources */,
3564+
F7E457671F61E2380082F527 /* EventChooserCoordinator.swift in Sources */,
35563565
);
35573566
runOnlyForDeploymentPostprocessing = 0;
35583567
};
@@ -3644,6 +3653,7 @@
36443653
F7BEF68427D7C561000E8CDE /* FilteredObservationsMapTests.swift in Sources */,
36453654
F7ED5D2F20052248007BD768 /* AuthenticationTests.m in Sources */,
36463655
F791E22D2485486E00CCC6BA /* MockFieldDelegate.swift in Sources */,
3656+
F79B5DE32821D94C001A5844 /* EventChooserCoordinatorTests.swift in Sources */,
36473657
F795ED0C24B8FCC00028FBFC /* UserTableHeaderViewTests.swift in Sources */,
36483658
F7148D3924003C6B00F9F879 /* ImageCacheTests.m in Sources */,
36493659
F7F08E9E27EA2E5600640D89 /* SFGeometryMapTests.swift in Sources */,

Mage/AttachmentUIImageView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ import Kingfisher
124124

125125
if (url.isFileURL) {
126126
let provider = LocalFileImageDataProvider(fileURL: url)
127-
self.kf.setImage(with: provider)
127+
self.kf.setImage(with: provider, completionHandler: completionHandler)
128128
return;
129129
}
130130

Mage/CoreData/Observation.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ enum State: Int, CustomStringConvertible {
840840
set {
841841
if let newValue = newValue {
842842
self.geometryData = SFGeometryUtils.encode(newValue);
843+
} else {
844+
self.geometryData = nil
843845
}
844846
}
845847
}

Mage/EventChooserController.swift

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -295,22 +295,29 @@ func actionButtonTapped()
295295
@objc public func eventsFetchedFromServer() {
296296
eventsFetched = true
297297
refreshingView.isHidden = true
298-
emptyState?.toggleVisible(false)
299-
300-
if !eventsInitialized {
301-
eventsInitialized = true
302-
refreshingButtonTapped()
303-
} else if eventsChanged {
304-
self.refreshingButton.isHidden = false
305-
UIView.animate(withDuration: 0.45, delay: 0, options: [], animations: { [weak self] in
306-
self?.refreshingButton.alpha = 1
307-
}, completion: nil)
308-
}
309-
298+
emptyState?.toggleVisible(false, completion: { [weak self] _ in
299+
guard let self = self else {
300+
return
301+
}
302+
if !self.eventsInitialized {
303+
self.eventsInitialized = true
304+
self.updateEventTable(autoSelectEvent: true)
305+
} else if self.eventsChanged {
306+
self.refreshingButton.isHidden = false
307+
UIView.animate(withDuration: 0.45, delay: 0, options: [], animations: { [weak self] in
308+
self?.refreshingButton.alpha = 1
309+
}, completion: nil)
310+
}
311+
})
310312
progressView.stopAnimating()
311313
}
312314

313315
@objc func refreshingButtonTapped() {
316+
updateEventTable(autoSelectEvent: false)
317+
}
318+
319+
// will update the event table and if there is only one event follow the autoSelectEvent flag
320+
func updateEventTable(autoSelectEvent: Bool = true) {
314321
eventDataSource?.refreshEventData()
315322
tableView.reloadData()
316323
refreshingButton.isHidden = true
@@ -333,12 +340,26 @@ func actionButtonTapped()
333340
eventInstructions.isHidden = true
334341
searchContainerHeightConstraint?.constant = 0.0
335342
} else if eventDataSource?.otherFetchedResultsController?.fetchedObjects?.count == 1 && eventDataSource?.recentFetchedResultsController?.fetchedObjects?.count == 0 {
336-
if let e = eventDataSource?.otherFetchedResultsController?.fetchedObjects?[0] as? Event {
337-
didSelectEvent(event: e)
343+
if !UserDefaults.standard.showEventChooserOnce {
344+
if autoSelectEvent, let e = eventDataSource?.otherFetchedResultsController?.fetchedObjects?[0] as? Event {
345+
didSelectEvent(event: e)
346+
}
347+
} else {
348+
UserDefaults.standard.showEventChooserOnce = false
349+
eventInstructions.isHidden = false
350+
searchContainerHeightConstraint?.constant = 56.0
351+
eventInstructions.text = "You are a part of one event. The observations you create and your reported location will be part of this event."
338352
}
339353
} else if eventDataSource?.otherFetchedResultsController?.fetchedObjects?.count == 0 && eventDataSource?.recentFetchedResultsController?.fetchedObjects?.count == 1 {
340-
if let e = eventDataSource?.recentFetchedResultsController?.fetchedObjects?[0] as? Event {
341-
didSelectEvent(event: e)
354+
if !UserDefaults.standard.showEventChooserOnce {
355+
if autoSelectEvent, let e = eventDataSource?.recentFetchedResultsController?.fetchedObjects?[0] as? Event {
356+
didSelectEvent(event: e)
357+
}
358+
} else {
359+
UserDefaults.standard.showEventChooserOnce = false
360+
eventInstructions.isHidden = false
361+
searchContainerHeightConstraint?.constant = 56.0
362+
eventInstructions.text = "You are a part of one event. The observations you create and your reported location will be part of this event."
342363
}
343364
} else {
344365
searchContainerHeightConstraint?.constant = 56.0
@@ -364,7 +385,7 @@ extension EventChooserController : EventSelectionDelegate {
364385
} else {
365386
let alert = UIAlertController(title: "Unauthorized", message: "You are no longer a part of the event '\(event.name ?? "")'. Please contact an administrator if you need access.", preferredStyle: .alert)
366387
alert.addAction(UIAlertAction(title: "Refresh Events", style: .default, handler: { action in
367-
self.refreshingButtonTapped()
388+
self.updateEventTable(autoSelectEvent: false)
368389
}))
369390
self.present(alert, animated: true)
370391
}

Mage/EventChooserCoordinator.h

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)