Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve issue reporting a bit #2641

Merged
merged 1 commit into from
Mar 14, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.apache.logging.log4j.core.LogEvent;

public class ErrorConsoleViewModel extends AbstractViewModel {

private static final Log LOGGER = LogFactory.getLog(ErrorConsoleViewModel.class);

private final DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
private final Date date = new Date();
private final DialogService dialogService;
Expand Down Expand Up @@ -86,25 +86,32 @@ public void copyLog(List<LogEventViewModel> messages) {
*/
public void reportIssue() {
try {
String issueTitle = "Automatic Bug Report-" + dateFormat.format(date);
String issueBody = String.format("JabRef %s%n%s %s %s %nJava %s\n\n", buildInfo.getVersion(), BuildInfo.OS,
String issueTitle = "Automatic Bug Report - " + dateFormat.format(date);
// system info
String systemInfo = String.format("JabRef %s%n%s %s %s %nJava %s", buildInfo.getVersion(), BuildInfo.OS,
BuildInfo.OS_VERSION, BuildInfo.OS_ARCH, BuildInfo.JAVA_VERSION);
// steps to reproduce
String howToReproduce = "Steps to reproduce:\n\n1. ...\n2. ...\n3. ...";
// log messages
String issueDetails = "<details>\n" + "<summary>" + "Detail information:" + "</summary>\n\n```\n"
+ getLogMessagesAsString(allMessagesData) + "\n```\n\n</details>";
clipBoardManager.setClipboardContents(issueDetails);
// bug report body
String issueBody = systemInfo + "\n\n" + howToReproduce + "\n\n" + "Paste your log details here.";

dialogService.notify(Localization.lang("Issue on GitHub successfully reported."));
dialogService.showInformationDialogAndWait(Localization.lang("Issue report successful"),
Localization.lang("Your issue was reported in your browser.") + "\n" +
Localization.lang("The log and exception information was copied to your clipboard.") + " " +
Localization.lang("Please paste this information (with Ctrl+V) in the issue description."));
Localization.lang("Please paste this information (with Ctrl+V) in the issue description.") + "\n" +
Localization.lang("Please also add all steps to reproduce this issue, if possible."));

URIBuilder uriBuilder = new URIBuilder()
.setScheme("https").setHost("github.com")
.setPath("/JabRef/jabref/issues/new")
.setParameter("title", issueTitle)
.setParameter("body", issueBody);
JabRefDesktop.openBrowser(uriBuilder.build().toString());

// Append log messages in issue description
String issueDetails = "<details>\n" + "<summary>" + "Detail information:" + "</summary>\n\n```\n"
+ getLogMessagesAsString(allMessagesData) + "\n```\n\n</details>";
clipBoardManager.setClipboardContents(issueDetails);
} catch (IOException | URISyntaxException e) {
LOGGER.error(e);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=Größe_für_kleine_Icon
Default_table_font_size=Standard_Tabellenschriftgröße
Escape_underscores=Unterstriche_maskieren
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=Size_of_small_icons
Default_table_font_size=Default_table_font_size
Escape_underscores=Escape_underscores
Color=Color
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=Taille_des_petits_icones
Default_table_font_size=Taille_par_défaut_des_police_du_tableau
Escape_underscores=Echapper_les_soulignements
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=Maskera_understreck
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2357,3 +2357,4 @@ Size_of_small_icons=
Default_table_font_size=
Escape_underscores=
Color=
Please_also_add_all_steps_to_reproduce_this_issue,_if_possible.=