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
40 changes: 20 additions & 20 deletions Permanent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6101,7 +6101,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -6134,7 +6134,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -6158,7 +6158,7 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.1;
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.PermanentUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand All @@ -6183,7 +6183,7 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.1;
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.PermanentUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand All @@ -6208,7 +6208,7 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.1;
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.PermanentUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand All @@ -6233,7 +6233,7 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.1;
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.PermanentUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -6264,7 +6264,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = com.vsp.PermanentTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -6294,7 +6294,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = com.vsp.PermanentTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -6324,7 +6324,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = com.vsp.PermanentTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -6354,7 +6354,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = com.vsp.PermanentTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -6390,7 +6390,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -6428,7 +6428,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -6466,7 +6466,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -6504,7 +6504,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -6602,7 +6602,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
OTHER_SWIFT_FLAGS = "-D COCOAPODS -DSTAGING_ENVIRONMENT";
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -6692,7 +6692,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
OTHER_SWIFT_FLAGS = "-D COCOAPODS -DSTAGING_ENVIRONMENT";
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -6722,7 +6722,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.PushExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -6751,7 +6751,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging.PushExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -6780,7 +6780,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.PermanentArchive.PushExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -6809,7 +6809,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.14.1;
MARKETING_VERSION = 1.14.2;
PRODUCT_BUNDLE_IDENTIFIER = org.permanent.permanent.staging.PushExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
10 changes: 5 additions & 5 deletions Permanent/Common/Network/FilesEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ class FilesEndpointPayloads {
if let location = params.location,
let locationJson = try? JSONEncoder().encode(location),
let locationDict = try? JSONSerialization.jsonObject(with: locationJson, options: []) {
recordVO["locnVO"] = locationDict
recordVO["LocnVO"] = locationDict
}

return [
"RequestVO":
[
Expand All @@ -428,19 +428,19 @@ class FilesEndpointPayloads {
]
]
}

static func updateMultipleRecordsRequest(params: UpdateMultipleRecordsParams) -> RequestParameters {
let data = params.files.map {
var recordVO: [String: Any] = [
"recordId": $0.recordId,
"archiveNbr": $0.archiveNo,
"folder_linkId": $0.folderLinkId
]

if let location = params.location,
let locationJson = try? JSONEncoder().encode(location),
let locationDict = try? JSONSerialization.jsonObject(with: locationJson, options: []) {
recordVO["locnVO"] = locationDict
recordVO["LocnVO"] = locationDict
}

if let description = params.description {
Expand Down
19 changes: 13 additions & 6 deletions Permanent/Common/Utility/LocationSetViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class LocationSetViewController: BaseViewController<FilePreviewViewModel> {
if let latitude = recordVO?.locnVO?.latitude,
let longitude = recordVO?.locnVO?.longitude {
setLocation(latitude, longitude)
} else {
let coordinate = Constants.API.Locations.initialLocation
setLocation(coordinate.latitude, coordinate.longitude)
}

navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelButtonPressed(_:)))
Expand All @@ -107,22 +110,26 @@ class LocationSetViewController: BaseViewController<FilePreviewViewModel> {
})
}

func setLocation(_ latitude: Double, _ longitude: Double) {
func setLocation(_ latitude: Double, _ longitude: Double, preserveZoom: Bool = false) {
let coordinate: CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: CLLocationDegrees(latitude), longitude: CLLocationDegrees(longitude))

mapView.moveCamera(GMSCameraUpdate.setTarget(coordinate, zoom: 6))


if preserveZoom {
mapView.animate(toLocation: coordinate)
} else {
mapView.moveCamera(GMSCameraUpdate.setTarget(coordinate, zoom: 6))
}

if marker == nil {
marker = GMSMarker()
}
marker.position = coordinate
marker.map = mapView
}

func saveLocation(_ location: CLLocationCoordinate2D) {
viewModel?.validateLocation(lat: location.latitude, long: location.longitude, completion: { status in
if let locnVO = status {
self.setLocation(location.latitude, location.longitude)
self.setLocation(location.latitude, location.longitude, preserveZoom: true)
self.pickedLocation = locnVO
} else {
self.view.showNotificationBanner(title: "There was a problem saving the location.".localized(), backgroundColor: .deepRed, textColor: .white)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class FileCollectionViewCell: UICollectionViewCell {

fileNameLabel.font = TextFontStyle.style35.font
fileNameLabel.textColor = .black
let fontLineHeight = TextFontStyle.style35.font.lineHeight
let heightConstraint = fileNameLabel.heightAnchor.constraint(greaterThanOrEqualToConstant: ceil(fontLineHeight))
heightConstraint.priority = .defaultHigh
heightConstraint.isActive = true
fileDateLabel.font = TextFontStyle.style12.font
fileDateLabel.textColor = .lightGray
fileImageView.clipsToBounds = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ extension FolderContentView: UICollectionViewDelegateFlowLayout, SkeletonCollect
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let listItemSize = CGSize(width: collectionView.bounds.width - 12, height: 70)
let listItemSize = CGSize(width: collectionView.bounds.width - 12, height: 74)
// Horizontal layout: |-6-cell-6-cell-6-|. 6*3/2 = 9
// Vertical size: 30 is the height of the title label
let gridItemSize = CGSize(width: UIScreen.main.bounds.width / 2 - 9, height: UIScreen.main.bounds.width / 2 + 30)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ extension SearchViewController: UICollectionViewDelegateFlowLayout, UICollection
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let listItemSize = CGSize(width: UIScreen.main.bounds.width, height: 70)
let listItemSize = CGSize(width: UIScreen.main.bounds.width, height: 74)

return listItemSize
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ extension MainViewController: UICollectionViewDelegateFlowLayout, UICollectionVi
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let listItemSize = CGSize(width: UIScreen.main.bounds.width, height: 70)
let listItemSize = CGSize(width: UIScreen.main.bounds.width, height: 74)
// Horizontal layout: |-6-cell-6-cell-6-|. 6*3/2 = 9
// Vertical size: 30 is the height of the title label
let gridItemSize = CGSize(width: UIScreen.main.bounds.width / 2 - 9, height: UIScreen.main.bounds.width / 2 + 30)
Expand Down
Loading