This repository was archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 384
Fix for "Disallow Empty Bug Reports" Issue #2615 #2676
Open
wayni208
wants to merge
7
commits into
GitHawkApp:master
Choose a base branch
from
wayni208:fix-empty-bug-reports
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a2505e1
Fix for "Disallow Empty Bug Reports" Issue #2615
wayni208 a8137a8
Fix for "Disallow Empty Bug Reports" Issue #2615
wayni208 bceb428
Fix for "Disallow Empty Bug Reports" Issue #2615
wayni208 d78d504
Fix for "Disallow Empty Bug Reports" Issue #2615
wayni208 a43a06f
Fix for "Disallow Empty Bug Reports" Issue #2615
wayni208 26bdaff
Fix for "Disallow Empty Bug Reports" Issue #2615
wayni208 3a16297
Fix for "Disallow Empty Bug Reports" Issue #2615
wayni208 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,8 +140,26 @@ final class NewIssueTableViewController: UITableViewController, UITextFieldDeleg | |
|
|
||
| /// Attempts to sends the current forms information to GitHub, on success will redirect the user to the new issue | ||
| @objc func onSend() { | ||
| if let bodyText = bodyText { | ||
| self.finishSend() | ||
| } else { | ||
| let submitAlert = UIAlertController(title: "Please Provide Description", message: "Are you certain you want to submit this issue without a description?", preferredStyle: UIAlertControllerStyle.alert) | ||
|
||
|
|
||
| submitAlert.addAction(UIAlertAction(title: "Submit", style: .default, handler: { (action: UIAlertAction!) in | ||
BasThomas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| self.finishSend() | ||
| })) | ||
|
|
||
| submitAlert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { (action: UIAlertAction!) in | ||
| submitAlert .dismiss(animated: true, completion: nil) | ||
BasThomas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| })) | ||
|
|
||
| present(submitAlert, animated: true, completion: nil) | ||
BasThomas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| } | ||
| func finishSend() { | ||
| guard let titleText = titleText else { | ||
| Squawk.showError(message: NSLocalizedString("You must provide a title!", comment: "Invalid title when sending new issue")) | ||
| Squawk.showIssueError(message: NSLocalizedString("An issue title is required. Please add a title and try again.", comment: "Invalid title when sending new issue"), view: bodyField) | ||
| return | ||
| } | ||
|
|
||
|
|
@@ -205,7 +223,7 @@ final class NewIssueTableViewController: UITableViewController, UITextFieldDeleg | |
| bodyField.inputAccessoryView = actions | ||
| } | ||
|
|
||
| // MARK: UITextFieldDelegate | ||
| // MARK: UITextFieldDelegate | ||
|
|
||
| /// Called when the user taps return on the title field, moves their cursor to the body | ||
| func textFieldShouldReturn(_ textField: UITextField) -> Bool { | ||
|
|
@@ -215,7 +233,7 @@ final class NewIssueTableViewController: UITableViewController, UITextFieldDeleg | |
|
|
||
| // MARK: Actions | ||
|
|
||
| /// Called when editing changed on the title field, enable/disable submit button based on title text | ||
| /// Called when editing changed on the title field, enable/disable submit button based on title and body | ||
| @IBAction func titleFieldEditingChanged(_ sender: Any) { | ||
| navigationItem.rightBarButtonItem?.isEnabled = titleText != nil | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.