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 unknown platform issue template #2041

Merged
merged 1 commit into from
Sep 9, 2024
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
15 changes: 15 additions & 0 deletions static/scripts/tools-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,23 @@ function set_up_cycle_button() {
function fill_in_bug_report_values() {
var nav_plat = document.getElementById("nav-plat");
var nav_app = document.getElementById("nav-app");
var report_link = document.getElementById("report-unknown-platform-link");
nav_plat.textContent = navigator.platform;
nav_app.textContent = navigator.appVersion;
var issue_template = `\
<!--
PLEASE do not open an issue if you are using Android!

The Rust toolchain does not run and can't be installed on Android.

If you are on desktop, go ahead and open this issue.
-->

navigator.platform: \`${navigator.platform}\`
navigator.appVersion: \`${navigator.appVersion}\`

The website did not recognize the platform I'm on, so I am unable to install rustup.`;
report_link.href = "https://github.com/rust-lang/www.rust-lang.org/issues/new?title=Unrecognized%20platform&body=" + encodeURIComponent(issue_template);
}

var override_map = new Map ([
Expand Down
9 changes: 8 additions & 1 deletion templates/components/tools/rustup.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
</div>
</div>
<br/>
<a href="https://github.com/rust-lang/www.rust-lang.org/issues/new?title=Unrecognized%20platform&body=navigator.platform%3A%20_please%20fill%20out_%0Anavigator.appVersion%3A%20_please%20fill%20out_%0A%0AThe%20website%20did%20not%20recognize%20the%20platform%20I%27m%20on%2C%20so%20I%20am%20unable%20to%20install%20rustup." class="button button-secondary">{{fluent "tools-rustup-report"}}</a>
<!-- This href is overwritten with a better template in static/scripts/tools-install.js -->
<a
href="https://github.com/rust-lang/www.rust-lang.org/issues/new"
id="report-unknown-platform-link"
class="button button-secondary"
>
{{fluent "tools-rustup-report"}}
</a>
<hr/>
<div>
<p>
Expand Down
Loading