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

Allow for different input types in Formatted HTML #1

Conversation

valdemon
Copy link

Hi,

this tiny change fully supports different input types in the formatted HTML.
Without this change the Formatted HTML option allows to create the various HTML input types dynamically and take a parameter value for the build, but it DOES NOT allow to take the value of such a parameter by a reference to another Reactive Reference Parameters (via Referenced Parameters attribute).
In effect only the 'input' tag values were reflected. With this change any tag (like select or checkbox will work as well).

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@kinow
Copy link
Member

kinow commented Jul 22, 2015

Oh, that looks interesting @valdemon! I'll try to test it in the next days and merge it. Thanks for your contribution!!!

@valdemon
Copy link
Author

You're welcome, @kinow. It's an awesome plugin, btw.

@kinow
Copy link
Member

kinow commented Jul 22, 2015

Tested locally, and worked as expected! Thanks @valdemon, very good spotting this simple change, kudos! Preparing a new release with your change in the next hours.

kinow added a commit that referenced this pull request Jul 22, 2015
…ypes_in_formatted_html

Allow for different input types in Formatted HTML
@kinow kinow merged commit e7bdcde into jenkinsci:master Jul 22, 2015
@valdemon
Copy link
Author

Thanks, cool to hear that!

@valdemon valdemon deleted the feature/different_input_types_in_formatted_html branch July 22, 2015 11:28
@kinow
Copy link
Member

kinow commented Jul 22, 2015

Released! Should be available from the update center tomorrow morning. Thanks again!

@kinow
Copy link
Member

kinow commented Jul 22, 2015

Released! Available in the update center within some hours. Thanks again!!!


Em qua, 22 de Julho de 2015 08:28 BRT Waldek Kozba escreveu:

Thanks, cool to hear that!


Reply to this email directly or view it on GitHub:
#1 (comment)

@valdemon
Copy link
Author

Confirm that it works after the upgrade. Thanks for the fast reaction!

@kinow
Copy link
Member

kinow commented Jul 24, 2015

Great news! Thanks for the contribution and for the feedback.

@imoutsatsos
Copy link
Member

So if I understand this new functionality correctly any input type in Reactive Reference is persisted as a build parameter. This is a significant improvement over the previous behavior. Thank you!

However, when I setup a a Reactive Reference (Active Choices plugin v1.2) with the following code it did not work. The build parameter was still null. Please, advice. Thank you!

html=
'''
<p>
  <input type="range" min="1" max="150" id="nRadius">
  <label for="nRadius" 
         style="display: inline-block; width: 240px; text-align: left">
         radius = <span id="nRadius-value">
</span>
  </label>
</p>
<hr>
'''
return html

screenshot_072515_091816_am

screenshot_072515_092016_am

@kinow
Copy link
Member

kinow commented Jul 25, 2015

Hi @imoutsatsos

Either your input or label needs to have the name="value"

The plug-in used to search for value in parameters with

input[name="value"]

The input in the beginning was limiting us to only input fields. After @valdemon 's contribution, we can have select elements with name="value", or any other element.

Hope that helps

@imoutsatsos
Copy link
Member

Thanks for the explanation @kinow . A small change adding the name="value" and voila it works!
So, we now have a new UI control for Jenkins: a sliding range control
image

Easily passed as a parameter to the build!

image

Thanks @valdemon and @kinow !

@valdemon
Copy link
Author

Cool use case for the new behavior @imoutsatsos ! Could be put into the plugin's WiKi for a reference.

Another possible use case is changing the UI control type dynamically, depending on the context (incl. referenced parameter values).
Eg. from 'select' to read only text input, when there's only one option, or to a warning message (without a value of course) when there's no option available.

@imoutsatsos
Copy link
Member

I agree @valdemon . This is a really useful new feature for Active Choices. Thanks for your contributions!

@imoutsatsos
Copy link
Member

@valdemon @kinow An example page demonstrating the enhanced Reference Parameter usage in Active Choices v1.2 has now been added to the Active Choices wiki page.

@valdemon
Copy link
Author

Reviewed, cool article!

@kinow
Copy link
Member

kinow commented Jul 26, 2015

Really cool @imoutsatsos ! Could become a blog post in biouno.org too :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants