Skip to content

Commit a773e56

Browse files
committed
Merge discvr-25.7 to discvr-25.11
2 parents a5fe671 + 798808b commit a773e56

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ jobs:
1010
if: github.repository == 'BimberLabInternal/LabDevKitModules'
1111
runs-on: ubuntu-latest
1212
steps:
13+
# Note: use slight delay in case there are associated commits across repos
14+
- name: "Sleep for 30 seconds"
15+
run: sleep 30s
16+
shell: bash
17+
1318
- name: "Build DISCVR"
1419
uses: bimberlabinternal/DevOps/githubActions/discvr-build@master
1520
with:

LDK/src/org/labkey/ldk/query/DefaultTableCustomizer.java

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,19 @@ private void setDetailsUrl(AbstractTableInfo ti)
118118
}
119119

120120
String schemaName = ti.getUserSchema().getSchemaName();
121-
assert schemaName != null;
122-
123121
String queryName = ti.getPublicName();
124-
assert queryName != null;
122+
if (queryName == null)
123+
{
124+
_log.error("TableInfo.getPublicName() was null", new Exception());
125+
return;
126+
}
125127

126128
List<String> keyFields = ti.getPkColumnNames();
127-
assert !keyFields.isEmpty() : "No key fields found for the table: " + ti.getPublicSchemaName() + "." + ti.getPublicName();
129+
if (keyFields.isEmpty())
130+
{
131+
_log.debug("No key fields found for the table, cannot set details URL: " + ti.getPublicSchemaName() + "." + ti.getPublicName());
132+
return;
133+
}
128134

129135
if (_settings.getPrimaryKeyField() != null)
130136
{
@@ -169,13 +175,25 @@ else if (_settings.isSetEditLinkOverrides())
169175
{
170176
//otherwise apply custom urls
171177
String schemaName = ti.getUserSchema().getSchemaName();
172-
assert schemaName != null;
173-
174178
String queryName = ti.getPublicName();
175-
assert queryName != null;
179+
if (queryName == null)
180+
{
181+
_log.error("TableInfo.getPublicName() was null", new Exception());
182+
return;
183+
}
176184

177185
List<String> keyFields = ti.getPkColumnNames();
178-
assert !keyFields.isEmpty() : "No key fields found for the table: " + ti.getPublicSchemaName() + "." + ti.getPublicName();
186+
if (keyFields.isEmpty())
187+
{
188+
// There does not seem to be a more direct test for 'is editable'
189+
if (ti.getUpdateService() == null)
190+
{
191+
return;
192+
}
193+
194+
_log.debug("No key fields found for the table, cannot customize edit UI: " + ti.getPublicSchemaName() + "." + ti.getPublicName());
195+
return;
196+
}
179197

180198
if (_settings.getPrimaryKeyField() != null)
181199
{

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ protected void doStartupAfterSpringConfig(ModuleContext moduleContext)
197197
LDKService.get().registerQueryButton(btn4, LaboratoryModule.SCHEMA_NAME, LaboratorySchema.TABLE_SAMPLES);
198198

199199
LDKService.get().registerQueryButton(new ShowBulkEditButton(this, LaboratoryModule.SCHEMA_NAME, LaboratorySchema.TABLE_SAMPLES), LaboratoryModule.SCHEMA_NAME, LaboratorySchema.TABLE_SAMPLES);
200+
201+
SimpleButtonConfigFactory btn5 = new SimpleButtonConfigFactory(this, "Manage Freezers", DetailsURL.fromString("/query/executeQuery.view?schemaName=laboratory&query.queryName=freezers"));
202+
btn5.setPermission(LaboratoryAdminPermission.class);
203+
LDKService.get().registerQueryButton(btn5, LaboratoryModule.SCHEMA_NAME, LaboratorySchema.TABLE_SAMPLES);
200204
}
201205

202206
@Override

0 commit comments

Comments
 (0)