Skip to content

Commit

Permalink
HPCC-29961 ECL Watch v5 fix recent filter links
Browse files Browse the repository at this point in the history
Fix conflicts between quite old PRs HPCC-23619 (added Recent Filters)
and HPCC-24795 (partially removed them). The net result for this PR is
that "Recent Filters" links now open with the correct data, while other
"Open in New Window" links will not do so with unnecessarily long URLs

Signed-off-by: Jeremy Clements <[email protected]>
  • Loading branch information
jeclrsg committed Apr 30, 2024
1 parent 3726170 commit dba56f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions esp/src/eclwatch/_Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,22 @@ define([
return retVal;
},

getURL: function () {
getURL: function (componentFilterParams) {
var baseUrl = document.URL.split("#")[0].replace("index.html", "stub.htm");
var baseUrlParts = baseUrl.split("?");
baseUrl = baseUrlParts[0];
var args = baseUrlParts[1];
delete this.params.__filter;
var filterParams = this.getFilterParams();
var filterParams = componentFilterParams ? componentFilterParams : this.getFilterParams();
if (filterParams) {
this.params.__filter = ioQuery.objectToQuery(filterParams);
}
var paramsString = ioQuery.objectToQuery(this.params);
return baseUrl + "?" + paramsString;
},

_onNewPage: function (event) {
var win = window.open(this.getURL(), "_blank");
_onNewPage: function (_event, componentFilterParams) {
var win = window.open(this.getURL(componentFilterParams), "_blank");
if (win) {
win.focus();
}
Expand Down
2 changes: 1 addition & 1 deletion esp/src/src/react/recentFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const RecentFilters: React.FunctionComponent<RecentFilterProps> = ({

const handleClick = (e) => {
const tempObj = JSON.parse(decodeURIComponent(e.currentTarget.value));
widget.NewPage.onClick(tempObj);
widget.NewPage.onClick(e, tempObj);
};

const shimmerElements = React.useMemo(() => [
Expand Down

0 comments on commit dba56f8

Please sign in to comment.