Commit 237d27c
committed
LazyToolBox: drop the broken to_panel_view override
The override I had ignored the ``view`` argument entirely and just
flattened ``_tool_index.entries`` by ``panel_section_id``, so any
caller hitting ``GET /api/tool_panels/<view>`` with a custom view got
the whole tool registry's sections back instead of the requested view.
``test_panel_views::test_custom_label_order`` configures
``default_panel_view = "my-custom"`` whose definition is just
labels + tools, asserts the response has zero sections, and got back
the global ``test_section_multi`` and similar — because the override
walked every index entry without consulting the named view.
Remove the override entirely. The parent ``AbstractToolBox.to_panel_view``
calls ``tool_panel_contents(trans, view=view)`` which in turn invokes
the registered ``ToolPanelView.apply_view`` for the named view; that's
the correct behaviour for both ``default``, ``edam:*``, and the
``StaticToolPanelView`` instances built from ``panel_views`` /
``panel_views_dir``. With the prior commit that defers
``_load_tool_panel_views`` until after the index is populated, the
parent path renders correctly under LazyToolBox.
Local: ``test_panel_views::test_custom_label_order`` now PASSES.1 parent bce63eb commit 237d27c
1 file changed
Lines changed: 0 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
1541 | | - | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
1560 | | - | |
0 commit comments