1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

FIX: Commit selection should not be available unless prerelease (#3144)

FIX: Commit selection should not be available unless the release is an "Unstable" / "zulu" release.
This commit is contained in:
J Blackman 2022-12-15 11:11:50 +11:00 committed by GitHub
parent f861ffa7dd
commit 1c94746cb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 18 deletions

View file

@ -277,18 +277,24 @@ firmware_flasher.initialize = function (callback) {
$('div.build_configuration').slideDown(); $('div.build_configuration').slideDown();
const expertMode = $('.tab-firmware_flasher input.expert_mode').is(':checked'); const expertMode = $('.tab-firmware_flasher input.expert_mode').is(':checked');
if (!expertMode) { if (expertMode) {
$('div.commitSelection').hide(); $('div.expertOptions').show();
} else {
$('div.commitSelection').show();
self.releaseLoader.loadCommits(summary.release, (commits) => { if (summary.releaseType === 'Unstable') {
const select_e = $('select[name="commits"]'); self.releaseLoader.loadCommits(summary.release, (commits) => {
select_e.empty(); const select_e = $('select[name="commits"]');
commits.forEach((commit) => { select_e.empty();
select_e.append($(`<option value='${commit.sha}'>${commit.message}</option>`)); commits.forEach((commit) => {
select_e.append($(`<option value='${commit.sha}'>${commit.message}</option>`));
});
}); });
});
$('div.commitSelection').show();
} else {
$('div.commitSelection').hide();
}
} else {
$('div.expertOptions').hide();
} }
} }

View file

@ -197,9 +197,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="commitSelection spacer" style="margin-bottom: 10px;"> <div class="expertOptions spacer hide-in-classic-build-mode" style="margin-bottom: 10px;">
<div class="margin-bottom"> <div class="margin-bottom">
<div style="width: 49%; float: left;"> <div style="width: 49%; float: left;">
<strong i18n="firmwareFlasherBuildCustomDefines"></strong>
<div id="customDefinesInfo" class="build-options-wrapper">
<input id="customDefines" name="customDefines"></input>
<div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherCustomDefinesDescription"></div>
</div>
</div>
<div class="commitSelection" style="width: 49%; float: right;">
<strong i18n="firmwareFlasherBranch"></strong> <strong i18n="firmwareFlasherBranch"></strong>
<div id="branchInfo" class="build-options-wrapper"> <div id="branchInfo" class="build-options-wrapper">
<select id="commits" name="commits" class="select2"> <select id="commits" name="commits" class="select2">
@ -207,13 +214,6 @@
<div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherBranchDescription"></div> <div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherBranchDescription"></div>
</div> </div>
</div> </div>
<div style="width: 49%; float: right;" class="hide-in-classic-build-mode">
<strong i18n="firmwareFlasherBuildCustomDefines"></strong>
<div id="customDefinesInfo" class="build-options-wrapper">
<input id="customDefines" name="customDefines"></input>
<div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherCustomDefinesDescription"></div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>