Page MenuHomePhorge

Dashboard Tabs: "Move" actions works but sometime are grayed out
Closed, ResolvedPublic

Description

In some cases the Move action on a Tabs Panels works, but the graphical interface shows that action as disabled.

Steps to reproduce:

  • From user A:
    • Create two panels - editable by: User A
  • From user B:
    • Create a "Tabs Panel" in a Dashboard
    • Attach the panels from User A (so, editable by, not you)

Then, from User B, see the Move actions that are grayed out:

Second Panel menu.png (339ร—778 px, 29 KB)

But the Move actions actually works :) and that is OK.


I can reproduce this problem on this Dashboard where I attached some panels that are not mine, and the Move actions are disabled, but they work as expected:

https://phab.wmflabs.org/dashboard/view/12/

NOTE: the Dashboard is mine, the first panel is mine, the other panel is not mine and not editable by me. Maybe that is the problem.

In short, the Tabs should be movable only if you can:

  • Edit the parent Tabs Panel

But at the moment, these actions are disabled from the frontend also if you cannot edit the Sub-Panel themselves. But this is misleading, since you are not touching the Sub-Panel(s) at all, you are just showing many of them in a different order decided by you, that you created a parent Tabs Panel.

So the error is probably here:

PhabricatorDashboardTabsPanelType.php
$dropdown_menu->addAction(
  id(new PhabricatorActionView())
    ->setName(pht('Move Tab Left'))
    ->setIcon('fa-chevron-left')
    ->setHref($prev_uri)
    ->setWorkflow(true)
    ->setDisabled(($prev_key === null) || !$can_edit));

$dropdown_menu->addAction(
  id(new PhabricatorActionView())
    ->setName(pht('Move Tab Right'))
    ->setIcon('fa-chevron-right')
    ->setHref($next_uri)
    ->setWorkflow(true)
    ->setDisabled(($next_key === null) || !$can_edit));

So maybe the issue is just about removing the || !$can_edit, since that is an additional check not really intended, and also not consistent with the backend.

In short:

If you can Edit the Tabs Panel, of course you should also be able to Move things in it.

Event Timeline

valerio.bozzolan triaged this task as Low priority.
valerio.bozzolan created this object in space S1 Public.
valerio.bozzolan renamed this task from Dashboard Tabs: bug in "Move" actions to Dashboard Tabs: bug in "Move" actions when you cannot edit the panel.Jun 23 2023, 10:23
valerio.bozzolan updated the task description. (Show Details)
valerio.bozzolan renamed this task from Dashboard Tabs: bug in "Move" actions when you cannot edit the panel to Dashboard Tabs: "Move" actions works but sometime are grayed out.Jun 23 2023, 10:52
valerio.bozzolan claimed this task.
valerio.bozzolan updated the task description. (Show Details)
valerio.bozzolan added projects: UX, Bug Reports.