Skip to content

Commit 7a7e825

Browse files
felix-schwarzhosy
andauthored
[feature/new-issue-view] New Issue view / presentation (#874)
* Add support for TLS certificate change diff: - ConnectionIssueViewController: - compare against certificate stored in the bookmark where available - remove text-based rendering via CertificateViewController (and remove the class), replace it with the standard certificate view controller - adaptions to new ThemeCertificateViewController initialization where needed - update SDK * - update sdk * - Issues presentation - remove IssuesViewController, ConnectionIssueViewController, IssuesPresentationAnimator and IssuesDismissalAnimator - create modern replacement leveraging existing code: IssuesCardViewController - migrate code from ConnectionIssueViewController to IssuesCardViewController - add new helper function to compare DisplayIssues issue levels without having to use .rawValue - MoreViewController - becomes FrameViewController - adds the ability to also add a footer view - cleanup: removal of unused properties and initializers - StaticTableViewRow: add .messageStyle support - ThemeTableViewCell: add .messageStyle support and add additional CellStyler block API based on also new CellStyleSet - AlertView: - add support for .accessibilityIdentifier - add option for custom .contentPadding - add button-only mode - CardPresentationController: - ensure .dismissable is actually respected - fix premature release of CardTransitionDelegate that could lead to normal presentation rather than as a card * - add missing licensing comment * - update SDK * Address finding 1 in #874 and fix missing fill color in the safe area: - FrameViewController: include table background color pin theming support - ThemeTableViewCell: - support recreation of labels and custom layout of these labels - add primaryTextLabel and primaryDetailTextLabel accessors to access text labels irrespective of whether they are system-provided or recreated - StaticTableViewRow - add support for recreated labels and their custom layout - IssuesCardViewController - replace usage of constraints in CardCellBackgroundView with auto resized views (fixes auto layout constraint warnings) - switch to using primaryTextLabel and primaryDetailTextLabel and a custom recreatedLabelLayout Co-authored-by: Matthias Hühne <github@hosy.de>
1 parent 79eec1d commit 7a7e825

File tree

24 files changed

+604
-806
lines changed

24 files changed

+604
-806
lines changed

ownCloud.xcodeproj/project.pbxproj

Lines changed: 16 additions & 48 deletions
Large diffs are not rendered by default.

ownCloud/Bookmarks/BookmarkViewController.swift

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,12 @@ class BookmarkViewController: StaticTableViewController {
422422

423423
if issue != nil {
424424
// Parse issue for display
425-
if let displayIssues = issue?.prepareForDisplay() {
426-
if displayIssues.displayLevel.rawValue >= OCIssueLevel.warning.rawValue {
425+
if let issue = issue {
426+
let displayIssues = issue.prepareForDisplay()
427+
428+
if displayIssues.isAtLeast(level: .warning) {
427429
// Present issues if the level is >= warning
428-
let issuesViewController = ConnectionIssueViewController(displayIssues: displayIssues, completion: { [weak self] (response) in
430+
IssuesCardViewController.present(on: self, issue: issue, displayIssues: displayIssues, completion: { [weak self, weak issue] (response) in
429431
switch response {
430432
case .cancel:
431433
issue?.reject()
@@ -439,11 +441,9 @@ class BookmarkViewController: StaticTableViewController {
439441
self?.bookmark?.url = nil
440442
}
441443
})
442-
443-
self.present(issuesViewController, animated: true, completion: nil)
444444
} else {
445445
// Do not present issues
446-
issue?.approve()
446+
issue.approve()
447447
continueToNextStep()
448448
}
449449
}
@@ -503,8 +503,8 @@ class BookmarkViewController: StaticTableViewController {
503503
self.updateInputFocus(fallbackRow: self.passwordRow)
504504
} else if nsError?.isOCError(withCode: .authorizationCancelled) == true {
505505
// User cancelled authorization, no reaction needed
506-
} else {
507-
let issuesViewController = ConnectionIssueViewController(displayIssues: issue?.prepareForDisplay(), completion: { [weak self] (response) in
506+
} else if let issue = issue {
507+
IssuesCardViewController.present(on: self, issue: issue, completion: { [weak self, weak issue] (response) in
508508
switch response {
509509
case .cancel:
510510
issue?.reject()
@@ -516,8 +516,6 @@ class BookmarkViewController: StaticTableViewController {
516516
case .dismiss: break
517517
}
518518
})
519-
520-
self.present(issuesViewController, animated: true, completion: nil)
521519
}
522520
})
523521
}
@@ -598,10 +596,10 @@ class BookmarkViewController: StaticTableViewController {
598596
} else {
599597
OnMainThread {
600598
hudCompletion({
601-
if issue != nil {
599+
if let issue = issue {
602600
self?.bookmark?.authenticationData = nil
603601

604-
let issuesViewController = ConnectionIssueViewController(displayIssues: issue?.prepareForDisplay(), completion: { [weak self] (response) in
602+
IssuesCardViewController.present(on: strongSelf, issue: issue, completion: { [weak self, weak issue] (response) in
605603
switch response {
606604
case .cancel:
607605
issue?.reject()
@@ -613,8 +611,6 @@ class BookmarkViewController: StaticTableViewController {
613611
case .dismiss: break
614612
}
615613
})
616-
617-
strongSelf.present(issuesViewController, animated: true, completion: nil)
618614
} else {
619615
strongSelf.presentingViewController?.dismiss(animated: true, completion: nil)
620616
}

ownCloud/Bookmarks/Issues/Issues Animators/IssuesDismissalAnimator.swift

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

ownCloud/Bookmarks/Issues/Issues Animators/IssuesPresentationAnimator.swift

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

ownCloud/Bookmarks/Issues/Issues Subclasses/CertificateViewController.swift

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

0 commit comments

Comments
 (0)