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: build parameters dropdown w/ override #575

Merged
merged 3 commits into from
Jul 31, 2020

Conversation

adong
Copy link
Member

@adong adong commented Jul 30, 2020

Context

An alternative solution to #573

Screwdriver.yaml file: https://github.com/adong/sd-paramters-dropdown/blob/master/screwdriver.yaml

Objective

Try to squeeze much code in the handlebars using power-select, it is cool that power-select is able to handle it :)

References

ember-power-select 2.x:

ember-bootstrap:

I also applied function currying to Ember Action, i.e.

            onchange=(action (action "onUpdateDropdownValue" parameterizedModel parameter.name))
            onkeydown=(action (action "searchOrAddtoList" parameterizedModel parameter.name))

and I learned from A note on actions | EmberMap (highly recommended to read)

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

actions: {
searchOrAddtoList(model, propertyName, value, e) {
if (e.keyCode === 13) {
Copy link
Member Author

Choose a reason for hiding this comment

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

'KeyCode': 13, means

"Enter" | 0x0D (13)

From: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

yoshwata
yoshwata previously approved these changes Jul 31, 2020
Copy link
Contributor

@yoshwata yoshwata left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good. I read the ember document and it's useful for me.

@yoshwata
Copy link
Contributor

I linked with the original issue.
screwdriver-cd/screwdriver#2092

@adong adong merged commit 32d16fa into master Jul 31, 2020
@adong adong deleted the adong/parameter-dropdown-override branch July 31, 2020 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants