Yes, it's complicated because it's an Angular template with its own syntax. This is so that a plugin can provide the template. If you have code publicly available, I might be able to take a look in a couple of days.
By the way: I'm a big opponent (is that the right word a non-proponent?) of task plugins. I think they shouldn't exist / be used. I rant about them often. Here's one of them: https://groups.google.com/d/topic/go-cd/9bmEV3R7JBk/discussion. It's very different from how (for instance) the Jenkins world thinks about plugins. I'd really consider pipelines as code <https://github.com/tomzo/gocd-json-config-plugin> or simple shell scripts instead of task plugins. Cheers, Aravind On Wed, Dec 2, 2020 at 5:40 PM Joel Bodenmann <[email protected]> wrote: > Never mind - got it working. I needed to specify *ng-true-value* and > *ng-false-value* to strings that Java's *Boolean.parseBoolean()* can > understand. > > Now the only thing left is fixing the issue that my *number* input is not > set to the value from the XML (although it is being saved correctly) when > opening the task config view. It's always empty (showing the placeholder) > instead of displaying the value from the XML config. > > > Best regards, > ~ Joel > > On Wednesday, December 2, 2020 at 5:00:27 PM UTC+1 Joel Bodenmann wrote: > >> Aravind, >> >> I've come across that piece of documentation when starting to look at the >> possibility of creating my own Task plugin. In my opinion the documentation >> does a good job at giving a quick overview but I found that some more >> advanced/complex examples might be helpful. >> Once I gathered the necessary experience to finish my first plugin I'll >> look into providing a PR extending the documentation. >> >> I am not a web developer so please forgive me if I should really not ask >> this here but: I managed to get everything working so far. I've a task >> plugin with the HTML config view that uses HTML input fields of type >> *text *and *number * to configure my task. So far so good. >> Next I wanted to add a checkbox for some conditional task behavior. >> However, I can't manage to get the checkbox to save to the XML. I've copied >> the fragments of my other *text* and *number* fields and simply changed >> the type to *checkbox* and adjusted the *ng-model* attribute to "link" >> to the new boolean setting. >> >> Is there anything special about getting back the checked/unchecked state >> of a checkbox? >> >> This is my HTML fragment for the checkbox: >> >> <div class="form_item_block"> >> <input type="checkbox" ng-model="perform_build" ng-required >> ="false"/> >> <label>Enable</label> >> </div> >> >> If I look at the config form using the inspector I can see that my *text* and >> *number* input fields still have the *ng-** attributes but the checkbox >> in question has been stripped of the *ng-model* and *ng-required* >> attribute. >> >> I'd appreciate it a lot if somebody could help out an embedded C++ >> developer here not accustomed to work with AngularJS. >> >> >> Best regards, >> ~ Joel >> On Wednesday, December 2, 2020 at 3:09:31 PM UTC+1 Aravind SV wrote: >> >>> Agree! >>> >>> The source of the current documentation is: >>> >>> https://github.com/gocd/plugin-api.go.cd/blob/master/source/includes/shared/_angular-templates.md >>> >>> It looks like this: >>> https://plugin-api.gocd.org/current/tasks/ >>> >>> Pull requests are always welcome. Not just from Joel. :) But, for anyone >>> who finds that the documentation can be improved. >>> >>> Cheers, >>> Aravind >>> >> -- > You received this message because you are subscribed to the Google Groups > "go-cd" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/go-cd/e316992e-3e4a-44c9-aa4c-6c5cb36e6733n%40googlegroups.com > <https://groups.google.com/d/msgid/go-cd/e316992e-3e4a-44c9-aa4c-6c5cb36e6733n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CACxychH5LjuH8qJN7M5aQPtXEZBY0E5oq2q%2BVq35E_VW81TPJw%40mail.gmail.com.
