Skip to content

Commit

Permalink
HPCC-29400 ECL Watch auto expand top level of landing zone
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Clements <[email protected]>
  • Loading branch information
jeclrsg committed Jul 11, 2023
1 parent 88cd80d commit ad3244e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions esp/src/eclwatch/LZBrowseWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ define([
serverFilterSelect: null,
replicateEnabled: null,

dzExpanded: "",

postCreate: function (args) {
this.inherited(arguments);
this.sprayFixedForm = registry.byId(this.id + "SprayFixedForm");
Expand Down Expand Up @@ -720,6 +722,13 @@ define([
displayName: tree({
label: this.i18n.Name,
sortable: false,
shouldExpand: function (row, level) {
if ((context.dzExpanded === "" || context.dzExpanded === row.data.DropZone.Name) && level <= 1) {
context.dzExpanded = row.data.DropZone.Name;
return true;
}
return false;
},
formatter: function (_name, row) {
var img = "";
var name = _name;
Expand Down
9 changes: 9 additions & 0 deletions esp/src/src-react/components/LandingZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ interface LandingZoneProps {
filter?: LandingZoneFilter;
}

let dzExpanded = "";

export const LandingZone: React.FunctionComponent<LandingZoneProps> = ({
filter = emptyFilter
}) => {
Expand Down Expand Up @@ -134,6 +136,13 @@ export const LandingZone: React.FunctionComponent<LandingZoneProps> = ({
displayName: tree({
label: nlsHPCC.Name,
sortable: false,
shouldExpand: function (row, level) {
if ((dzExpanded === "" || dzExpanded === row.data.DropZone.Name) && level <= 1) {
dzExpanded = row.data.DropZone.Name;
return true;
}
return false;
},
formatter: function (_name, row) {
let img = "";
let name = row.displayName;
Expand Down

0 comments on commit ad3244e

Please sign in to comment.