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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user