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

Sort of 3 optionlist at failsafe tab #3211

Merged
merged 1 commit into from Jan 6, 2023

Conversation

HThuren
Copy link
Member

@HThuren HThuren commented Jan 5, 2023

Use of common sortSelect

@sonarcloud
Copy link

sonarcloud bot commented Jan 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

Do you want to test this code? Here you have an automated build:
Betaflight-Configurator-Android
Betaflight-Configurator-Linux
Betaflight-Configurator-macOS
Betaflight-Configurator-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

@blckmn
Copy link
Member

blckmn commented Jan 5, 2023

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> PASS
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> FAIL
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> FAIL
  • approver count at least three -> FAIL

@@ -265,8 +268,13 @@ failsafe.initialize = function (callback) {
$('input[name="gps_rescue_throttle_max"]').val(FC.GPS_RESCUE.throttleMax);
$('input[name="gps_rescue_throttle_hover"]').val(FC.GPS_RESCUE.throttleHover);
$('input[name="gps_rescue_min_sats"]').val(FC.GPS_RESCUE.minSats);
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
$('#failsafeGpsRescueItemSanitySelect').sortSelect();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we follow similar patter to above of using name instead of id? so we don't need extra property to keep in sync and this would look like:

Suggested change
$('#failsafeGpsRescueItemSanitySelect').sortSelect();
$('select[name"gps_rescue_sanity_checks"]').sortSelect();

@@ -249,6 +249,9 @@ failsafe.initialize = function (callback) {
break;
}

// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
$('#failsafeSwitchSelect').sortSelect();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$('#failsafeSwitchSelect').sortSelect();
$('select[name="failsafe_switch_mode"]').sortSelect();

@@ -47,7 +47,7 @@
<div class="spacer_box">
<div class="number">
<label>
<select class="switchMode" name="failsafe_switch_mode">
<select id="failsafeSwitchSelect" class="switchMode" name="failsafe_switch_mode">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need special ids for this. In general name is a good unique property and is required for accesibility etc.

Suggested change
<select id="failsafeSwitchSelect" class="switchMode" name="failsafe_switch_mode">
<select class="switchMode" name="failsafe_switch_mode">

Copy link
Member

@chmelevskij chmelevskij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think ids are necessary and for consistency using name would be better.

@haslinghuis haslinghuis merged commit 54ba222 into betaflight:master Jan 6, 2023
Finalizing Firmware 4.4 Release automation moved this from In progress to Done Jan 6, 2023
@HThuren HThuren deleted the sortTabFailsafe branch January 6, 2023 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants