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:
James Sherlock
2017-09-25 16:24:14 +01:00
committed by Ryan Nystrom
parent ac94168de0
commit f40557eeaf
12 changed files with 422 additions and 12 deletions

View File

@@ -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())