Skip to content

Commit

Permalink
Replace hetero-list YUI button and menu with new style button and T…
Browse files Browse the repository at this point in the history
…ippy.js menu (#8418)

Co-authored-by: Tim Jacomb <[email protected]>
  • Loading branch information
mawinter69 and timja authored Aug 30, 2023
1 parent 1197586 commit 0c71e41
Show file tree
Hide file tree
Showing 12 changed files with 387 additions and 292 deletions.

This file was deleted.

5 changes: 2 additions & 3 deletions core/src/main/resources/lib/form/hetero-list.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ THE SOFTWARE.
</d:tag>
</d:taglib>

<st:adjunct includes="lib.form.hetero-list.hetero-list"/>

<j:set var="targetType" value="${attrs.targetType?:it.class}"/>
<div class="jenkins-form-item hetero-list-container ${hasHeader?'with-drag-drop':''} ${attrs.oneEach?'one-each':''} ${attrs.honorOrder?'honor-order':''}">
<!-- display existing items -->
Expand Down Expand Up @@ -156,7 +154,8 @@ THE SOFTWARE.

<j:if test="${!readOnlyMode}">
<div>
<input type="button" value="${attrs.addCaption?:'%Add'}" class="hetero-list-add" menualign="${attrs.menuAlign}" suffix="${attrs.name}"/>
<button type="button" class="jenkins-button hetero-list-add" menualign="${attrs.menuAlign}" suffix="${attrs.name}">${attrs.addCaption?:'%Add'}<l:icon src="symbol-chevron-down"/>
</button>
</div>
</j:if>
</div>
Expand Down
201 changes: 0 additions & 201 deletions core/src/main/resources/lib/form/hetero-list/hetero-list.js

This file was deleted.

8 changes: 4 additions & 4 deletions test/src/test/java/lib/form/HeteroListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.htmlunit.html.HtmlButton;
import org.htmlunit.html.HtmlElementUtil;
import org.htmlunit.html.HtmlPage;
import org.htmlunit.javascript.host.html.HTMLAnchorElement;
import org.htmlunit.javascript.host.html.HTMLButtonElement;
import org.jenkinsci.Symbol;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -75,9 +75,9 @@ public void xssPrevented_heteroList_usingDescriptorDisplayName() throws Exceptio
HtmlPage page = wc.goTo("root");

page.executeJavaScript("document.querySelector('.hetero-list-add').click();");
Object result = page.executeJavaScript("document.querySelector('.yuimenuitem a')").getJavaScriptResult();
assertThat(result, instanceOf(HTMLAnchorElement.class));
HTMLAnchorElement menuItem = (HTMLAnchorElement) result;
Object result = page.executeJavaScript("document.querySelector('.jenkins-dropdown__item')").getJavaScriptResult();
assertThat(result, instanceOf(HTMLButtonElement.class));
HTMLButtonElement menuItem = (HTMLButtonElement) result;
String menuItemContent = menuItem.getInnerHTML();
assertThat(menuItemContent, not(containsString("<")));
}
Expand Down
Loading

0 comments on commit 0c71e41

Please sign in to comment.