Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Lowercase issue/PR search string #2360

Merged
merged 3 commits into from
Oct 27, 2018
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
1 change: 0 additions & 1 deletion Classes/History/PathCommitSectionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ final class PathCommitSectionController: ListSwiftSectionController<PathCommitMo
}

}

9 changes: 4 additions & 5 deletions Classes/Issues/IssuesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ final class IssuesViewController: MessageViewController,
IssueTextActionsViewSendDelegate,
EmptyViewDelegate,
MessageTextViewListener,
IssueLabelTapSectionControllerDelegate
{
IssueLabelTapSectionControllerDelegate {

private let client: GithubClient
private let model: IssueDetailsModel
Expand Down Expand Up @@ -486,7 +485,7 @@ final class IssuesViewController: MessageViewController,
client: client,
mergeCapable: viewerIsCollaborator,
resultID: resultID
)
)

// deprecated
case is IssueDiffHunkModel: return IssueDiffHunkSectionController()
Expand Down Expand Up @@ -635,9 +634,9 @@ final class IssuesViewController: MessageViewController,

func didChangeSelection(textView: MessageTextView) {}
func willChangeRange(textView: MessageTextView, to range: NSRange) {}

// MARK: IssueLabelsSectionControllerDelegate

func didTapIssueLabel(owner: String, repo: String, label: String) {
guard let issueType = self.issueType else { return }
presentLabels(client: client, owner: owner, repo: repo, label: label, type: issueType)
Expand Down
6 changes: 2 additions & 4 deletions Classes/Issues/Labeled/IssueLabeledSectionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import Foundation
import IGListKit



final class IssueLabeledSectionController: ListGenericSectionController<IssueLabeledModel>, MarkdownStyledTextViewDelegate {

private let issueModel: IssueDetailsModel
Expand All @@ -35,13 +33,13 @@ final class IssueLabeledSectionController: ListGenericSectionController<IssueLab
cell.delegate = self
return cell
}

func didTap(cell: MarkdownStyledTextView, attribute: DetectedMarkdownAttribute) {
if case .label(let label) = attribute {
tapDelegate?.didTapIssueLabel(owner: label.owner, repo: label.repo, label: label.label)
} else {
viewController?.handle(attribute: attribute)
}
}

}
3 changes: 1 addition & 2 deletions Classes/Issues/Labels/IssueLabelsSectionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
import UIKit
import IGListKit


protocol IssueLabelTapSectionControllerDelegate: class {
func didTapIssueLabel(owner: String, repo: String, label: String)
}

final class IssueLabelsSectionController: ListBindingSectionController<IssueLabelsModel>,
ListBindingSectionControllerDataSource,
ListBindingSectionControllerDataSource,
ListBindingSectionControllerSelectionDelegate {

private let issue: IssueDetailsModel
Expand Down
6 changes: 3 additions & 3 deletions Classes/Repository/RepositoryIssuesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum RepositoryIssuesType {
}

class RepositoryIssuesViewController: BaseListViewController<NSString>,
BaseListViewControllerDataSource,
BaseListViewControllerDataSource,
SearchBarSectionControllerDelegate {

private var models = [ListDiffable]()
Expand Down Expand Up @@ -58,7 +58,7 @@ SearchBarSectionControllerDelegate {
super.viewDidLoad()

makeBackBarItemEmpty()

let presentingInTabMan = label == nil
if presentingInTabMan {
// set the frame in -viewDidLoad is required when working with TabMan
Expand Down Expand Up @@ -139,7 +139,7 @@ SearchBarSectionControllerDelegate {
case .issues: typeQuery = "is:issue"
case .pullRequests: typeQuery = "is:pr"
}
return "repo:\(owner)/\(repo) \(typeQuery) \(previousSearchString)"
return "repo:\(owner)/\(repo) \(typeQuery) \(previousSearchString)".lowercased()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extension UIViewController {
type: type,
label: label
)

navigationController?.pushViewController(
repositoryIssuesViewController,
animated: true
Expand Down