Skip to content

Commit

Permalink
backport 1676 to 2.0 release (#1677)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Dec 21, 2021
1 parent bcca652 commit cbd1ced
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.0.22] - 2021-12-21

### Fixed

- Back-ported [1676](https://github.com/OSC/ondemand/pull/1676) to correctly hide options
with hyphens.

## [2.0.21] - 2021-12-20

### Fixed
Expand Down Expand Up @@ -944,7 +951,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- From 1.3.7 - 1.4.2 updated app versions


[Unreleased]: https://github.com/OSC/ondemand/compare/v2.0.21...release_2.0
[Unreleased]: https://github.com/OSC/ondemand/compare/v2.0.22...release_2.0
[2.0.22]: https://github.com/OSC/ondemand/compare/v2.0.21...v2.0.22
[2.0.21]: https://github.com/OSC/ondemand/compare/v2.0.20...v2.0.21
[2.0.20]: https://github.com/OSC/ondemand/compare/v2.0.19...v2.0.20
[2.0.19]: https://github.com/OSC/ondemand/compare/v2.0.18...v2.0.19
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/javascript/packs/batchConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const setValueLookup = {};
const hideLookup = {};

// the regular expression for mountain casing
const mcRex = /[[-_]([a-z])|([_-][0-9])/g;
const mcRex = /[-_]([a-z])|([_-][0-9])/g;

function bcElement(name) {
return `${bcPrefix}_${name.toLowerCase()}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ attributes:
- [
"2.7",
data-option-for-node-type-advanced: false,
data-option-for-node-type-other-40ish-option: false,
data-set-bc-account: 'python27'
]
- [
"3.1",
data-option-for-node-type-advanced: false,
data-option-for-node-type-other-40ish-option: false,
data-set-bc-account: 'python31'
]
- [
"3.2",
data-option-for-node-type-advanced: false,
data-option-for-node-type-other-40ish-option: false,
data-set-bc-account: 'python32'
]
- [
Expand Down
19 changes: 18 additions & 1 deletion apps/dashboard/test/system/batch_connect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def setup
assert find("##{bc_ele_id('advanced_options')}").visible?
end

test 'options with hyphens' do
test 'options with hyphens set min & max' do
visit new_batch_connect_session_context_url('sys/bc_jupyter')

# defaults
Expand All @@ -365,6 +365,23 @@ def setup
assert_equal 48, find_max('bc_num_slots')
end

test 'options with hyphens get hidden' do
visit new_batch_connect_session_context_url('sys/bc_jupyter')

# defaults
assert_equal 'owens', find_value('cluster')
assert_equal 'any', find_value('node_type')
assert_equal '2.7', find_value('python_version')

# now switch node type and find that 2.7, and more, are hidden and 3.6 is the choice now
# even when the options has hyphens in it
select('other-40ish-option', from: bc_ele_id('node_type'))
assert_equal 'display: none;', find_option_style('python_version', '2.7')
assert_equal 'display: none;', find_option_style('python_version', '3.1')
assert_equal 'display: none;', find_option_style('python_version', '3.2')
assert_equal '3.6', find("##{bc_ele_id('python_version')}").value
end

test 'options with numbers' do
visit new_batch_connect_session_context_url('sys/bc_jupyter')

Expand Down

0 comments on commit cbd1ced

Please sign in to comment.