Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-74109

[claim] Extract inline script block and event handlers in hudson/plugins/claim/AbstractClaimBuildAction/tablerow.jelly

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • claim-plugin

      Problems

      == Inline Script Block
      Line: 5
      ----
      <script type="text/javascript">
                      function ShowPopup(hoveritem) {
                      var row = hoveritem.closest('tr');
                      var hp = row.querySelector(".claimHoverPopup");
                      if (hp) {
                          hp.style.display = "block";
                      } else {
                          console.error("Claim popup not found in the same row.");
                      }
                      }
      
                      function HidePopup(hoveritem) {
                      var row = hoveritem.closest('tr');
                      var hp = row.querySelector(".claimHoverPopup");
                      if (hp) {
                      hp.style.display = "none";
                      } else {
                      console.error("Claim popup not found in the same row.");
                      }
                      var action = <st:bind value="${it}" />;
                      }
      
                      function Display(hoveritem, error) {
                      var row = hoveritem.closest('tr');
                      var reasonText = row.querySelector('#errordesc');
                      var action = <st:bind value="${it}" />;
                      action.getReason(error, function(content) {
                      reasonText.textContent = content.responseObject();
                      });
                      }
                  </script>
      ----
      
      == Inline Event Handler
      Line: 40
      ----
      <a id="claim" href="#" onClick="ShowPopup(this); return false;">
      ----
      
      == Inline Event Handler
      Line: 54
      ----
      <a id="reassign" href="#" onClick="ShowPopup(this); return false;">
      ----
      
      == Inline Event Handler
      Line: 68
      ----
      <f:select onChange="Display(this, this.value);"/>
      ----
      
      == Inline Event Handler
      Line: 86
      ----
      <button type="button"  name="Cancel" formNoValidate="formNoValidate" class="jenkins-button jenkins-submit-button}" onClick="HidePopup(this);">
      ----
      

      Solutions

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
      https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

            Unassigned Unassigned
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: