mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-24 00:49:37 +08:00
Native Create Issue (#311)
* Add a "Create Issue" view controller, Hook up networking, Enable bug reporting * Add create issue button to all repos * Fix navigation for tablet, Add markdown controls view * Remove new issue button if issues are not enabled * Add localization for new issue text * Update scrollView insets on keyboard, Add slight background * More style changes, moved preview to it's own button, expanding text view, return takes you to next field * Update bug report repository * Design changes * Add markdown controls to new issue
This commit is contained in:
committed by
Ryan Nystrom
parent
ac94168de0
commit
f40557eeaf
@@ -91,9 +91,33 @@ class RepositoryViewController: TabmanViewController, PageboyViewControllerDataS
|
||||
strongSelf.presentSafari(url: url)
|
||||
}
|
||||
}
|
||||
|
||||
func newIssueAction() -> UIAlertAction {
|
||||
return UIAlertAction(title: NSLocalizedString("Create Issue", comment: ""), style: .default) { [weak self] _ in
|
||||
guard let strongSelf = self else { return }
|
||||
|
||||
guard let newIssueViewController = NewIssueTableViewController.create(
|
||||
client: strongSelf.client,
|
||||
owner: strongSelf.repo.owner,
|
||||
repo: strongSelf.repo.name,
|
||||
signature: .sentWithGitHawk)
|
||||
else {
|
||||
StatusBar.showGenericError()
|
||||
return
|
||||
}
|
||||
|
||||
let navController = UINavigationController(rootViewController: newIssueViewController)
|
||||
strongSelf.showDetailViewController(navController, sender: nil)
|
||||
}
|
||||
}
|
||||
|
||||
func onMore(sender: UIBarButtonItem) {
|
||||
let alert = UIAlertController.configured(preferredStyle: .actionSheet)
|
||||
|
||||
if repo.hasIssuesEnabled {
|
||||
alert.addAction(newIssueAction())
|
||||
}
|
||||
|
||||
alert.addAction(shareAction(sender: sender))
|
||||
alert.addAction(safariAction())
|
||||
alert.addAction(viewOwnerAction())
|
||||
|
||||
Reference in New Issue
Block a user