Fix nightly solidity versions filtering UX (#5942)

pull/5945/head
nikitosing 2 years ago committed by GitHub
parent 7b8544cd73
commit e672b03890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 17
      apps/block_scout_web/assets/js/pages/verification_form.js

@ -4,6 +4,7 @@
- [#5860](https://github.com/blockscout/blockscout/pull/5860) - Integrate rust verifier micro-service ([blockscout-rs/verifier](https://github.com/blockscout/blockscout-rs/tree/main/verification))
### Fixes
- [#5942](https://github.com/blockscout/blockscout/pull/5942) - Fix nightly solidity versions filtering UX
- [#5904](https://github.com/blockscout/blockscout/pull/5904) - Enhance health API endpoint: better parsing HEALTHY_BLOCKS_PERIOD and use it in the response
- [#5903](https://github.com/blockscout/blockscout/pull/5903) - Disable compile env validation
- [#5887](https://github.com/blockscout/blockscout/pull/5887) - Added missing environment variables to Makefile container params

@ -47,6 +47,10 @@ const elements = {
render ($el, state) {
if (state.newForm) {
$el.replaceWith(state.newForm)
if ($('.nightly-builds-true').prop('checked')) { filterNightlyBuilds(false, false) }
if ($('.nightly-builds-false').prop('checked')) { filterNightlyBuilds(true, false) }
initializeDropzone()
state.newForm = null
@ -60,15 +64,22 @@ const elements = {
const $contractVerificationPage = $('[data-page="contract-verification"]')
const $contractVerificationChooseTypePage = $('[data-page="contract-verification-choose-type"]')
function filterNightlyBuilds (filter) {
function filterNightlyBuilds (filter, selectFirstNonNightly_) {
const select = document.getElementById('smart_contract_compiler_version')
const options = select.getElementsByTagName('option')
let selectFirstNonNightly = selectFirstNonNightly_
for (const option of options) {
console.log(option)
const txtValue = option.textContent || option.innerText
if (filter) {
if (txtValue.toLowerCase().indexOf('nightly') > -1) {
option.style.display = 'none'
} else {
if (selectFirstNonNightly) {
option.selected = 'selected'
selectFirstNonNightly = false
}
option.style.display = ''
}
} else {
@ -130,11 +141,11 @@ if ($contractVerificationPage.length) {
})
$('body').on('click', '.nightly-builds-true', function () {
if ($(this).prop('checked')) { filterNightlyBuilds(false) }
if ($(this).prop('checked')) { filterNightlyBuilds(false, true) }
})
$('body').on('click', '.nightly-builds-false', function () {
if ($(this).prop('checked')) { filterNightlyBuilds(true) }
if ($(this).prop('checked')) { filterNightlyBuilds(true, true) }
})
$('body').on('click', '.optimization-false', function () {

Loading…
Cancel
Save