From 3d374df739fb2134607eb105ec89fb44b35f22d8 Mon Sep 17 00:00:00 2001 From: Binal Date: Tue, 6 Oct 2020 13:39:10 -0700 Subject: [PATCH 1/6] Merge from onprc19.1 r.63271 --- LDK/resources/web/LDK/DataRegionUtils.js | 21 ++++++++++++------- LDK/resources/web/LDK/Utils.js | 4 ++-- .../web/LDK/panel/TabbedReportPanel.js | 4 ++++ .../resources/web/laboratory/buttons.js | 3 ++- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/LDK/resources/web/LDK/DataRegionUtils.js b/LDK/resources/web/LDK/DataRegionUtils.js index 36a173bf..cc7090ad 100644 --- a/LDK/resources/web/LDK/DataRegionUtils.js +++ b/LDK/resources/web/LDK/DataRegionUtils.js @@ -16,14 +16,19 @@ LDK.DataRegionUtils = new function(){ LDK.Assert.assertTrue(success + ' is not a valid success function.', Ext4.isFunction(success)); var selectionSuccess = function(selection) { - if(!selection.selected.length && Ext4.isFunction(onNoneSelected)) { - onNoneSelected(); - } - else { - var colExpr = '(' + tableAlias + '.' + selectorCols.join(" || ',' || " + tableAlias + ".") + ')'; - var clause = "WHERE " + colExpr + " IN ('" + selection.selected.join("', '") + "')"; - success(clause); - } + dataRegion.clearSelected({ + success: function () { + if (!selection.selected.length && Ext4.isFunction(onNoneSelected)) { + onNoneSelected(); + } + else { + var colExpr = '(' + tableAlias + '.' + selectorCols.join(" || ',' || " + tableAlias + ".") + ')'; + var clause = "WHERE " + colExpr + " IN ('" + selection.selected.join("', '") + "')"; + success(clause); + } + }, + failure: Ext4.isFunction(failure) ? failure : LDK.Utils.getErrorCallback() + }); }; var config = { diff --git a/LDK/resources/web/LDK/Utils.js b/LDK/resources/web/LDK/Utils.js index 43a2d027..13728442 100644 --- a/LDK/resources/web/LDK/Utils.js +++ b/LDK/resources/web/LDK/Utils.js @@ -518,8 +518,8 @@ LDK.Utils = new function(){ } //append non-removeable filters - if (LABKEY.DataRegions[dataRegionName].getBaseFilters().length){ - var array = LABKEY.DataRegions[dataRegionName].getBaseFilters(); + if (LABKEY.DataRegions[dataRegionName].filters && LABKEY.DataRegions[dataRegionName].filters){ + var array = LABKEY.DataRegions[dataRegionName].filters; for (var i=0;i 1) { + t[1] = decodeURIComponent(t[1]); + } switch(t[0]){ case 'inputType': context.inputType = t[1]; diff --git a/laboratory/resources/web/laboratory/buttons.js b/laboratory/resources/web/laboratory/buttons.js index 546de402..db279c82 100644 --- a/laboratory/resources/web/laboratory/buttons.js +++ b/laboratory/resources/web/laboratory/buttons.js @@ -358,8 +358,9 @@ Laboratory.buttonHandlers = new function(){ var header = []; var fieldMap = LDK.StoreUtils.getFieldMap(store); Ext4.each(columns, function(name){ - if (name == 'rowid' || name == 'freezerid') + if (name == 'rowid' || name == 'freezerid') { return; + } header.push(fieldMap[name].caption); }, this); From f356e3de978b9d95a42cf60416f2c5d89301f4df Mon Sep 17 00:00:00 2001 From: Binal Date: Thu, 8 Oct 2020 00:11:05 -0700 Subject: [PATCH 2/6] Merge from onprc19.1 r.65639 to 65677 --- LDK/src/org/labkey/ldk/LDKController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LDK/src/org/labkey/ldk/LDKController.java b/LDK/src/org/labkey/ldk/LDKController.java index 803a64aa..e88a038a 100644 --- a/LDK/src/org/labkey/ldk/LDKController.java +++ b/LDK/src/org/labkey/ldk/LDKController.java @@ -12,6 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. + * Update 2020-05-21 added mapping to IM field for use in pulling employee ID + * Build by Josh */ package org.labkey.ldk; From 3b22b7d35a0d89d6d5744d5585ff9955a4699339 Mon Sep 17 00:00:00 2001 From: Binal Date: Thu, 8 Oct 2020 00:20:24 -0700 Subject: [PATCH 3/6] Merge from onprc19.1 r.65678 to 65757 --- LDK/resources/web/LDK/panel/TabbedReportPanel.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/LDK/resources/web/LDK/panel/TabbedReportPanel.js b/LDK/resources/web/LDK/panel/TabbedReportPanel.js index 11d4bcbc..beccc04c 100644 --- a/LDK/resources/web/LDK/panel/TabbedReportPanel.js +++ b/LDK/resources/web/LDK/panel/TabbedReportPanel.js @@ -44,6 +44,10 @@ Ext4.define('LDK.panel.TabbedReportPanel', { showFilterOptionsTitle: false, showReportsOption: false, + // Has at least one report been shown, meaning that we will always try to render the report whenever the user clicks + // a report tab + reportShown: false, + initComponent: function(){ Ext4.apply(this, { tabsReady: false, @@ -633,6 +637,7 @@ Ext4.define('LDK.panel.TabbedReportPanel', { //updates the provided tab, unless already up-to-date possiblyUpdateActiveReport: function (filters, forceRefresh) { + this.reportShown = true; var tab = this.activeReport; var reload = false; @@ -1076,7 +1081,7 @@ Ext4.define('LDK.panel.TabbedReportPanel', { context.inputType = t[1]; break; case 'showReport': - this.isReportTabSelected = (t[1] === 1); + this.isReportTabSelected = (t[1] === '1'); break; case 'activeReport': var report = decodeURI(t[1]); @@ -1390,7 +1395,7 @@ Ext4.define('LDK.panel.TabbedReportPanel', { if (tab && tab.items && tab.items.length > 0) { Ext4.apply(filters, { inputType: this.down('#inputType').getValue().selector, - showReport: this.isReportTabSelected ? '1' : '0', + showReport: this.isReportTabSelected || this.reportShown ? '1' : '0', activeReport: tab.items[0].report.id }); } From d5141086de63b54026e46d1f6a0198699e0e5fc3 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Mon, 19 Oct 2020 18:00:46 -0700 Subject: [PATCH 4/6] Avoid double-decoding of URI elements --- LDK/resources/web/LDK/panel/TabbedReportPanel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LDK/resources/web/LDK/panel/TabbedReportPanel.js b/LDK/resources/web/LDK/panel/TabbedReportPanel.js index beccc04c..64c3950e 100644 --- a/LDK/resources/web/LDK/panel/TabbedReportPanel.js +++ b/LDK/resources/web/LDK/panel/TabbedReportPanel.js @@ -1084,7 +1084,7 @@ Ext4.define('LDK.panel.TabbedReportPanel', { this.isReportTabSelected = (t[1] === '1'); break; case 'activeReport': - var report = decodeURI(t[1]); + var report = t[1]; var tab = this.reportMap[report]; if (tab){ this.activeReport = tab; @@ -1095,7 +1095,7 @@ Ext4.define('LDK.panel.TabbedReportPanel', { } break; default: - context[t[0]] = decodeURI(t[1]); + context[t[0]] = t[1]; } } } @@ -1428,4 +1428,4 @@ Ext4.define('LDK.panel.TabbedReportPanel', { return filters; } -}); \ No newline at end of file +}); From 12dd6a6510f6e7e7e0a66378f1f86f872ecf8c5d Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Thu, 29 Oct 2020 16:55:41 -0700 Subject: [PATCH 5/6] Incorporate code review feedback --- LDK/resources/web/LDK/panel/TabbedReportPanel.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/LDK/resources/web/LDK/panel/TabbedReportPanel.js b/LDK/resources/web/LDK/panel/TabbedReportPanel.js index 64c3950e..ac66c15d 100644 --- a/LDK/resources/web/LDK/panel/TabbedReportPanel.js +++ b/LDK/resources/web/LDK/panel/TabbedReportPanel.js @@ -44,10 +44,6 @@ Ext4.define('LDK.panel.TabbedReportPanel', { showFilterOptionsTitle: false, showReportsOption: false, - // Has at least one report been shown, meaning that we will always try to render the report whenever the user clicks - // a report tab - reportShown: false, - initComponent: function(){ Ext4.apply(this, { tabsReady: false, @@ -637,7 +633,6 @@ Ext4.define('LDK.panel.TabbedReportPanel', { //updates the provided tab, unless already up-to-date possiblyUpdateActiveReport: function (filters, forceRefresh) { - this.reportShown = true; var tab = this.activeReport; var reload = false; @@ -646,6 +641,11 @@ Ext4.define('LDK.panel.TabbedReportPanel', { var reportTab = tab.items[0]; if (reportTab.filters){ for (var i in filters){ + // The intent of this code is to test the filter conditions of this report (i.e. IDs, groups). + // showReport has nothing to do with this + if (i === 'showReport') { + continue; + } if (JSON.stringify(filters[i]) !== JSON.stringify(reportTab.filters[i])){ reload = true; break; @@ -1395,7 +1395,7 @@ Ext4.define('LDK.panel.TabbedReportPanel', { if (tab && tab.items && tab.items.length > 0) { Ext4.apply(filters, { inputType: this.down('#inputType').getValue().selector, - showReport: this.isReportTabSelected || this.reportShown ? '1' : '0', + showReport: this.isReportTabSelected ? '1' : '0', activeReport: tab.items[0].report.id }); } From b7174125384a06a9834d73f84565da3196fcc9e4 Mon Sep 17 00:00:00 2001 From: bbimber Date: Fri, 30 Oct 2020 05:13:26 -0700 Subject: [PATCH 6/6] trim comment --- LDK/src/org/labkey/ldk/LDKController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/LDK/src/org/labkey/ldk/LDKController.java b/LDK/src/org/labkey/ldk/LDKController.java index e88a038a..3a8b760d 100644 --- a/LDK/src/org/labkey/ldk/LDKController.java +++ b/LDK/src/org/labkey/ldk/LDKController.java @@ -12,8 +12,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * Update 2020-05-21 added mapping to IM field for use in pulling employee ID - * Build by Josh */ package org.labkey.ldk; @@ -1157,4 +1155,4 @@ public void export(Object o, HttpServletResponse response, BindException errors) PageFlowUtil.streamFileBytes(response, "naturalizeInstall.sql", installScript.getContents().getBytes(StringUtilsLabKey.DEFAULT_CHARSET), true); } } -} \ No newline at end of file +}