From b73622b86672b12baf5cb00a3673a6717c4f6d7e Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 11 Jan 2013 11:58:31 -0800 Subject: [PATCH] Make "Create Document" in Phriction use workflow Summary: My claims that this worked on D4183 were incorrect: - Make it work. - Then use it. - Also make cancel URI not cancel to the same page. Test Plan: Clicked "Create Document", got a workflow on-page dialog instead of a page transition. Reviewers: codeblock Reviewed By: codeblock CC: aran Differential Revision: https://secure.phabricator.com/D4403 --- src/applications/phriction/controller/PhrictionController.php | 1 + .../phriction/controller/PhrictionNewController.php | 2 +- src/view/layout/PhabricatorCrumbsView.php | 3 ++- src/view/layout/PhabricatorMenuItemView.php | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/applications/phriction/controller/PhrictionController.php b/src/applications/phriction/controller/PhrictionController.php index 1f3fb689b6..0b7fa32ede 100644 --- a/src/applications/phriction/controller/PhrictionController.php +++ b/src/applications/phriction/controller/PhrictionController.php @@ -53,6 +53,7 @@ abstract class PhrictionController extends PhabricatorController { id(new PhabricatorMenuItemView()) ->setName(pht('Create Document')) ->setHref('/phriction/new/') + ->setWorkflow(true) ->setIcon('create')); return $crumbs; diff --git a/src/applications/phriction/controller/PhrictionNewController.php b/src/applications/phriction/controller/PhrictionNewController.php index 90873e423c..4466600edc 100644 --- a/src/applications/phriction/controller/PhrictionNewController.php +++ b/src/applications/phriction/controller/PhrictionNewController.php @@ -30,7 +30,7 @@ final class PhrictionNewController extends PhrictionController { pht('Create a new document at'))) ->appendChild($view) ->addSubmitButton(pht('Create')) - ->addCancelButton($request->getRequestURI()); + ->addCancelButton('/w/'); return id(new AphrontDialogResponse())->setDialog($dialog); } diff --git a/src/view/layout/PhabricatorCrumbsView.php b/src/view/layout/PhabricatorCrumbsView.php index 347aa6420c..0f82ac33d7 100644 --- a/src/view/layout/PhabricatorCrumbsView.php +++ b/src/view/layout/PhabricatorCrumbsView.php @@ -37,11 +37,12 @@ final class PhabricatorCrumbsView extends AphrontView { ), ''); } - $actions[] = phutil_render_tag( + $actions[] = javelin_render_tag( 'a', array( 'href' => $action->getHref(), 'class' => 'phabricator-crumbs-action', + 'sigil' => $action->getWorkflow() ? 'workflow' : null, ), $icon.phutil_escape_html($action->getName())); } diff --git a/src/view/layout/PhabricatorMenuItemView.php b/src/view/layout/PhabricatorMenuItemView.php index d53079e904..14620bea04 100644 --- a/src/view/layout/PhabricatorMenuItemView.php +++ b/src/view/layout/PhabricatorMenuItemView.php @@ -90,6 +90,10 @@ final class PhabricatorMenuItemView extends AphrontView { return $this; } + public function getWorkflow() { + return $this->workflow; + } + public function setSortOrder($order) { $this->sortOrder = $order; return $this;