mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Fix an issue where editing a dashboard panel from a dashboard could duplicate the panel
Summary: Depends on D20472. Ref T13272. Currently, when you edit a panel from a dashboard, we try to add the panel to the dashboard. This always works since dashboards no longer enforce panel uniqueness, and you can end up with duplicate panels. Instead, only add panels if we're creating them. Test Plan: - Edited an existing panel, no duplication. - Created a new panel, saw it added to the dashboard. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13272 Differential Revision: https://secure.phabricator.com/D20473
This commit is contained in:
parent
5462a52b8a
commit
dfbc4c1cd3
1 changed files with 6 additions and 0 deletions
|
@ -134,6 +134,12 @@ final class PhabricatorDashboardPanelEditEngine
|
|||
$context = $this->getContextObject();
|
||||
|
||||
if ($context instanceof PhabricatorDashboard) {
|
||||
// Only add the panel to the dashboard when we're creating a new panel,
|
||||
// not if we're editing an existing panel.
|
||||
if (!$this->getIsCreate()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
$controller = $this->getController();
|
||||
$request = $controller->getRequest();
|
||||
|
|
Loading…
Reference in a new issue