Skip to content

Commit 0b8ee79

Browse files
authored
Merge pull request #71 from LabKey/fb_merge_discvr-20.11
Merge discvr-20.11 to develop
2 parents ae665fb + b3ee1a6 commit 0b8ee79

File tree

3 files changed

+36
-8
lines changed

3 files changed

+36
-8
lines changed

LDK/resources/web/LDK/field/SimpleCombo.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Ext4.define('LDK.form.field.SimpleCombo', {
1212
typeAhead: true,
1313
queryMode: 'local',
1414
triggerAction: 'all',
15+
joinReturnValue: false,
16+
delimiter: ';',
1517

1618
initComponent: function(){
1719
Ext4.apply(this, {
@@ -48,5 +50,28 @@ Ext4.define('LDK.form.field.SimpleCombo', {
4850
vals = Ext4.unique(vals);
4951

5052
return vals;
53+
},
54+
55+
getSubmitValue: function(){
56+
var val = this.callParent(arguments);
57+
if (!this.joinReturnValue) {
58+
return val;
59+
}
60+
61+
return val && val.length ? val.join(this.delimiter) : null;
62+
},
63+
64+
getToolParameterValue : function(){
65+
return this.getSubmitValue();
66+
},
67+
68+
setValue: function(val) {
69+
if (this.multiSelect && val && Ext4.isString(val)) {
70+
val = val.split(this.delimiter);
71+
this.callParent([val]);
72+
}
73+
else {
74+
this.callParent(arguments);
75+
}
5176
}
5277
});

LDK/test/src/org/labkey/test/tests/external/labModules/LabModulesTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ private void tabbedReportToggleTest()
729729

730730
Ext4ComboRef field = _ext4Helper.queryOne("#projectField", Ext4ComboRef.class);
731731
field.setComboByDisplayValue("Project1");
732+
assertNotNull(field.getValue());
732733

733734
// we toggle back to a panel with a single tab, where that tab has already been loaded.
734735
// since the filter set has changed, this tab should update to reflect that

laboratory/resources/web/laboratory/panel/ProjectFilterType.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ Ext4.define('Laboratory.panel.ProjectFilterType', {
5252
items: [{
5353
boxLabel: 'Include if subject was ever a member of the project/group',
5454
inputValue: 'allProjects',
55-
checked: ctx.projectFilterMode != 'overlappingProjects'
55+
checked: ctx.projectFilterMode !== 'overlappingProjects'
5656
},{
5757
boxLabel: 'Include only if the sample date overlaps with assignment to that project/group',
5858
inputValue: 'overlappingProjects',
59-
checked: ctx.projectFilterMode == 'overlappingProjects'
59+
checked: ctx.projectFilterMode === 'overlappingProjects'
6060
}]
6161
}]
6262
});
@@ -79,9 +79,9 @@ Ext4.define('Laboratory.panel.ProjectFilterType', {
7979

8080
var filters = this.getFilters();
8181
var report = tab.report;
82-
var projectFieldName = (filters.projectFilterMode == 'overlappingProjects') ? report.overlappingProjectsFieldName : report.allProjectsFieldName;
82+
var projectFieldName = (filters.projectFilterMode === 'overlappingProjects') ? report.overlappingProjectsFieldName : report.allProjectsFieldName;
8383
if (!projectFieldName){
84-
if (filters.projectFilterMode == 'overlappingProjects' && !report.overlappingProjectsFieldName){
84+
if (filters.projectFilterMode === 'overlappingProjects' && !report.overlappingProjectsFieldName){
8585
projectFieldName = report.allProjectsFieldName;
8686

8787
if (projectFieldName)
@@ -100,15 +100,16 @@ Ext4.define('Laboratory.panel.ProjectFilterType', {
100100
}
101101
}
102102

103-
projectFieldName = projectFieldName + '/' + filters.projects[0] + '::lastStartDate';
103+
var fieldName = filters.projects[0].replace(/\//g, '$S');
104+
projectFieldName = projectFieldName + '/' + fieldName + '::lastStartDate';
104105
filterArray.nonRemovable.push(LABKEY.Filter.create(projectFieldName, null, LABKEY.Filter.Types.NONBLANK));
105106

106107
return filterArray;
107108
},
108109

109110
isValid: function(){
110111
var val = this.down('#projectField').getValue();
111-
if(!val || !val.length){
112+
if (!val || !val.length){
112113
return false;
113114
}
114115

@@ -139,10 +140,11 @@ Ext4.define('Laboratory.panel.ProjectFilterType', {
139140

140141
getProjects: function(){
141142
var projectArray = this.down('#projectField').getValue();
142-
if (projectArray || !Ext4.isArray(projectArray))
143+
if (projectArray && !Ext4.isArray(projectArray)) {
143144
projectArray = [projectArray];
145+
}
144146

145-
if (projectArray.length > 0){
147+
if (projectArray && projectArray.length > 0){
146148
projectArray = Ext4.unique(projectArray);
147149
projectArray.sort();
148150
}

0 commit comments

Comments
 (0)