Task Plugin: Web UI does not set number input value

14 views
Skip to first unread message

Joel Bodenmann

unread,
Dec 15, 2020, 7:47:58 AM12/15/20
to go-cd
I created a simple task plugin which uses a "number"  input field in the HTML template for configuration. All other options use "text" .

After creating adding a plugin task to a job and performing the configuration, the "text"  input elements will be populated with the previously configured value when re-opening the plugin task configuration view. However, the "number"  input field stays empty (shows the place holder) although the setting is being stored correctly in the XML.

I'd greatly appreciate it if somebody could have a look at this and enlighten me on what I'm missing/doing wrong.
The plugin repository can be found here: https://github.com/Tectu/gocd-cmake-task 

The "number"  input field has the key/model name "build_parallel_jobs".


Best regards,
~ Joel

Aravind SV

unread,
Dec 15, 2020, 1:27:27 PM12/15/20
to Joel Bodenmann, go-cd

I think this is an issue with how AngularJS handles string values in the model provided to the <input type="number" ...> field. See: https://stackoverflow.com/questions/16829616/ng-model-for-input-type-number-not-working-angularjs

If you do need to write some Javascript to change the type, I’m not sure whether you have access to $scope, but you should be able to write Javascript in the template after this change: https://github.com/gocd/gocd/pull/5361

Reply all
Reply to author
Forward
0 new messages