Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13972632
D9499.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D9499.id.diff
View Options
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
@@ -121,6 +121,7 @@
$form = id(new AphrontFormView())
->setUser($viewer)
+ ->addHiddenInput('dashboardID', $request->getInt('dashboardID'))
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Name'))
@@ -142,12 +143,6 @@
$field_list->appendFieldsToForm($form);
- $form
- ->appendChild(
- id(new AphrontFormSubmitControl())
- ->setValue($button)
- ->addCancelButton($cancel_uri));
-
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(
pht('Panels'),
@@ -162,6 +157,22 @@
$crumbs->addTextCrumb(pht('Edit'));
}
+ if ($request->isAjax()) {
+ return $this->newDialog()
+ ->setTitle($header)
+ ->setWidth(AphrontDialogView::WIDTH_FORM)
+ ->setValidationException($validation_exception)
+ ->appendChild($form->buildLayoutView())
+ ->addCancelButton($cancel_uri)
+ ->addSubmitButton($button);
+ } else {
+ $form
+ ->appendChild(
+ id(new AphrontFormSubmitControl())
+ ->setValue($button)
+ ->addCancelButton($cancel_uri));
+ }
+
$box = id(new PHUIObjectBoxView())
->setHeaderText($header)
->setValidationException($validation_exception)
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
--- a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
+++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
@@ -236,6 +236,7 @@
}
$action_edit = id(new PHUIIconView())
->setIconFont('fa-pencil')
+ ->setWorkflow(true)
->setHref((string) $edit_uri);
$header->addAction($action_edit);
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
--- a/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
+++ b/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
@@ -40,6 +40,7 @@
} else {
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NORMAL;
}
+
foreach ($panel_grid_locations as $column => $panel_column_locations) {
$panel_phids = $panel_column_locations;
$column_panels = array_select_keys($panels, $panel_phids);
diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php
--- a/src/view/AphrontDialogView.php
+++ b/src/view/AphrontDialogView.php
@@ -19,8 +19,10 @@
private $disableWorkflowOnSubmit;
private $disableWorkflowOnCancel;
private $width = 'default';
- private $errors;
+ private $errors = array();
private $flush;
+ private $validationException;
+
const WIDTH_DEFAULT = 'default';
const WIDTH_FORM = 'form';
@@ -162,6 +164,12 @@
return $this->disableWorkflowOnCancel;
}
+ public function setValidationException(
+ PhabricatorApplicationTransactionValidationException $ex = null) {
+ $this->validationException = $ex;
+ return $this;
+ }
+
final public function render() {
require_celerity_resource('aphront-dialog-view-css');
@@ -267,9 +275,19 @@
$children = $this->renderChildren();
- if ($this->errors) {
+ $errors = $this->errors;
+
+ $ex = $this->validationException;
+ $exception_errors = null;
+ if ($ex) {
+ foreach ($ex->getErrors() as $error) {
+ $errors[] = $error->getMessage();
+ }
+ }
+
+ if ($errors) {
$children = array(
- id(new AphrontErrorView())->setErrors($this->errors),
+ id(new AphrontErrorView())->setErrors($errors),
$children);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 18, 8:11 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6710895
Default Alt Text
D9499.id.diff (4 KB)
Attached To
Mode
D9499: Edit dashboard panels in a dialog instead of on a separate page
Attached
Detach File
Event Timeline
Log In to Comment