Skip to content

Commit 1901d97

Browse files
Merge 25.3 to develop
2 parents bb0b424 + cbd37c3 commit 1901d97

File tree

6 files changed

+85
-19
lines changed

6 files changed

+85
-19
lines changed

ehr/resources/web/ehr/panel/GeneticCalculationSettingsPanel.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Ext4.define('EHR.panel.GeneticCalculationSettingsPanel', {
77
extend: 'Ext.panel.Panel',
88

99
initComponent: function(){
10+
Ext4.QuickTips.init();
1011
Ext4.apply(this, {
1112
//width: 550,
1213
border: false,
@@ -48,6 +49,15 @@ Ext4.define('EHR.panel.GeneticCalculationSettingsPanel', {
4849
fieldLabel: 'Hour Of Day',
4950
itemId: 'hourOfDay',
5051
width: 400
52+
},{
53+
xtype: 'numberfield',
54+
hideTrigger: true,
55+
fieldLabel: 'Day of Week',
56+
itemId: 'dayOfWeek',
57+
helpPopup: 'If provided, the job will run on the specified day of the week (1-7 or Sun-Sat). If blank, it will run each day.',
58+
width: 400,
59+
minValue: 1,
60+
maxValue: 7
5161
},{
5262
xtype: 'textfield',
5363
fieldLabel: 'Container Path',
@@ -96,6 +106,7 @@ Ext4.define('EHR.panel.GeneticCalculationSettingsPanel', {
96106
this.down('#isScheduled').setValue(results.isScheduled);
97107
this.down('#enabled').setValue(results.enabled);
98108
this.down('#hourOfDay').setValue(results.hourOfDay);
109+
this.down('#dayOfWeek').setValue(results.dayOfWeek);
99110
this.down('#containerPath').setValue(results.containerPath);
100111
this.down('#kinshipValidation').setValue(results.kinshipValidation);
101112
this.down('#allowImportDuringBusinessHours').setValue(results.allowImportDuringBusinessHours)
@@ -109,6 +120,7 @@ Ext4.define('EHR.panel.GeneticCalculationSettingsPanel', {
109120
containerPath: this.down('#containerPath').getValue(),
110121
enabled: this.down('#enabled').getValue(),
111122
hourOfDay: this.down('#hourOfDay').getValue(),
123+
dayOfWeek: this.down('#dayOfWeek').getValue(),
112124
kinshipValidation: this.down('#kinshipValidation').getValue(),
113125
allowImportDuringBusinessHours: this.down('#allowImportDuringBusinessHours').getValue()
114126
},

ehr/src/org/labkey/ehr/EHRController.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ public ApiResponse execute(ScheduleGeneticCalculationForm form, BindException er
640640
errors.reject(ERROR_MSG, "Unable to find container for path: " + form.getContainerPath());
641641
return null;
642642
}
643-
GeneticCalculationsJob.setProperties(form.isEnabled(), c, form.getHourOfDay(), form.isKinshipValidation(), form.isAllowImportDuringBusinessHours());
643+
GeneticCalculationsJob.setProperties(form.isEnabled(), c, form.getHourOfDay(), form.getDayOfWeek(), form.isKinshipValidation(), form.isAllowImportDuringBusinessHours());
644644

645645
return new ApiSimpleResponse("success", true);
646646
}
@@ -758,6 +758,7 @@ public static class ScheduleGeneticCalculationForm
758758
private boolean _enabled;
759759
private String containerPath;
760760
private int hourOfDay;
761+
private Integer dayOfWeek;
761762

762763
private boolean _kinshipValidation;
763764
private boolean _allowImportDuringBusinessHours;
@@ -792,6 +793,16 @@ public void setHourOfDay(int hourOfDay)
792793
this.hourOfDay = hourOfDay;
793794
}
794795

796+
public Integer getDayOfWeek()
797+
{
798+
return dayOfWeek;
799+
}
800+
801+
public void setDayOfWeek(Integer dayOfWeek)
802+
{
803+
this.dayOfWeek = dayOfWeek;
804+
}
805+
795806
public boolean isKinshipValidation()
796807
{
797808
return _kinshipValidation;
@@ -828,6 +839,7 @@ public ApiResponse execute(ScheduleGeneticCalculationForm form, BindException er
828839
ret.put("isScheduled", GeneticCalculationsJob.isScheduled());
829840
ret.put("enabled", GeneticCalculationsJob.isEnabled());
830841
ret.put("hourOfDay", GeneticCalculationsJob.getHourOfDay());
842+
ret.put("dayOfWeek", GeneticCalculationsJob.getDayOfWeek());
831843
ret.put("kinshipValidation", GeneticCalculationsJob.isKinshipValidation());
832844
ret.put("allowImportDuringBusinessHours", GeneticCalculationsJob.isAllowImportDuringBusinessHours());
833845

ehr/src/org/labkey/ehr/pipeline/GeneticCalculationsImportTask.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ else if (kinshipTable.getSqlDialect().isPostgreSQL())
307307
if (lineNum % 250000 == 0)
308308
{
309309
log.info("imported " + String.format("%,d", lineNum) + " rows");
310+
if (job != null)
311+
{
312+
job.updateStatusForTask();
313+
if (job.isCancelled())
314+
{
315+
throw new CancelledException();
316+
}
317+
}
310318
}
311319
}
312320

ehr/src/org/labkey/ehr/pipeline/GeneticCalculationsJob.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ public static void schedule()
9797
if (hour == null)
9898
hour = 2;
9999

100+
Integer day = getDayOfWeek();
101+
100102
JobDetail job = JobBuilder.newJob(GeneticCalculationsJob.class)
101103
.withIdentity(GeneticCalculationsJob.class.getCanonicalName())
102104
.build();
103105

104106
Trigger trigger = TriggerBuilder.newTrigger()
105107
.withIdentity(GeneticCalculationsJob.class.getCanonicalName())
106-
.withSchedule(CronScheduleBuilder.dailyAtHourAndMinute(hour, 0))
108+
.withSchedule(day == null ? CronScheduleBuilder.dailyAtHourAndMinute(hour, 0) : CronScheduleBuilder.weeklyOnDayAndHourAndMinute(day, hour, 0))
107109
.forJob(job)
108110
.build();
109111

@@ -174,12 +176,23 @@ public static Integer getHourOfDay()
174176
return null;
175177
}
176178

177-
public static void setProperties(Boolean isEnabled, Container c, Integer hourOfDay, Boolean isKinshipValidation, Boolean allowImportDuringBusinessHours)
179+
public static Integer getDayOfWeek()
180+
{
181+
Map<String, String> saved = PropertyManager.getProperties(GENETICCALCULATIONS_PROPERTY_DOMAIN);
182+
183+
if (saved.containsKey("dayOfWeek") & saved.get("dayOfWeek") != null)
184+
return Integer.parseInt(saved.get("dayOfWeek"));
185+
186+
return null;
187+
}
188+
189+
public static void setProperties(Boolean isEnabled, Container c, Integer hourOfDay, @Nullable Integer dayOfWeek, Boolean isKinshipValidation, Boolean allowImportDuringBusinessHours)
178190
{
179191
WritablePropertyMap props = PropertyManager.getWritableProperties(GENETICCALCULATIONS_PROPERTY_DOMAIN, true);
180192
props.put("enabled", isEnabled.toString());
181193
props.put("container", c.getId());
182194
props.put("hourOfDay", hourOfDay.toString());
195+
props.put("dayOfWeek", dayOfWeek == null ? null : dayOfWeek.toString());
183196
props.put("kinshipValidation", isKinshipValidation.toString());
184197
props.put("allowImportDuringBusinessHours", allowImportDuringBusinessHours.toString());
185198
props.save();

ehr/test/src/org/labkey/test/util/ehr/EHRTestHelper.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,31 @@ public void applyTemplate(Ext4GridRef grid, String templateName, boolean bulkEdi
230230
}
231231
}
232232

233+
public Locator.XPathLocator openBulkEdit(Ext4GridRef grid)
234+
{
235+
grid.clickTbarButton("More Actions");
236+
_test.waitAndClick(Locator.tag("span").withText("Bulk Edit"));
237+
Locator.XPathLocator bulkEditWindow = Ext4Helper.Locators.window("Bulk Edit");
238+
_test.waitForElement(bulkEditWindow);
239+
return bulkEditWindow;
240+
}
241+
242+
// This method toggles the bulk edit field that CONTAINS the label parameter in the label
233243
public void toggleBulkEditField(String label)
234244
{
235245
Locator.XPathLocator l = Ext4Helper.Locators.window("Bulk Edit").append(Locator.tagContainingText("label", label + ":").withClass("x4-form-item-label"));
236246
_test.shortWait().until(ExpectedConditions.numberOfElementsToBe(l, 1)).get(0).click();
237247
_test.waitForElement(l.enabled());
238248
}
239249

250+
// This method toggles the bulk edit field that has the exact label
251+
public void toggleBulkEditExactField(String label)
252+
{
253+
Locator.XPathLocator l = Ext4Helper.Locators.window("Bulk Edit").append(Locator.tagWithText("label", label + ":").withClass("x4-form-item-label"));
254+
_test.shortWait().until(ExpectedConditions.numberOfElementsToBe(l, 1)).get(0).click();
255+
_test.waitForElement(l.enabled());
256+
}
257+
240258
public void discardForm()
241259
{
242260
WebElement dataEntryButton = getDataEntryButton("More Actions").findElement(_test.getDriver());

snd/test/src/org/labkey/test/tests/snd/SNDTest.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ public void preTest()
10481048
//TODO: once exp tables are exposed - do a full cleanup from snd.pkgs, exp.DomainDescriptor, exp.PropertyDomain, exp.PropertyDescriptor
10491049
}
10501050

1051+
@SuppressWarnings("JUnit3StyleTestMethodInJUnit4Class") // Explicitly called as part of setup
10511052
public void testSNDImport()
10521053
{
10531054
//go to SND Project
@@ -1264,7 +1265,7 @@ public void cloneDraftPackage()
12641265
assertEquals("2", fairReviewRow.getMin());
12651266
assertEquals("7", fairReviewRow.getMax());
12661267
assertEquals(":-)", fairReviewRow.getDefault());
1267-
assertEquals(true, fairReviewRow.getRequired());
1268+
assertTrue(fairReviewRow.getRequired());
12681269
assertEquals("lol", fairReviewRow.getRedactedText());
12691270
}
12701271

@@ -1404,7 +1405,7 @@ public void saveNewPackage()
14041405
assertEquals("2", reviewRow.getMin());
14051406
assertEquals("7", reviewRow.getMax());
14061407
assertEquals("men", reviewRow.getDefault());
1407-
assertEquals(true, reviewRow.getRequired());
1408+
assertTrue(reviewRow.getRequired());
14081409
assertEquals("and women", reviewRow.getRedactedText());
14091410
}
14101411

@@ -1545,11 +1546,11 @@ public void editCategories() throws Exception
15451546

15461547
CategoryEditRow surgeryRowCat = catPage.getCategory("Surgery");
15471548
assertNotNull("Surgery category should exist", surgeryRowCat);
1548-
assertEquals("Surgery category should be active", true, surgeryRowCat.getIsActive());
1549+
assertTrue("Surgery category should be active", surgeryRowCat.getIsActive());
15491550

15501551
CategoryEditRow ourCat = catPage.getCategory(editedCategory);
15511552
assertNotNull("test edit category should exist", ourCat);
1552-
assertEquals("test edit category should be inactive", false, ourCat.getIsActive());
1553+
assertFalse("test edit category should be inactive", ourCat.getIsActive());
15531554
assertEquals("test edit category should have new description", editedCategory, ourCat.getDescription());
15541555

15551556
SelectRowsCommand catsCmd = new SelectRowsCommand("snd", "PkgCategories");
@@ -1803,12 +1804,17 @@ public void testProjectApis() throws Exception
18031804
public void testSuperPackageApis() throws Exception
18041805
{
18051806
goToProjectHome();
1806-
goToSchemaBrowser();
18071807

18081808
//insert super package
18091809
runScript(SAVEPACKAGEAPI_CHILDREN);
18101810
goToSchemaBrowser();
1811-
viewQueryData("snd", "SuperPkgs");
1811+
selectQuery("snd", "SuperPkgs");
1812+
// Issue 52277: Be sure that the call to analyze the query has completed by waiting for the dependency report,
1813+
// ensuring it won't be chosen as a deadlock victim
1814+
waitForText("Dependency Report");
1815+
Locator viewData = Locator.linkWithText("view data");
1816+
waitAndClickAndWait(viewData);
1817+
18121818
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_1, 1);
18131819
checkResults(TEST_SUPER_PKG_DESCRIPTION_1,
18141820
Arrays.asList(TEST_SUPER_PKG_START_ID1 + 1, // top-level super package is the + 0, so start at + 1
@@ -1818,8 +1824,7 @@ public void testSuperPackageApis() throws Exception
18181824

18191825
//update super package without cloning, with children
18201826
runScript(UPDATESUPERPACKAGEAPI_CHILDREN);
1821-
goToSchemaBrowser();
1822-
viewQueryData("snd", "SuperPkgs");
1827+
refresh();
18231828
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_2, 1);
18241829
assertTextNotPresent(TEST_SUPER_PKG_DESCRIPTION_1);
18251830
checkResults(TEST_SUPER_PKG_DESCRIPTION_2,
@@ -1832,8 +1837,7 @@ public void testSuperPackageApis() throws Exception
18321837

18331838
//update super package with cloning
18341839
runScript(UPDATESUPERPACKAGEAPI_CLONE);
1835-
goToSchemaBrowser();
1836-
viewQueryData("snd", "SuperPkgs");
1840+
refresh();
18371841
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_3, 1);
18381842
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_2, 1);
18391843
checkResults(TEST_SUPER_PKG_DESCRIPTION_3,
@@ -1846,8 +1850,7 @@ public void testSuperPackageApis() throws Exception
18461850

18471851
//update super package without cloning, without children
18481852
runScript(UPDATESUPERPACKAGEAPI_NOCHILDREN);
1849-
goToSchemaBrowser();
1850-
viewQueryData("snd", "SuperPkgs");
1853+
refresh();
18511854
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_4, 1);
18521855
assertTextPresent(TEST_SUPER_PKG_DESCRIPTION_3, 1);
18531856
assertTextNotPresent(TEST_SUPER_PKG_DESCRIPTION_2);
@@ -2170,7 +2173,7 @@ public void categoryPermissionsUI() throws Exception
21702173
{
21712174
value = getPermissionTableValue(i, 1);
21722175
assertNotNull(value);
2173-
assertTrue(value.equals("None"));
2176+
assertEquals("None", value);
21742177
categoryRows.add(i);
21752178
}
21762179
}
@@ -2182,7 +2185,7 @@ public void categoryPermissionsUI() throws Exception
21822185
{
21832186
value = getPermissionTableValue(r, 1);
21842187
assertNotNull(value);
2185-
assertTrue(value.equals("SND Reader"));
2188+
assertEquals("SND Reader", value);
21862189
}
21872190

21882191
findButton("Clear All").click();
@@ -2192,7 +2195,7 @@ public void categoryPermissionsUI() throws Exception
21922195
{
21932196
value = getPermissionTableValue(categoryRows.get(k), 1);
21942197
assertNotNull(value);
2195-
assertTrue(value.equals("None"));
2198+
assertEquals("None", value);
21962199
click(getSimpleTableCell(Locator.id("category-security"), categoryRows.get(k), 1));
21972200
clickRoleInOpenDropDown(permissions.get(k));
21982201
}
@@ -2203,7 +2206,7 @@ public void categoryPermissionsUI() throws Exception
22032206
{
22042207
value = getPermissionTableValue(categoryRows.get(j), 1);
22052208
assertNotNull(value);
2206-
assertTrue(value.equals(permissions.get(j)));
2209+
assertEquals(value, permissions.get(j));
22072210
}
22082211

22092212
}

0 commit comments

Comments
 (0)