1. Sebastian Sdorra
  2. scm-webhook-plugin

Commits

Sebastian Sdorra  committed 0b13639

fix state of checkbox

  • Participants
  • Parent commits 06099b4
  • Branches default

Comments (0)

Files changed (1)

File src/main/resources/sonia/scm/webhook/sonia.webhook.js

View file
  • Ignore whitespace
       root: 'webhooks',
       fields: [
         {name: 'urlPattern'},
-        {name: 'executeOnEveryCommit'},
-        {name: 'sendCommitData'}
+        {name: 'executeOnEveryCommit', type: 'boolean'},
+        {name: 'sendCommitData', type: 'boolean'}
       ]
     });
     
       if ( pa.length > 0 && pa[0].length > 0 ){
         var Webhook = store.recordType;
         var w = new Webhook({
-          urlPattern: pa[0].trim()
+          urlPattern: pa[0].trim(),
+          executeOnEveryCommit: pa[1] == 'true',
+          sendCommitData: pa[2] == 'true'
         });
-        if (pa[1]){
-          w.executeOnEveryCommit = pa[1];
-        } else {
-          w.executeOnEveryCommit = false;
-        }
-        if (pa[2]){
-          w.sendCommitData = pa[2];
-        } else {
-          w.sendCommitData = false;
-        }
         if (debug){
           console.debug('add webhook: ');
           console.debug( w );