UI/add select dropdown (#7102)

* add SelectDropdown

* use SelectDropdown instead of HttpRequestsDropdown

* use html selector instead of class name

* ensure SelectDropdown still works when rendered inside a Toolbar

* add tests

* remove old HttpRequests component

* make SelectDropdown example easier to read in Storybook

* add isFullwidth prop

* add SelectDropbown inside a Toolbar story

* fix tests

* remove actions block and call this.onChange directly

* replace dropdownLabel with label

* rename SelectDropdown to SelecT

* add test for onChange

* remove selectedItem prop since we don't need it

* make Select accept options as an array of strings or objects

* Revert "remove selectedItem prop since we don't need it"

This reverts commit 7278516de87bb1df60482edb005137252819931e.

* use Select inside TtlPicker

* remove debugger

* use a test selector

* fix pki test selectors

* improve storybook docs

* fix selected value in ttl picker

* ensure httprequests dropdown updates the selected item

* ensure select dropdown correctly matches selectedItem

* rename selectedItem to selectedValue

* remove debugger lol

* update selectedItem test

* add valueAttribute and labelAttribute to Storybook knobs

* udpate jsdocs

* remove old httprequestsdropdown component

* add note that onChange will receive value of select

* use Select inside AuthForm

* use correct test selector
This commit is contained in:
Noelle Daley
2019-08-01 14:35:18 -07:00
committed by GitHub
parent 62be57e2da
commit 8e8a193029
24 changed files with 309 additions and 203 deletions

View File

@@ -102,18 +102,17 @@ export default Component.extend({
},
actions: {
changedValue(key, event) {
let { type, value, checked } = event.target;
let val = type === 'checkbox' ? checked : value;
if (val && key === 'time') {
val = parseInt(val, 10);
if (Number.isNaN(val)) {
changedValue(key, value) {
if (value && key === 'time') {
value = parseInt(value, 10);
if (Number.isNaN(value)) {
this.set('errorMessage', ERROR_MESSAGE);
return;
}
}
this.set('errorMessage', null);
set(this, key, val);
set(this, key, value);
this.onChange(this.TTL);
},
},