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

UI - Add and implement data tables #153

Merged
merged 49 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
39b5bce
Add download as JSON, working on CSV
wcgunter Jun 13, 2023
b763918
Implement CSV, fix JSON exports
wcgunter Jun 13, 2023
1048022
Update GUI - radio button to select file type
wcgunter Jun 13, 2023
f7c161b
Update button, fix "Show All" for long stdouts
wcgunter Jun 13, 2023
31e8c26
Add DataTables js utility & use on history page
wcgunter Jun 14, 2023
952363d
update DT, refine history page, finish deployments
wcgunter Jun 15, 2023
9ad6e62
Update css for datatables
wcgunter Jun 15, 2023
02569f1
remove unnecessary info below table
wcgunter Jun 15, 2023
72de587
add DataTable to processes table
wcgunter Jun 15, 2023
447e085
update history to fix loading issue
wcgunter Jun 15, 2023
7e12efd
Fix sorting on history page
wcgunter Jun 15, 2023
018848f
Fix history not displaying all log rows
wcgunter Jun 20, 2023
80b96d2
Removing paging for test suite support
wcgunter Jun 20, 2023
2766fa9
Merge branch 'develop' into ui-history-download-log
wcgunter Jun 20, 2023
365fa4f
Update processes page to fix select feature
wcgunter Jun 20, 2023
a45a187
Merge branch 'ui-history-download-log' of github.com:NASA-AMMOS/commo…
wcgunter Jun 20, 2023
5ad5075
Fixed double sorting icon
wcgunter Jun 21, 2023
91ca27b
Add moment.js and DataTables integration - filter
wcgunter Jun 21, 2023
30b56d2
Update where table is drawn to speed up page load
wcgunter Jun 21, 2023
adc5c11
Update REST to return all processes
wcgunter Jun 21, 2023
32fff7a
Defer renderings
wcgunter Jun 21, 2023
557ff06
Update processes page to only load 5000 at first
wcgunter Jun 22, 2023
03f4e5b
Increase search delay to increase performance
wcgunter Jun 22, 2023
7771287
Attempt at fixing snippets test
wcgunter Jun 22, 2023
dae9de8
Update xpath for new filter button
wcgunter Jun 22, 2023
e460416
Update sleep timer
wcgunter Jun 22, 2023
29e1e1a
Update sleep, change from id to xpath
wcgunter Jun 22, 2023
794ee1c
Update to "waitForElementXPath"
wcgunter Jun 22, 2023
5cc1e94
Copy from Selenium IDE, add sleep
wcgunter Jun 22, 2023
d6abc60
wait even longer
wcgunter Jun 22, 2023
923ccf7
Wait for process page to load
wcgunter Jun 23, 2023
e455475
Revert, increase waiting
wcgunter Jun 23, 2023
87addee
Change how we wait for add button
wcgunter Jun 23, 2023
8eeeb3b
Update xpath for elements
wcgunter Jun 23, 2023
18b0fba
Add wait for ajax spinner to dissappear
wcgunter Jun 23, 2023
4e9fca3
Fix duration
wcgunter Jun 23, 2023
352cd50
Need to wait even longer
wcgunter Jun 23, 2023
befb3a9
Try using search bar instead of builder
wcgunter Jun 23, 2023
3dbf2da
Try to get console output
wcgunter Jun 23, 2023
e45ff17
Fix qstring missing ?
wcgunter Jun 23, 2023
d50c54b
Update to get # of procs loaded
wcgunter Jun 23, 2023
13072ce
Merge branch 'develop' into ui-history-download-log
wcgunter Jun 23, 2023
1ab55ff
reduce sleep, fix merge error
wcgunter Jun 23, 2023
1840513
FINALLY fixed test errors - updating rest of them
wcgunter Jun 23, 2023
97a4e0f
Missed process page loading indirectly
wcgunter Jun 23, 2023
d09e876
Update completed element ID path
wcgunter Jun 26, 2023
c9dee16
Update css selector
wcgunter Jun 26, 2023
d633449
add screenshots for debugging
wcgunter Jun 26, 2023
1bd1baa
Remove reference to "complete" button
wcgunter Jun 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 2 additions & 10 deletions cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java
Original file line number Diff line number Diff line change
Expand Up @@ -914,12 +914,6 @@ public List<Map<String,Object>> getFilteredProcessInstances(
if (procDefKey != null) { whereObjs.add(procDefKey); }
if (minDate != null) { whereObjs.add(minDate); }
if (maxDate != null) { whereObjs.add(maxDate); }

Integer offset = page*PROCESSES_PAGE_SIZE;
Integer size = PROCESSES_PAGE_SIZE;

whereObjs.add(offset);
whereObjs.add(size);

String pattern = PENDING + "|" + DISABLED + "|" + FAILED_TO_START + "|" + FAILED_TO_SCHEDULE + "|"
+ CLAIMED_BY_WORKER + "|" + RUNNING + "|" + COMPLETE + "|" + RESOLVED + "|" + FAIL + "|" + INCIDENT;
Expand All @@ -942,8 +936,7 @@ public List<Map<String,Object>> getFilteredProcessInstances(
(maxDate != null ? "created_time <= ? AND " : "") +
(statusList != null ? "status IN "+statusClause+" AND " : "") +
" proc_inst_id IS NULL " + // don't get any started processes
"ORDER BY created_time " + dateOrderBy + " " +
"LIMIT ?,?";
"ORDER BY created_time " + dateOrderBy + " ";

List<Map<String,Object>> cwsRows = jdbcTemplate.queryForList(cwsQuery, whereObjs.toArray());

Expand Down Expand Up @@ -975,8 +968,7 @@ public List<Map<String,Object>> getFilteredProcessInstances(
(minDate != null ? "PI.start_time >= ? AND " : "") +
(maxDate != null ? "PI.start_time <= ? AND " : "") +
" 1=1 " +
"ORDER BY PI.start_time " + dateOrderBy + " " +
"LIMIT ?,?";
"ORDER BY PI.start_time " + dateOrderBy + " ";

List<Map<String,Object>> camundaRows = jdbcTemplate.queryForList(camundaQuery, whereObjs.toArray());

Expand Down
12 changes: 9 additions & 3 deletions cws-service/src/main/java/jpl/cws/controller/RestService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1139,9 +1139,10 @@ public GsonUTCDateAdapter() {
) {

List<CwsProcessInstance> instances = null;
int recordsToReturn = 0;
Integer pageNum = Integer.parseInt(page);
try {
Integer pageNum = Integer.parseInt(page);


dateOrderBy = dateOrderBy.toUpperCase();
if (!dateOrderBy.equals("DESC") && !dateOrderBy.equals("ASC")) {
log.error("Invalid dateOrderBy of " + dateOrderBy + "! Forcing to be 'DESC'");
Expand All @@ -1156,13 +1157,18 @@ public GsonUTCDateAdapter() {

instances = cwsConsoleService.getFilteredProcessInstancesCamunda(
superProcInstId, procInstId, procDefKey, status, minDate, maxDate, dateOrderBy, pageNum);
if (pageNum > instances.size()) {
recordsToReturn = instances.size();
} else {
recordsToReturn = pageNum;
}
}
catch (Exception e) {
log.error("Problem getting process instance information!", e);
// return an empty set
return new GsonBuilder().setPrettyPrinting().create().toJson(new ArrayList<CwsProcessInstance>());
}
return new GsonBuilder().setPrettyPrinting().create().toJson(instances);
return new GsonBuilder().setPrettyPrinting().create().toJson(instances.subList(0,recordsToReturn));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import org.slf4j.Logger;
Expand Down Expand Up @@ -63,15 +64,11 @@ public void runResultsTest() throws IOException {
goToPage("processes");

log.info("Filtering Test History Page results.");
waitForElementID("pd-select");
Select select = new Select(findElById("pd-select"));
select.selectByVisibleText("Test History Page");
waitForElementXPath("//div[@id=\'processes-table_filter\']/label/input");

waitForElementID("filter-submit-btn");

log.info("Clicking 'Submit' button.");
WebElement filterSubmit = findElById("filter-submit-btn");
filterSubmit.click();
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).click();
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys("test_history_page");
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys(Keys.ENTER);

waitForElementID("processes-table");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,11 @@ public void runVariableProcTest() throws IOException {
goToPage("processes");

log.info("Filtering results for Test Initiators Page test.");
waitForElementID("pd-select");
Select select = new Select(findElById("pd-select"));
select.selectByVisibleText("Test Initiators Page");
waitForElementXPath("//div[@id=\'processes-table_filter\']/label/input");

waitForElementID("filter-submit-btn");

WebElement filterSubmit = findElById("filter-submit-btn");
filterSubmit.click();
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).click();
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys("test_initiators_page");
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys(Keys.ENTER);

waitForElementID("processes-table");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.time.Duration;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;

import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.logging.LogEntries;
import org.openqa.selenium.logging.LogEntry;
import org.openqa.selenium.logging.LogType;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -106,16 +116,13 @@ public void runSnippetsModelTest() throws IOException {
startProcDef("test_snippets_page", "Test Snippets Page", 90000);

goToPage("processes");
sleep(8000);

waitForElementID("pd-select");
log.info("Filter for Test Snippets Page results.");
Select select = new Select(findElById("pd-select"));
select.selectByVisibleText("Test Snippets Page");
waitForElementXPath("//div[@id=\'processes-table_filter\']/label/input");

waitForElementID("filter-submit-btn");

WebElement filterSubmit = findElById("filter-submit-btn");
filterSubmit.click();
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).click();
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys("test_snippets_page");
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys(Keys.ENTER);

waitForElementID("processes-table");

Expand Down
Loading