From ec665b42e35a709c52c0bc1ffe3821cc687cd029 Mon Sep 17 00:00:00 2001 From: mcagnion Date: Sun, 30 Aug 2026 10:36:23 +0000 Subject: [PATCH 1/2] Apply changes from https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/10270 --- spec/System/TestPowerReport_spec.lua | 38 ++++++++++++++++++++++ src/Classes/PowerReportListControl.lua.rej | 10 ++++++ 2 files changed, 48 insertions(+) create mode 100644 spec/System/TestPowerReport_spec.lua create mode 100644 src/Classes/PowerReportListControl.lua.rej diff --git a/spec/System/TestPowerReport_spec.lua b/spec/System/TestPowerReport_spec.lua new file mode 100644 index 0000000000..a98126e575 --- /dev/null +++ b/spec/System/TestPowerReport_spec.lua @@ -0,0 +1,38 @@ +describe("PowerReportListControl", function() + local PowerReportListControl + + before_each(function() + LoadModule("Classes/PowerReportListControl") + PowerReportListControl = common.classes.PowerReportListControl + end) + + local function relist(originalList, showClusters, allocated) + local control = { + originalList = originalList, + showClusters = showClusters or false, + allocated = allocated or false, + } + PowerReportListControl.ReList(control) + return control.list + end + + it("Show Unallocated excludes allocated nodes", function() + local list = relist({ + { name = "allocated", power = 10, pathDist = 1, allocated = true }, + { name = "unallocated", power = 5, pathDist = 1, allocated = false }, + }, false, false) + + assert.are.equal(1, #list) + assert.are.equal("unallocated", list[1].name) + end) + + it("Show Allocated includes allocated nodes", function() + local list = relist({ + { name = "allocated", power = -10, pathDist = 1, allocated = true }, + { name = "unallocated", power = 5, pathDist = 1, allocated = false }, + }, false, true) + + assert.are.equal(1, #list) + assert.are.equal("allocated", list[1].name) + end) +end) diff --git a/src/Classes/PowerReportListControl.lua.rej b/src/Classes/PowerReportListControl.lua.rej new file mode 100644 index 0000000000..7b1f9b4baf --- /dev/null +++ b/src/Classes/PowerReportListControl.lua.rej @@ -0,0 +1,10 @@ +diff a/src/Classes/PowerReportListControl.lua b/src/Classes/PowerReportListControl.lua (rejected hunks) +@@ -112,6 +112,8 @@ function PowerReportListClass:ReList() + end + if self.allocated then + insert = item.allocated ++ elseif item.allocated then ++ insert = false + end + if not self.showMasteries and item.type == "Mastery" then + insert = false From d1a2de6df709c013d1012ce7abdfd9f9857492e4 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Sun, 30 Aug 2026 23:20:22 +1000 Subject: [PATCH 2/2] Fix port --- src/Classes/PowerReportListControl.lua | 2 ++ src/Classes/PowerReportListControl.lua.rej | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 src/Classes/PowerReportListControl.lua.rej diff --git a/src/Classes/PowerReportListControl.lua b/src/Classes/PowerReportListControl.lua index 5d059ca9ec..58dc23f73f 100644 --- a/src/Classes/PowerReportListControl.lua +++ b/src/Classes/PowerReportListControl.lua @@ -106,6 +106,8 @@ function PowerReportListClass:ReList() end if self.allocated then insert = item.allocated + elseif item.allocated then + insert = false end if insert then diff --git a/src/Classes/PowerReportListControl.lua.rej b/src/Classes/PowerReportListControl.lua.rej deleted file mode 100644 index 7b1f9b4baf..0000000000 --- a/src/Classes/PowerReportListControl.lua.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/src/Classes/PowerReportListControl.lua b/src/Classes/PowerReportListControl.lua (rejected hunks) -@@ -112,6 +112,8 @@ function PowerReportListClass:ReList() - end - if self.allocated then - insert = item.allocated -+ elseif item.allocated then -+ insert = false - end - if not self.showMasteries and item.type == "Mastery" then - insert = false