Browser/Plugin improvements: counting nodes, ordering and Nodes section at top/bottom#1575
Browser/Plugin improvements: counting nodes, ordering and Nodes section at top/bottom#1575rNoz wants to merge 9 commits intosabre-io:masterfrom
Conversation
…ring resources without lastmodified (found in manual UI tests)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1575 +/- ##
=========================================
Coverage 97.23% 97.23%
- Complexity 2836 2843 +7
=========================================
Files 175 175
Lines 9028 9043 +15
=========================================
+ Hits 8778 8793 +15
Misses 250 250 ☔ View full report in Codecov by Sentry. |
|
@rNoz php-cs-fixer has some minor formatting required. https://github.com/sabre-io/dav/actions/runs/12096265416/job/34109861744?pr=1575 You can run it locally |
| // If there are nodes and they are more than the max number to show at the top of the page | ||
| if ($numSubNodes) { | ||
| $html .= $this->generateNodesSection($subNodes, $numSubNodes); |
There was a problem hiding this comment.
Can you add a test case for when there are more than 20 nodes?
That will exercise this code, and the test can check that the Nodes section comes down the bottom of the HTML.
There was a problem hiding this comment.
Sure. Created testCollectionWithManyNodesGetSubdir. I have also updated the normal case (testCollectionGetRoot) to check that is at the top.
|
@phil-davis I needed to update the |
|
@DeepDiver1975 @staabm can either (or both) review this? |
staabm
left a comment
There was a problem hiding this comment.
I have no strong opinion on such changes.
looks useful, but I can't judge how this plugin is used in the wild.
I won't have time to look into more details for a few days
What am I doing?
Providing some tweaks to
Sabre\DAV\Browser\Plugin.php:Example with this PR:
Why?
More context: issue
I have added a test to evaluate the new
compareNodesprotected function, as I didn't see a way to easily replacelastmodifiedvalues for a set of files and just parsing the table rows of the response body. So I am using reflection to verify all the possibilities when comparing.Originally, I had another function (see below) to evaluate specifically the counting of nodes, but I think it will be fine just using what is provided by the
parent::setUp()+setUp(3 nodes).All passing:
Let me know if something else is necessary ;)