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

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

Merged
merged 1 commit into from Dec 15, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 17 additions & 11 deletions src/js/tabs/firmware_flasher.js
Expand Up @@ -277,18 +277,24 @@ firmware_flasher.initialize = function (callback) {
$('div.build_configuration').slideDown();

const expertMode = $('.tab-firmware_flasher input.expert_mode').is(':checked');
if (!expertMode) {
$('div.commitSelection').hide();
} else {
$('div.commitSelection').show();

self.releaseLoader.loadCommits(summary.release, (commits) => {
const select_e = $('select[name="commits"]');
select_e.empty();
commits.forEach((commit) => {
select_e.append($(`<option value='${commit.sha}'>${commit.message}</option>`));
if (expertMode) {
$('div.expertOptions').show();

if (summary.releaseType === 'Unstable') {
self.releaseLoader.loadCommits(summary.release, (commits) => {
const select_e = $('select[name="commits"]');
select_e.empty();
commits.forEach((commit) => {
select_e.append($(`<option value='${commit.sha}'>${commit.message}</option>`));
});
});
});

$('div.commitSelection').show();
} else {
$('div.commitSelection').hide();
}
} else {
$('div.expertOptions').hide();
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/tabs/firmware_flasher.html
Expand Up @@ -197,23 +197,23 @@
</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 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>
<div id="branchInfo" class="build-options-wrapper">
<select id="commits" name="commits" class="select2">
</select>
<div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherBranchDescription"></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>
Expand Down