Skip to content

Commit bade9bd

Browse files
committed
Add stub for manage study view
1 parent 0db6830 commit bade9bd

File tree

3 files changed

+84
-29
lines changed

3 files changed

+84
-29
lines changed

Studies/resources/schemas/studies.xml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,10 @@
126126
</table>
127127

128128
<table tableName="studies" tableDbType="TABLE" useColumnOrder="true">
129+
<javaCustomizer class="org.labkey.ldk.query.DefaultTableCustomizer" />
129130
<tableTitle>Studies</tableTitle>
131+
<tableUrl>/studies/manageStudy.view?studyId=${rowid}</tableUrl>
130132
<auditLogging>DETAILED</auditLogging>
131-
<importUrl></importUrl>
132-
<insertUrl></insertUrl>
133-
<updateUrl></updateUrl>
134-
<deleteUrl></deleteUrl>
135133
<columns>
136134
<column columnName="rowid">
137135
<isAutoInc>true</isAutoInc>
@@ -192,12 +190,9 @@
192190
</table>
193191

194192
<table tableName="studyCohorts" tableDbType="TABLE" useColumnOrder="true">
193+
<javaCustomizer class="org.labkey.ldk.query.DefaultTableCustomizer" />
195194
<tableTitle>Study Cohorts</tableTitle>
196195
<auditLogging>DETAILED</auditLogging>
197-
<importUrl></importUrl>
198-
<insertUrl></insertUrl>
199-
<updateUrl></updateUrl>
200-
<deleteUrl></deleteUrl>
201196
<columns>
202197
<column columnName="rowid">
203198
<isAutoInc>true</isAutoInc>
@@ -274,12 +269,9 @@
274269

275270
<table tableName="anchorEvents" tableDbType="TABLE" useColumnOrder="true">
276271
<tableTitle>Study Anchor Events</tableTitle>
272+
<javaCustomizer class="org.labkey.ldk.query.DefaultTableCustomizer" />
277273
<description>This table contains the key event types that anchor relative dates in this study</description>
278274
<auditLogging>DETAILED</auditLogging>
279-
<importUrl></importUrl>
280-
<insertUrl></insertUrl>
281-
<updateUrl></updateUrl>
282-
<deleteUrl></deleteUrl>
283275
<columns>
284276
<column columnName="rowid">
285277
<isAutoInc>true</isAutoInc>
@@ -342,12 +334,9 @@
342334

343335
<table tableName="expectedTimepoints" tableDbType="TABLE" useColumnOrder="true">
344336
<tableTitle>Study Expected Timepoints</tableTitle>
337+
<javaCustomizer class="org.labkey.ldk.query.DefaultTableCustomizer" />
345338
<description>This table contains the expected timepoints within this study, by cohort</description>
346339
<auditLogging>DETAILED</auditLogging>
347-
<importUrl></importUrl>
348-
<insertUrl></insertUrl>
349-
<updateUrl></updateUrl>
350-
<deleteUrl></deleteUrl>
351340
<columns>
352341
<column columnName="rowid">
353342
<isAutoInc>true</isAutoInc>
@@ -432,6 +421,7 @@
432421

433422
<table tableName="timepointToDate" tableDbType="TABLE" useColumnOrder="true">
434423
<tableTitle>Timepoint to Date Range</tableTitle>
424+
<javaCustomizer class="org.labkey.ldk.query.DefaultTableCustomizer" />
435425
<description>Per subject, this table contains the allowable date ranges to map record to timepoint label. It is usually populated automatically, but can be manually overridden</description>
436426
<auditLogging>DETAILED</auditLogging>
437427
<importUrl></importUrl>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,59 @@
1+
<script type="text/javascript" nonce="<%=scriptNonce%>">
2+
3+
(function($, LABKEY) {
4+
$(function(){
5+
$( document ).ready(function() {
6+
const studyId = LABKEY.ActionURL.getParameter('studyId')
7+
if (!studyId) {
8+
alert('Must supply a study ID!')
9+
return
10+
}
11+
12+
const webpart = <%=webpartContext%>;
13+
14+
const parentDiv = $('#' + webpart.wrapperDivId)
15+
parentDiv.append('<div id="' + webpart.wrapperDivId + '-studyCohorts"></div>')
16+
parentDiv.append('<div id="' + webpart.wrapperDivId + '-anchorEvents"></div>')
17+
parentDiv.append('<div id="' + webpart.wrapperDivId + '-expectedTimepoints"></div>')
18+
19+
LDK.Utils.getBasicQWP({
20+
frame: 'portal',
21+
title: 'Cohorts',
22+
name: 'query',
23+
schemaName: 'studies',
24+
queryName: 'studyCohorts',
25+
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
26+
maxRows: 20,
27+
renderTo: webpart.wrapperDivId + '-studyCohorts'
28+
}).render();
29+
30+
LDK.Utils.getBasicQWP({
31+
frame: 'portal',
32+
title: 'Anchor Events',
33+
name: 'query',
34+
schemaName: 'studies',
35+
queryName: 'anchorEvents',
36+
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
37+
maxRows: 20,
38+
renderTo: webpart.wrapperDivId + '-anchorEvents'
39+
}).render();
40+
41+
LDK.Utils.getBasicQWP({
42+
frame: 'portal',
43+
title: 'Expected Timepoints',
44+
name: 'query',
45+
schemaName: 'studies',
46+
queryName: 'expectedTimepoints',
47+
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
48+
maxRows: 20,
49+
renderTo: webpart.wrapperDivId + '-expectedTimepoints'
50+
}).render();
51+
})
52+
});
53+
}(jQuery, LABKEY));
54+
55+
</script>
56+
57+
158
PLACEHOLDER: Make a page that accepts a studyId and renders useful UI to manage timepoints, run QC, and show data
59+
<br><br>

Studies/resources/views/studiesOverview.html

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,28 @@
33
(function($, LABKEY) {
44
$(function(){
55
$( document ).ready(function() {
6-
LABKEY.Query.selectRows({
6+
// TODO: ultimately replace this page with a better card view of the data:
7+
var webpart = <%=webpartContext%>;
8+
$('#' + webpart.wrapperDivId).append('<div id="' + webpart.wrapperDivId + '-studies"></div>')
9+
LDK.Utils.getBasicQWP({
10+
frame: 'portal',
11+
title: 'List of Studies',
12+
name: 'query',
713
schemaName: 'studies',
814
queryName: 'studies',
9-
scope: this,
10-
failure: LDK.Utils.getErrorCallback(),
11-
success: function (results) {
12-
// TODO: render some sort of card/tile view
13-
//console.log(results)
14-
}
15-
})
15+
maxRows: 20
16+
}).render(webpart.wrapperDivId + '-studies');
17+
18+
// LABKEY.Query.selectRows({
19+
// schemaName: 'studies',
20+
// queryName: 'studies',
21+
// scope: this,
22+
// failure: LDK.Utils.getErrorCallback(),
23+
// success: function (results) {
24+
// // TODO: render some sort of card/tile view
25+
// //console.log(results)
26+
// }
27+
// })
1628

1729
LABKEY.Query.selectRows({
1830
schemaName: 'study',
@@ -42,7 +54,6 @@
4254
div.append('</ul>')
4355
})
4456

45-
var webpart = <%=webpartContext%>;
4657
$('#' + webpart.wrapperDivId).append(div)
4758
}
4859
})
@@ -52,7 +63,3 @@
5263

5364
</script>
5465

55-
Below is a list of the datasets managed in this folder.
56-
57-
<br>
58-

0 commit comments

Comments
 (0)