From 366a16b933b70bcdf8ac0aedf823bcf620fb9f5a Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Sat, 23 Apr 2016 08:20:54 -0400 Subject: [PATCH] Add "Report a Bug" page to replace Jack's temporary one --- dist/index.html | 1 + js/app.js | 4 +++- js/page/help.js | 3 +-- js/page/report.js | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 js/page/report.js diff --git a/dist/index.html b/dist/index.html index 4832a297f..4bfac2bd2 100644 --- a/dist/index.html +++ b/dist/index.html @@ -28,6 +28,7 @@ + diff --git a/js/app.js b/js/app.js index 0d05fb9c7..ac6d67509 100644 --- a/js/app.js +++ b/js/app.js @@ -9,7 +9,7 @@ var App = React.createClass({ var match, param, val; [match, param, val] = window.location.search.match(/\??([^=]*)(?:=(.*))?/); - if (['settings', 'help', 'start', 'watch'].indexOf(param) != -1) { + if (['settings', 'help', 'start', 'watch', 'report'].indexOf(param) != -1) { var viewingPage = param; } else { var viewingPage = 'home'; @@ -60,6 +60,8 @@ var App = React.createClass({ var content = ; } else if (this.state.viewingPage == 'watch') { var content = ; + } else if (this.state.viewingPage == 'report') { + var content = ; } else if (this.state.viewingPage == 'start') { var content = ; } diff --git a/js/page/help.js b/js/page/help.js index 9088b6180..80df7ec41 100644 --- a/js/page/help.js +++ b/js/page/help.js @@ -30,9 +30,8 @@ var HelpPage = React.createClass({

None of this applies to me, or it didn't work

- + Please . Thanks!

-





diff --git a/js/page/report.js b/js/page/report.js new file mode 100644 index 000000000..ddfb999c4 --- /dev/null +++ b/js/page/report.js @@ -0,0 +1,39 @@ +var ReportPage = React.createClass({ + submitMessage: function() { + if (this._messageArea.value) { + this.setState({ + submitting: true + }); + lbry.reportBug(this._messageArea.value, () => { + this.setState({ + submitting: false + }); + alert("Your bug report has been submitted! Thank you for your feedback."); + }); + this._messageArea.value = ''; + } + }, + getInitialState: function() { + return { + submitting: false, + } + }, + render: function() { + return ( +
+

Report a bug

+
+

Please describe the problem you experienced and any information you think might be useful to us. Links to screenshots are great!

+