Skip to content

[stable-6.6.0] NMC/1933 - Collabora #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: stable-6.6.0
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
AFCE353527E4ED5900FEA6C2 /* DateFormatter+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */; };
AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; };
AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; };
AFCE353927E5DE0500FEA6C2 /* NCShare+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */; };
B52FAE902DA8D9E1001AB1BD /* CollaboraTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAE8F2DA8D9E1001AB1BD /* CollaboraTestCase.swift */; };
B52FAE932DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B52FAE912DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.storyboard */; };
B52FAE942DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAE922DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.swift */; };
B52FAE9C2DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52FAE9A2DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.xib */; };
B52FAE9D2DA8DED9001AB1BD /* FolderPathCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52FAE982DA8DED9001AB1BD /* FolderPathCustomCell.xib */; };
B52FAE9E2DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAE992DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.swift */; };
B52FAE9F2DA8DED9001AB1BD /* FolderPathCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAE972DA8DED9001AB1BD /* FolderPathCustomCell.swift */; };
C04E2F232A17BB4D001BAD85 /* FilesIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04E2F222A17BB4D001BAD85 /* FilesIntegrationTests.swift */; };
D575039F27146F93008DC9DC /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; };
D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; };
F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; };
Expand Down Expand Up @@ -1330,6 +1339,14 @@
AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+Extension.swift"; sourceTree = "<group>"; };
AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCells.swift; sourceTree = "<group>"; };
AFCE353827E5DE0400FEA6C2 /* Shareable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = "<group>"; };
AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCShare+Helper.swift"; sourceTree = "<group>"; };
B52FAE8F2DA8D9E1001AB1BD /* CollaboraTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollaboraTestCase.swift; sourceTree = "<group>"; };
B52FAE912DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCCreateFormUploadDocuments.storyboard; sourceTree = "<group>"; };
B52FAE922DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadDocuments.swift; sourceTree = "<group>"; };
B52FAE972DA8DED9001AB1BD /* FolderPathCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FolderPathCustomCell.swift; sourceTree = "<group>"; };
B52FAE982DA8DED9001AB1BD /* FolderPathCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FolderPathCustomCell.xib; sourceTree = "<group>"; };
B52FAE992DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateDocumentCustomTextField.swift; sourceTree = "<group>"; };
B52FAE9A2DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCCreateDocumentCustomTextField.xib; sourceTree = "<group>"; };
C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2118,6 +2135,8 @@
isa = PBXGroup;
children = (
AA52EB452D42AC5A0089C348 /* Placeholder.swift */,
B52FAE8F2DA8D9E1001AB1BD /* CollaboraTestCase.swift */,
AF8ED1FB2757821000B8DBC4 /* NextcloudUnitTests.swift */,
);
path = NextcloudUnitTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -2156,6 +2175,17 @@
path = Advanced;
sourceTree = "<group>";
};
B52FAE9B2DA8DED9001AB1BD /* NMC Custom Views */ = {
isa = PBXGroup;
children = (
B52FAE972DA8DED9001AB1BD /* FolderPathCustomCell.swift */,
B52FAE982DA8DED9001AB1BD /* FolderPathCustomCell.xib */,
B52FAE992DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.swift */,
B52FAE9A2DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.xib */,
);
path = "NMC Custom Views";
sourceTree = "<group>";
};
C0046CDB2A17B98400D87C9D /* NextcloudUITests */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3195,6 +3225,8 @@
F7DFB7E9219C5A0500680748 /* Create cloud */ = {
isa = PBXGroup;
children = (
B52FAE912DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.storyboard */,
B52FAE922DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.swift */,
F7FA7FFD2C0F4F3B0072FC60 /* Upload Assets */,
F7A509242C26BD5D00326106 /* NCCreateDocument.swift */,
F704B5E22430AA6F00632F5F /* NCCreateFormUploadConflict.storyboard */,
Expand Down Expand Up @@ -3301,6 +3333,7 @@
isa = PBXGroup;
children = (
AA517BB42D66149900F8D37C /* .tx */,
B52FAE9B2DA8DED9001AB1BD /* NMC Custom Views */,
F702F2CC25EE5B4F008F8E80 /* AppDelegate.swift */,
F794E13E2BBC0F70003693D7 /* SceneDelegate.swift */,
F77DD6A72C5CC093009448FB /* NCSession.swift */,
Expand Down Expand Up @@ -3999,6 +4032,8 @@
F717402D24F699A5000C87D5 /* NCFavorite.storyboard in Resources */,
F723B3DD22FC6D1D00301EFE /* NCShareCommentsCell.xib in Resources */,
F78ACD4B21903F850088454D /* NCTrashListCell.xib in Resources */,
B52FAE9C2DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.xib in Resources */,
B52FAE9D2DA8DED9001AB1BD /* FolderPathCustomCell.xib in Resources */,
AF93471927E2361E002537EE /* NCShareAdvancePermissionFooter.xib in Resources */,
F7725A61251F33BB00D125E0 /* NCFiles.storyboard in Resources */,
F7CBC1232BAC8B0000EC1D55 /* NCSectionFirstHeaderEmptyData.xib in Resources */,
Expand All @@ -4019,6 +4054,7 @@
F78ACD54219047D40088454D /* NCSectionFooter.xib in Resources */,
F751247E2C42919C00E63DB8 /* NCPhotoCell.xib in Resources */,
F704B5E32430AA6F00632F5F /* NCCreateFormUploadConflict.storyboard in Resources */,
B52FAE932DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.storyboard in Resources */,
F7EDE509262DA9D600414FE6 /* NCSelectCommandViewSelect.xib in Resources */,
F732D23327CF8AED000B0F1B /* NCPlayerToolBar.xib in Resources */,
F73D11FA253C5F4800DF9BEC /* NCViewerNextcloudText.storyboard in Resources */,
Expand Down Expand Up @@ -4556,6 +4592,7 @@
F7E7AEA72BA32D0000512E52 /* NCCollectionViewUnifiedSearch.swift in Sources */,
F73EF7A72B0223900087E6E9 /* NCManageDatabase+Comments.swift in Sources */,
F33918C42C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift in Sources */,
B52FAE942DA8DCB2001AB1BD /* NCCreateFormUploadDocuments.swift in Sources */,
F39170AD2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
F799DF882C4B83CC003410B5 /* NCCollectionViewCommon+EasyTipView.swift in Sources */,
F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */,
Expand Down Expand Up @@ -4686,6 +4723,8 @@
F3A047972BD2668800658E7B /* NCAssistantEmptyView.swift in Sources */,
F757CC8D29E82D0500F31428 /* NCGroupfolders.swift in Sources */,
F760329F252F0F8E0015A421 /* NCTransferCell.swift in Sources */,
B52FAE9E2DA8DED9001AB1BD /* NCCreateDocumentCustomTextField.swift in Sources */,
B52FAE9F2DA8DED9001AB1BD /* FolderPathCustomCell.swift in Sources */,
F3BB46542A3A1E9D00461F6E /* CCCellMore.swift in Sources */,
AF68326A27BE65A90010BF0B /* NCMenuAction.swift in Sources */,
F7682FE023C36B0500983A04 /* NCMainTabBar.swift in Sources */,
Expand Down
142 changes: 142 additions & 0 deletions Tests/NextcloudUnitTests/CollaboraTestCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
//
// CollaboraTestCase.swift
// NextcloudTests
//
// Created by A200073704 on 06/05/23.
// Copyright © 2023 Marino Faggiana. All rights reserved.
//

@testable import Nextcloud
import XCTest
import NextcloudKit

class CollaboraTestCase: XCTestCase {


override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testCollaboraDocumentIsPresent() {

var viewForDocument: NCMenuAction?

if let image = UIImage(named: "create_file_document") {
viewForDocument = NCMenuAction(title: NSLocalizedString("_create_new_document_", comment: ""), icon: image, action: { _ in
guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() as? UINavigationController else {
return
}

let viewController = navigationController.topViewController as? NCCreateFormUploadDocuments
viewController?.titleForm = NSLocalizedString("_create_new_document_", comment: "")
})
}

XCTAssertNotNil(viewForDocument)

}

func testCollaboraPresentationIsPresent() {

var viewForPresentation: NCMenuAction?

if let image = UIImage(named: "create_file_ppt") {
viewForPresentation = NCMenuAction(title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: image, action: { _ in
guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() as? UINavigationController else {
return
}

let viewController = navigationController.topViewController as? NCCreateFormUploadDocuments
viewController?.titleForm = NSLocalizedString("_create_new_presentation_", comment: "")
})
}

XCTAssertNotNil(viewForPresentation)

}

func testCollaboraSpreadsheetIsPresent() {

var viewForSpreadsheet: NCMenuAction?

if let image = UIImage(named: "create_file_xls") {
viewForSpreadsheet = NCMenuAction(title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: image, action: { _ in
guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() as? UINavigationController else {
return
}

let viewController = navigationController.topViewController as? NCCreateFormUploadDocuments
viewController?.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "")
})
}

XCTAssertNotNil(viewForSpreadsheet)

}

func testTextDocumentIsPresent() {

var textMenu: NCMenuAction?

if let image = UIImage(named: "file_txt_menu") {
textMenu = NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), icon: image, action: { _ in
guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() as? UINavigationController else {
return
}

let viewController = navigationController.topViewController as? NCCreateFormUploadDocuments
viewController?.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "")
})
}

XCTAssertNotNil(textMenu)

}

func testTextDocumentAction() {

let text = NCGlobal.shared.actionTextDocument
XCTAssertNotNil(text, "Text Editor Should be opened")
}

func testTextFieldIsPresent() {

let storyboard = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil)
guard let viewController = storyboard.instantiateInitialViewController() as? NCCreateFormUploadDocuments else {
return
}

// Verify that a text field is present in the view controller
let textFields = viewController.view.subviews.filter { $0 is UITextField }
XCTAssertFalse(textFields.isEmpty, "No text field found in NCCreateFormUploadDocuments")
}

func testSavePathFolder() {

let viewController = NCCreateFormUploadDocuments()

let form : XLFormDescriptor = XLFormDescriptor() as XLFormDescriptor
form.rowNavigationOptions = XLFormRowNavigationOptions.stopDisableRow

var row : XLFormRowDescriptor

// the section with the title "Folder Destination"

row = XLFormRowDescriptor(tag: "ButtonDestinationFolder", rowType: "kNMCFolderCustomCellType", title: "")
row.action.formSelector = #selector(viewController.changeDestinationFolder(_:))

// Verify that section was found
XCTAssertNotNil(row, "Expected save path section to exist in form.")

}






}
2 changes: 1 addition & 1 deletion iOSClient/BrowserWeb/NCBrowserWeb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class NCBrowserWeb: UIViewController {
buttonExit.isHidden = true
} else {
self.view.bringSubviewToFront(buttonExit)
let image = NCUtility().loadImage(named: "xmark", colors: [.systemBlue])
let image = NCUtility().loadImage(named: "xmark", colors: [NCBrandColor.shared.customer])
buttonExit.setImage(image, for: .normal)
}

Expand Down
Loading