Skip to content

Commit

Permalink
Merge pull request #3 from jamf/individual-add-and-deletes
Browse files Browse the repository at this point in the history
Individual add and deletes
  • Loading branch information
HarryStrandJamf authored May 9, 2024
2 parents 22504e7 + 195e711 commit 03da1de
Show file tree
Hide file tree
Showing 31 changed files with 675 additions and 248 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: MIT
# Copyright 2024, Jamf

* @HarryStrandJamf @BIG-RAT @KapnKerk @mjKosmic @rydgecrakerjamf @jamf/apple-natives-write
* @jamf/jamf_sync-maintainer
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0] - 2024-05-08
### Features
- Added buttons below the source and destination distribution point to allow local files to be added or removed directly to/from the distribution point.
- Added the ability to copy selected log messages to the clipboard.
- Added support for mpkg files.
### Bug fixes
- Changed the timeout for uploads to an hour to solve an issue with large uploads. This does not solve the issue with files > 5 GB that are uploaded to a JCDS2 DP.
- Fixed an issue with the "Cloud" DP type where the file progress wasn't quite right.

## [1.2.0] - 2024-04-16
### Features
- Added the ability to use the v1/packages endpoint on Jamf Pro version 11.5 and above, which includes the ablity to upload files to any cloud instance that Jamf Pro supports. It shows up as a distribution point called "Cloud", but only for the destination since there isn't a way to download those files at this time.
Expand Down
12 changes: 10 additions & 2 deletions Jamf Sync.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
840A79032ACB75FC00161D85 /* SavableItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840A79022ACB75FC00161D85 /* SavableItem.swift */; };
840A79072ACC8EFF00161D85 /* FolderInstance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840A79062ACC8EFF00161D85 /* FolderInstance.swift */; };
840A79092ACD9B0A00161D85 /* ConfirmationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840A79082ACD9B0A00161D85 /* ConfirmationView.swift */; };
8412279F2BEADBB20097B83E /* XmlErrorParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8412279E2BEADBB20097B83E /* XmlErrorParser.swift */; };
841227A12BEADD6E0097B83E /* XmlErrorParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841227A02BEADD6E0097B83E /* XmlErrorParserTests.swift */; };
841DE9D92BA395900092DBE7 /* Jamf Sync User Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 841DE9D82BA395900092DBE7 /* Jamf Sync User Guide.pdf */; };
843BE0F62AEFE6350053431B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 843BE0F52AEFE6350053431B /* Assets.xcassets */; };
844CF9D12AC4B96600576E1A /* FolderDp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844CF9D02AC4B96600576E1A /* FolderDp.swift */; };
Expand Down Expand Up @@ -113,6 +115,8 @@
840A79022ACB75FC00161D85 /* SavableItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SavableItem.swift; sourceTree = "<group>"; };
840A79062ACC8EFF00161D85 /* FolderInstance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FolderInstance.swift; sourceTree = "<group>"; };
840A79082ACD9B0A00161D85 /* ConfirmationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmationView.swift; sourceTree = "<group>"; };
8412279E2BEADBB20097B83E /* XmlErrorParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XmlErrorParser.swift; sourceTree = "<group>"; };
841227A02BEADD6E0097B83E /* XmlErrorParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XmlErrorParserTests.swift; sourceTree = "<group>"; };
841DE9D82BA395900092DBE7 /* Jamf Sync User Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Jamf Sync User Guide.pdf"; sourceTree = "<group>"; };
841DE9DA2BA395F00092DBE7 /* User Guide */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "User Guide"; sourceTree = "<group>"; };
843BE0F52AEFE6350053431B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -292,6 +296,7 @@
846499DC2B699F5E00A8EA7B /* Mocks */,
846499E32B6B080B00A8EA7B /* SynchronizeTaskTests.swift */,
846499D22B64165E00A8EA7B /* TestErrors.swift */,
841227A02BEADD6E0097B83E /* XmlErrorParserTests.swift */,
);
path = JamfSyncTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -378,6 +383,7 @@
84E489982B5AC80600FFFE59 /* UserSettings.swift */,
84FC415F2AD5A78C00DCB033 /* View+NSWindow.swift */,
849FC3402BD06A43008BAC02 /* VersionInfo.swift */,
8412279E2BEADBB20097B83E /* XmlErrorParser.swift */,
);
path = Utility;
sourceTree = "<group>";
Expand Down Expand Up @@ -585,6 +591,7 @@
849FC3412BD06A43008BAC02 /* VersionInfo.swift in Sources */,
84E489992B5AC80600FFFE59 /* UserSettings.swift in Sources */,
84BC6E472AC380D200CF6D39 /* JamfProServerView.swift in Sources */,
8412279F2BEADBB20097B83E /* XmlErrorParser.swift in Sources */,
84E489932B58681D00FFFE59 /* LogMessageView.swift in Sources */,
84DD58372BC58E0D00E8DA23 /* JamfProPackageApi.swift in Sources */,
84DD583B2BC5C2A700E8DA23 /* URL+isDirectory.swift in Sources */,
Expand Down Expand Up @@ -632,6 +639,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
841227A12BEADD6E0097B83E /* XmlErrorParserTests.swift in Sources */,
846499E02B699FB500A8EA7B /* MockJamfProInstance.swift in Sources */,
846499DE2B699F8E00A8EA7B /* MockDistributionPoint.swift in Sources */,
846499D52B64268A00A8EA7B /* DistributionPointTests.swift in Sources */,
Expand Down Expand Up @@ -813,7 +821,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.2.0;
MARKETING_VERSION = 1.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.jamf.jamfsync;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -845,7 +853,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.2.0;
MARKETING_VERSION = 1.3.0;
PRODUCT_BUNDLE_IDENTIFIER = com.jamf.jamfsync;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/jamf/Subprocess",
"state" : {
"revision" : "2fdaccadfe68bc80f53cfc2d5d2d2363a8d6a5a6",
"version" : "3.0.2"
"revision" : "9044073a5c3a9e36abcc7df4d833507b093c00e0",
"version" : "3.0.3"
}
},
{
Expand Down
30 changes: 10 additions & 20 deletions JamfSync/Model/DataModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class DataModel: ObservableObject {
@Published var dpsForDestination: [DistributionPoint] = []
@Published var selectedSrcDpId = DataModel.noSelection
@Published var selectedDstDpId = DataModel.noSelection
@Published var selectedDpFiles: Set<DpFile.ID> = []
@Published var forceSync = false
@Published var showSpinner = false
@Published var shouldPromptForDpPassword = false
Expand Down Expand Up @@ -175,30 +174,21 @@ class DataModel: ObservableObject {
return synchronizationInProgress || selectedSrcDpId == DataModel.noSelection || selectedDstDpId == DataModel.noSelection || selectedSrcDpId == selectedDstDpId
}

func adjustSelectedItems() {
var idsToAdd: [UUID] = []
var idsToRemove: [UUID] = []
for id in selectedDpFiles {
if let dstFile = dstPackageListViewModel.dpFiles.findDpFileViewModel(id: id) {
if let srcFile = srcPackageListViewModel.dpFiles.findDpFile(name: dstFile.dpFile.name) {
idsToAdd.append(srcFile.id)
}
idsToRemove.append(dstFile.id)
}
}
for id in idsToAdd {
selectedDpFiles.insert(id)
}
for id in idsToRemove {
selectedDpFiles.remove(id)
}
}

func verifySelectedItemsStillExist() {
verifySrcSelectedItemsStillExist()
verifyDstSelectedItemsStillExist()
}

func selectedDpFilesFromSelectionIds(packageListViewModel: PackageListViewModel) -> [DpFile] {
var selectedFiles: [DpFile] = []
for id in packageListViewModel.selectedDpFiles {
if let viewModel = packageListViewModel.dpFiles.findDpFileViewModel(id: id) {
selectedFiles.append(viewModel.dpFile)
}
}
return selectedFiles
}

// MARK: Private functions

private func updateDpsForSourceAndDestination() {
Expand Down
Loading

0 comments on commit 03da1de

Please sign in to comment.