1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Restrict movable panels to non-tab panels

Summary: Fixes T12248. Adds a flag for movable panels, and only allows those to be moved. Also cleaned up some CSS rules missing once a panel was drug into a new position.

Test Plan: Try to drag a tab panel content pane, cannot. Drag normal pane, see CSS, grab and drag same panel back, CSS looks the same.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12248

Differential Revision: https://secure.phabricator.com/D17356
This commit is contained in:
Chad Little 2017-02-14 14:08:56 -08:00
parent b28b2b8ab8
commit 37ac0ada17
5 changed files with 36 additions and 20 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array(
'conpherence.pkg.css' => 'a520d619',
'conpherence.pkg.js' => '6249a1cf',
'core.pkg.css' => '1179d101',
'core.pkg.css' => '0d7ecd3b',
'core.pkg.js' => '1fa7c0c5',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '4815647b',
@ -55,7 +55,7 @@ return array(
'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4',
'rsrc/css/application/countdown/timer.css' => '16c52f5c',
'rsrc/css/application/daemon/bulk-job.css' => 'df9c1d4a',
'rsrc/css/application/dashboard/dashboard.css' => '005e064e',
'rsrc/css/application/dashboard/dashboard.css' => '0921c307',
'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a',
'rsrc/css/application/differential/add-comment.css' => 'c47f8c40',
'rsrc/css/application/differential/changeset-view.css' => '6a9bdf9c',
@ -392,7 +392,7 @@ return array(
'rsrc/js/application/countdown/timer.js' => 'e4cc26b3',
'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => 'edf8a145',
'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e',
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '019f36c4',
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173',
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
@ -617,7 +617,7 @@ return array(
'javelin-behavior-countdown-timer' => 'e4cc26b3',
'javelin-behavior-dark-console' => 'f411b6ae',
'javelin-behavior-dashboard-async-panel' => '469c0d9e',
'javelin-behavior-dashboard-move-panels' => '019f36c4',
'javelin-behavior-dashboard-move-panels' => '408bf173',
'javelin-behavior-dashboard-query-panel-select' => '453c5375',
'javelin-behavior-dashboard-tab-panel' => 'd4eecc63',
'javelin-behavior-day-view' => '4b3c4443',
@ -786,7 +786,7 @@ return array(
'phabricator-content-source-view-css' => '4b8b05d4',
'phabricator-core-css' => '9f4cb463',
'phabricator-countdown-css' => '16c52f5c',
'phabricator-dashboard-css' => '005e064e',
'phabricator-dashboard-css' => '0921c307',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
'phabricator-fatal-config-template-css' => '8f18fa41',
@ -927,14 +927,6 @@ return array(
'javelin-request',
'javelin-typeahead-source',
),
'019f36c4' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-workflow',
'phabricator-draggable-list',
),
'01fca1f0' => array(
'javelin-behavior',
'javelin-workflow',
@ -1161,6 +1153,14 @@ return array(
'javelin-workflow',
'javelin-stratcom',
),
'408bf173' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-workflow',
'phabricator-draggable-list',
),
'40a6a403' => array(
'javelin-install',
'javelin-dom',

View file

@ -13,6 +13,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
private $parentPanelPHIDs;
private $headerMode = self::HEADER_MODE_NORMAL;
private $dashboardID;
private $movable = true;
public function setDashboardID($id) {
$this->dashboardID = $id;
@ -63,6 +64,15 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
return $this;
}
public function setMovable($movable) {
$this->movable = $movable;
return $this;
}
public function getMovable() {
return $this->movable;
}
public function getPanel() {
return $this->panel;
}
@ -221,8 +231,13 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
$box
->setHeader($header)
->setID($id)
->addClass('dashboard-box')
->addSigil('dashboard-panel');
if ($this->getMovable()) {
$box->addSigil('panel-movable');
}
if ($panel) {
$box->setMetadata(
array(

View file

@ -97,6 +97,7 @@ final class PhabricatorDashboardTabsPanelType
->setPanel($panel)
->setPanelPHID($panel->getPHID())
->setHeaderMode($no_headers)
->setMovable(false)
->renderPanel();
} else {
$panel_content = pht('(Invalid Panel)');

View file

@ -14,12 +14,12 @@
margin: 0 0 16px 0;
}
.dashboard-view .phui-header-shell {
.dashboard-box .phui-header-shell {
padding-top: 4px;
padding-bottom: 16px;
}
.dashboard-view .phui-header-header {
.dashboard-box .phui-header-header {
color: #000;
}
@ -49,16 +49,16 @@
width: 66.66%;
}
.grippable .aphront-multi-column-column .dashboard-pane .phui-object-box {
.grippable .aphront-multi-column-column .dashboard-box.phui-object-box {
cursor: move;
}
.grippable .aphront-multi-column-column .dashboard-pane .phui-object-box:hover {
.grippable .aphront-multi-column-column .dashboard-box.phui-object-box:hover {
box-shadow: {$dropshadow};
}
.grippable .aphront-multi-column-column .dashboard-pane .phui-object-box:hover
.phui-object-box {
.grippable .aphront-multi-column-column .dashboard-box.phui-object-box:hover
.dashboard-box {
box-shadow: none;
}

View file

@ -10,7 +10,7 @@
JX.behavior('dashboard-move-panels', function(config) {
var itemSigil = 'dashboard-panel';
var itemSigil = 'panel-movable';
function finditems(col) {
return JX.DOM.scry(col, 'div', itemSigil);