Skip to content

Commit

Permalink
Merge pull request #1100 from jenkinsci/remove-scroller
Browse files Browse the repository at this point in the history
Remove hiding of scroller
  • Loading branch information
uhafner committed Nov 7, 2021
2 parents 35635af + dbbcde3 commit ae0e42e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
8 changes: 4 additions & 4 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
<module.name>${project.groupId}.warnings.ng</module.name>

<analysis-model-api.version>10.6.0</analysis-model-api.version>
<analysis-model-tests.version>10.5.4</analysis-model-tests.version>
<analysis-model-tests.version>10.6.0</analysis-model-tests.version>

<forensics-api-plugin.version>1.5.0</forensics-api-plugin.version>
<plugin-util-api.version>2.5.1</plugin-util-api.version>

<data-tables-api.version>1.11.3-1</data-tables-api.version>
<echarts-api.version>5.2.1-2</echarts-api.version>
<bootstrap5-api.version>5.1.1-1</bootstrap5-api.version>
<data-tables-api.version>1.11.3-4</data-tables-api.version>
<echarts-api.version>5.2.2-1</echarts-api.version>
<bootstrap5-api.version>5.1.3-1</bootstrap5-api.version>
<error_prone_annotations.version>2.9.0</error_prone_annotations.version>
<pull-request-monitoring.version>1.7.8</pull-request-monitoring.version>

Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/resources/issues/property.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<j:set var="l" value="${it.tabLabelProvider}"/>
<j:set var="t" value="${it.getDetails(property)}"/>
<div class="table-responsive">
<table class="table table-hover table-striped display property-table" id="${property}">
<table class="table table-hover table-striped display property-table" id="${property}" isLoaded="true">
<colgroup>
<col class="col-width-5"/>
<col class="col-width-1 text-right"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class AbstractIssuesTable<T extends GenericTableRow> {
this.analysisResult = analysisResult;
tabId = divId;

tableElement = tab.findElement(By.id(divId));
tableElement = analysisResult.waitFor(By.xpath("//table[@id='" + divId + "' and @isLoaded='true']"));
headers = tableElement.findElements(By.xpath(".//thead/tr/th"))
.stream()
.map(WebElement::getText)
Expand All @@ -61,21 +61,10 @@ abstract class AbstractIssuesTable<T extends GenericTableRow> {
public final void updateTableRows() {
tableRows.clear();

List<WebElement> tableRowsAsWebElements;
do {
tableRowsAsWebElements = tableElement.findElements(By.xpath(".//tbody/tr"));
}
while (isLoadingSeverData(tableRowsAsWebElements));
List<WebElement> tableRowsAsWebElements = tableElement.findElements(By.xpath(".//tbody/tr"));
tableRowsAsWebElements.forEach(element -> tableRows.add(createRow(element)));
}

private boolean isLoadingSeverData(final List<WebElement> tableRowsAsWebElements) {
if (tableRowsAsWebElements.size() != 1) {
return false;
}
return tableRowsAsWebElements.get(0).getText().contains("Loading - please wait");
}

/**
* Creates the concrete table row as an object of the matching sub-class of {@link GenericTableRow}. This row
* contains the specialized column mapping of the corresponding issues table.
Expand Down Expand Up @@ -195,8 +184,11 @@ public AnalysisResult clickFilterLinkOnSite(final WebElement element) {
* the number representing the page to open
*/
public void openTablePage(final int pageNumber) {
WebElement webElement = analysisResult.find(By.linkText(String.valueOf(pageNumber)));
WebElement webElement = analysisResult.find(By.xpath("//a[@class='page-link' and @data-dt-idx='" + (pageNumber - 1) + "']"));
webElement.click();

analysisResult.waitFor(By.xpath("//a[@class='page-link' and @data-dt-idx='" + (pageNumber - 1) + "']/parent::li[contains(@class, 'active')]"));

updateTableRows();
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.jenkins.plugins.analysis.warnings;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

/**
* Utilities to remove the scroller on the job configuration page.
Expand All @@ -18,10 +15,10 @@ public final class ScrollerUtil {
* web driver
*/
public static void hideScrollerTabBar(final WebDriver driver) {
WebElement element = driver.findElement(By.xpath("//div[contains(@class, 'jenkins-config-widgets')]"));
if (driver instanceof JavascriptExecutor) {
((JavascriptExecutor) driver).executeScript("arguments[0].style.visibility='hidden'", element);
}
// WebElement element = driver.findElement(By.xpath("//div[contains(@class, 'jenkins-config-widgets')]"));
// if (driver instanceof JavascriptExecutor) {
// ((JavascriptExecutor) driver).executeScript("arguments[0].style.visibility='hidden'", element);
// }
}

private ScrollerUtil() {
Expand Down

0 comments on commit ae0e42e

Please sign in to comment.