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

[JENKINS-74055] Extract inline script block in BuildPipelineView/main_dashboard.jelly #149

Merged
merged 5 commits into from
Nov 8, 2024

Conversation

shlomomdahan
Copy link

@shlomomdahan shlomomdahan commented Oct 31, 2024

JENKINS-74055

The current functionality is broken:

  1. The code isn’t triggered in the pipeline view, likely intentional, as the file isn’t included in the sources. The code is supposed to toggle build details/actions for each card when clicking the header (Project Build #), but instead, it redirects users to the build status page.
  2. The code isn’t compatible with the jQuery 3 update Migrate from jQuery 1.x to 3.x #140.

I moved the script to BuildPipelineView/bpp.jelly to execute it within the pipeline view. After making it compatible with jQuery 3, the toggling behavior now conflicts with the existing redirection to the build status page.

<script type="text/javascript">
        // show/hide build details
        jQuery(function() {
            jQuery(".header").click(function() {
                var parent = jQuery(this).parent();
                var ba = parent.find(".build-actions");
                var bb = parent.find(".build-body");

                ba.add(bb).toggle('slow');
            });
        });
</script>

Show/Hide Behavior Demonstration - Video

After extracting JS - I tested by adding adjunct in BuildPipelineView/bpp.jelly and confirmed it still works.

@basil @yaroslavafenkin - what do you think is the best approach here? Would it be better to remove the script completely?

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@shlomomdahan shlomomdahan marked this pull request as ready for review October 31, 2024 22:17
@shlomomdahan shlomomdahan requested a review from a team as a code owner October 31, 2024 22:17
@shlomomdahan shlomomdahan mentioned this pull request Nov 4, 2024
6 tasks
@basil
Copy link
Member

basil commented Nov 6, 2024

Can you move the jQuery 3 regression fix to a separate PR? That should be easy to review and merge on its own.

@basil
Copy link
Member

basil commented Nov 8, 2024

Can you move the jQuery 3 regression fix to a separate PR? That should be easy to review and merge on its own.

@shlomomdahan Done in #155, please resolve merge conflicts.

Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@basil basil merged commit f2ceaf6 into jenkinsci:master Nov 8, 2024
17 checks passed
@shlomomdahan shlomomdahan deleted the JENKINS-74055 branch November 10, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants