Skip to content

Commit 07b071d

Browse files
authored
Merge pull request #149 from LabKey/fb_merge_22.11_to_develop
Merge discvr-22.11 to develop
2 parents aba2d20 + e5f37f5 commit 07b071d

File tree

10 files changed

+38
-10
lines changed

10 files changed

+38
-10
lines changed

LDK/resources/web/LDK/grid/Panel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ Ext4.apply(LABKEY.ext4.GRIDBUTTONS, {
5858
var model = LDK.StoreUtils.createModelInstance(grid.store, null, true);
5959
grid.store.insert(0, [model]); //add a blank record in the first position
6060

61-
if(cellEditing)
62-
cellEditing.startEditByPosition({row: 0, column: this.firstEditableColumn || 0});
61+
if (cellEditing)
62+
cellEditing.startEditByPosition({row: 0, column: grid.firstEditableColumn || 0});
6363
}
6464
}, config);
6565
},

laboratory/src/org/labkey/laboratory/query/ContainerIncrementingTable.java renamed to laboratory/api-src/org/labkey/api/laboratory/query/ContainerIncrementingTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.labkey.laboratory.query;
1+
package org.labkey.api.laboratory.query;
22

33
import org.apache.commons.lang3.StringUtils;
44
import org.jetbrains.annotations.NotNull;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Cleanup legacy orphan rows
2+
delete from laboratory.workbooks WHERE (SELECT c.entityid from core.containers c where c.entityid = container) is null;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Cleanup legacy orphan rows
2+
delete from laboratory.workbooks WHERE (SELECT c.entityid from core.containers c where c.entityid = container) is null;

laboratory/resources/web/laboratory/window/ChangeAssayResultStatusWindow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Ext4.define('Laboratory.window.ChangeAssayResultStatusWindow', {
88
buttonHandler: function(dataRegionName, schemaName, queryName){
99
var dataRegion = LABKEY.DataRegions[dataRegionName];
1010
if (!dataRegion || !dataRegion.getChecked() || !dataRegion.getChecked().length){
11-
Ext4.Msg.alert('Error', '');
11+
Ext4.Msg.alert('Error', 'No rows selected');
1212
return;
1313
}
1414

1515
LDK.Assert.assertTrue('DataRegion not suitable for ChangeAssayResultStatusWindow for: ' + LDK.DataRegionUtils.getDisplayName(dataRegion), (dataRegion.pkCols && dataRegion.pkCols.length == 1));
16-
if (dataRegion.pkCols.length != 1){
16+
if (dataRegion.pkCols.length !== 1){
1717
Ext4.Msg.alert('Error', 'This button cannot be used with this table');
1818
return;
1919
}

laboratory/src/org/labkey/laboratory/LaboratoryController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
import org.labkey.api.view.UnauthorizedException;
8585
import org.labkey.api.view.template.ClientDependency;
8686
import org.labkey.laboratory.assay.AssayHelper;
87-
import org.labkey.laboratory.query.ContainerIncrementingTable;
87+
import org.labkey.api.laboratory.query.ContainerIncrementingTable;
8888
import org.labkey.laboratory.query.WorkbookModel;
8989
import org.springframework.validation.BindException;
9090
import org.springframework.validation.Errors;

laboratory/src/org/labkey/laboratory/LaboratoryManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import org.labkey.api.security.permissions.InsertPermission;
5757
import org.labkey.api.util.PageFlowUtil;
5858
import org.labkey.api.view.Portal;
59-
import org.labkey.laboratory.query.ContainerIncrementingTable;
59+
import org.labkey.api.laboratory.query.ContainerIncrementingTable;
6060
import org.labkey.laboratory.query.LaboratoryWorkbooksTable;
6161
import org.labkey.laboratory.query.WorkbookModel;
6262

laboratory/src/org/labkey/laboratory/LaboratoryModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public String getName()
7777
@Override
7878
public @Nullable Double getSchemaVersion()
7979
{
80-
return 12.304;
80+
return 12.305;
8181
}
8282

8383
@Override

laboratory/src/org/labkey/laboratory/LaboratoryUserSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.labkey.api.query.QuerySchema;
1212
import org.labkey.api.query.SimpleUserSchema;
1313
import org.labkey.api.security.User;
14-
import org.labkey.laboratory.query.ContainerIncrementingTable;
14+
import org.labkey.api.laboratory.query.ContainerIncrementingTable;
1515
import org.labkey.laboratory.query.LaboratoryWorkbooksTable;
1616
import org.labkey.api.ldk.table.ContainerScopedTable;
1717

laboratory/src/org/labkey/laboratory/WorkbookTestCase.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
package org.labkey.laboratory;
22

33
import org.junit.After;
4+
import org.junit.Assert;
45
import org.junit.Before;
56
import org.junit.Test;
67
import org.labkey.api.collections.CaseInsensitiveHashMap;
8+
import org.labkey.api.data.Container;
9+
import org.labkey.api.data.ContainerManager;
10+
import org.labkey.api.data.DbSchema;
11+
import org.labkey.api.data.DbSchemaType;
12+
import org.labkey.api.data.SimpleFilter;
713
import org.labkey.api.data.TableInfo;
814
import org.labkey.api.data.TableSelector;
915
import org.labkey.api.data.WorkbookContainerType;
@@ -33,7 +39,10 @@ public class WorkbookTestCase extends WorkbookContainerType.AbstractTestCase
3339
public void setUp() throws Exception
3440
{
3541
_context = TestContext.get();
36-
doInitialSetUp(PROJECT_NAME);
42+
if (_project == null)
43+
{
44+
doInitialSetUp(PROJECT_NAME);
45+
}
3746
}
3847

3948
@Test
@@ -66,11 +75,26 @@ public void testCrossContainerBehaviorsForSimpleSchema() throws Exception
6675
testCrossContainerBehaviors(_project, _workbooks, LaboratoryModule.SCHEMA_NAME, LaboratorySchema.TABLE_SAMPLE_TYPE, LaboratorySchema.TABLE_SAMPLES, "samplename", "sampletype", Arrays.asList("Value1", "Value2", "Value3", "Value4"), extraRowValues);
6776
}
6877
}
78+
79+
// Verify laboratory.workbooks rows get deleted:
80+
Container newWorkbook = ContainerManager.createContainer(_project, null, "Title3", null, WorkbookContainerType.NAME, _context.getUser());
81+
82+
TableInfo ti = DbSchema.get(LaboratoryModule.SCHEMA_NAME, DbSchemaType.Module).getTable(LaboratorySchema.TABLE_WORKBOOKS);
83+
TableSelector ts = new TableSelector(ti, new SimpleFilter(FieldKey.fromString("container"), newWorkbook.getId()), null);
84+
Assert.assertTrue("laboratory.workbooks row should exist", ts.exists());
85+
86+
ContainerManager.delete(newWorkbook, TestContext.get().getUser());
87+
Assert.assertFalse("laboratory.workbooks row should have been deleted", ts.exists());
6988
}
7089

7190
@After
7291
public void onComplete()
7392
{
7493
doCleanup(PROJECT_NAME);
94+
if (_project != null)
95+
{
96+
TableSelector ts = new TableSelector(DbSchema.get(LaboratoryModule.SCHEMA_NAME, DbSchemaType.Module).getTable(LaboratorySchema.TABLE_WORKBOOKS), new SimpleFilter(FieldKey.fromString("parentContainer"), _project.getId()), null);
97+
Assert.assertFalse("laboratory.workbooks rows should have been deleted", ts.exists());
98+
}
7599
}
76100
}

0 commit comments

Comments
 (0)