Skip to content

Commit

Permalink
feat: Matomo added for my kSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambrdctr committed Feb 26, 2025
1 parent 831f253 commit c1e90a7
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ extension FileActionsFloatingPanelViewController {
driveFloatingPanelController.dismiss(animated: true) {
guard let self else { return }
self.router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "dropboxQuotaExceeded")
}
}
present(driveFloatingPanelController, animated: true)
Expand All @@ -300,6 +301,7 @@ extension FileActionsFloatingPanelViewController {

if packId == .myKSuite, driveFileManager.drive.dropboxQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "dropboxQuotaExceeded")
return
}

Expand Down
1 change: 1 addition & 0 deletions kDrive/UI/Controller/Files/FileDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ extension FileDetailViewController: ShareLinkTableViewCellDelegate {
func shareLinkSettingsButtonPressed() {
if packId == .myKSuite, driveFileManager.drive.sharedLinkQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkQuotaExceeded")
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ extension ShareAndRightsViewController: UITableViewDelegate, UITableViewDataSour
case .link:
guard !showMykSuiteRestriction(fileHasShareLink: file.hasSharelink) else {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkQuotaExceeded")
return
}

Expand Down Expand Up @@ -327,6 +328,7 @@ extension ShareAndRightsViewController: ShareLinkTableViewCellDelegate {
func shareLinkSettingsButtonPressed() {
if packId == .myKSuite, driveFileManager.drive.sharedLinkQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkQuotaExceeded")
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ extension ShareLinkSettingsViewController: UITableViewDelegate, UITableViewDataS
if !option.isEnabled(drive: driveFileManager.drive) {
cell.actionHandler = { [weak self] _ in
self?.router.presentUpSaleSheet()
if option == .optionPassword {
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkPassword")
} else if option == .optionDate {
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "shareLinkExpiryDate")
}
}
}

Expand Down
1 change: 1 addition & 0 deletions kDrive/UI/Controller/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ extension HomeViewController {
cell.actionHandler = { [weak self] _ in
guard let self else { return }
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "notEnoughStorageUpgrade")
}
cell.closeHandler = { [weak self] _ in
guard let self else { return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class ParameterTableViewController: BaseGroupedTableViewController {
apiFetcher: driveFileManager.apiFetcher,
currentAccount: currentAccount
)
MatomoUtils.track(eventWithCategory: .myKSuite, name: "openDashboard")
navigationController?.present(dashboardViewController, animated: true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class NewFolderTypeTableViewController: UITableViewController {
if content[indexPath.row] == .dropbox {
if packId == .myKSuite, driveFileManager.drive.dropboxQuotaExceeded {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "dropboxQuotaExceeded")
} else if !driveFileManager.drive.pack.capabilities.useDropbox {
let driveFloatingPanelController = DropBoxFloatingPanelViewController.instantiatePanel()
let floatingPanelViewController = driveFloatingPanelController
Expand All @@ -125,6 +126,7 @@ class NewFolderTypeTableViewController: UITableViewController {
driveFloatingPanelController.dismiss(animated: true) { [weak self] in
guard let self else { return }
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "manageDropbox")
}
}
present(driveFloatingPanelController, animated: true)
Expand Down
1 change: 1 addition & 0 deletions kDrive/UI/View/Header view/FilesHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class FilesHeaderView: UICollectionReusableView {

@objc func didTapOnTrashHeaderView() {
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "trashStorageLimit")
}

@objc private func didTapOnCard() {
Expand Down
1 change: 1 addition & 0 deletions kDrive/Utils/FileActionsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ public final class FileActionsHelper {
public static func upsaleFolderColor() {
@InjectService var router: AppNavigable
router.presentUpSaleSheet()
MatomoUtils.track(eventWithCategory: .myKSuiteUpgradeBottomSheet, name: "colorFolder")
}
#endif
}
3 changes: 2 additions & 1 deletion kDriveCore/Utils/MatomoUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public enum MatomoUtils {
public enum EventCategory: String {
case newElement, fileListFileAction, picturesFileAction, fileInfo, shareAndRights, colorFolder, categories, search,
fileList, comment, drive, account, settings, photoSync, home, displayList, inApp, trash,
dropbox, preview, mediaPlayer, shortcuts, appReview, deeplink, publicShareAction, publicSharePasswordAction
dropbox, preview, mediaPlayer, shortcuts, appReview, deeplink, publicShareAction, publicSharePasswordAction,
myKSuite, myKSuiteUpgradeBottomSheet
}

public enum UserAction: String {
Expand Down

0 comments on commit c1e90a7

Please sign in to comment.