Page MenuHomePhabricator

D17446.diff
No OneTemporary

D17446.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -441,8 +441,8 @@
'rsrc/js/application/projects/WorkboardBoard.js' => '8935deef',
'rsrc/js/application/projects/WorkboardCard.js' => 'c587b80f',
'rsrc/js/application/projects/WorkboardColumn.js' => '21df4ff5',
- 'rsrc/js/application/projects/WorkboardController.js' => '55baf5ed',
- 'rsrc/js/application/projects/behavior-project-boards.js' => '93ae974f',
+ 'rsrc/js/application/projects/WorkboardController.js' => '26167537',
+ 'rsrc/js/application/projects/behavior-project-boards.js' => '4250a34e',
'rsrc/js/application/projects/behavior-project-create.js' => '065227cc',
'rsrc/js/application/projects/behavior-reorder-columns.js' => 'e1d25dfb',
'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf',
@@ -693,7 +693,7 @@
'javelin-behavior-phui-tab-group' => '0a0b10e9',
'javelin-behavior-policy-control' => 'd0c516d5',
'javelin-behavior-policy-rule-editor' => '5e9f347c',
- 'javelin-behavior-project-boards' => '93ae974f',
+ 'javelin-behavior-project-boards' => '4250a34e',
'javelin-behavior-project-create' => '065227cc',
'javelin-behavior-quicksand-blacklist' => '7927a7d3',
'javelin-behavior-read-only-warning' => 'ba158207',
@@ -767,7 +767,7 @@
'javelin-workboard-board' => '8935deef',
'javelin-workboard-card' => 'c587b80f',
'javelin-workboard-column' => '21df4ff5',
- 'javelin-workboard-controller' => '55baf5ed',
+ 'javelin-workboard-controller' => '26167537',
'javelin-workflow' => '1e911d0f',
'maniphest-batch-editor' => 'b0f0b6d5',
'maniphest-report-css' => '9b9580b7',
@@ -1089,6 +1089,16 @@
'javelin-workflow',
'javelin-util',
),
+ 26167537 => array(
+ 'javelin-install',
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-vector',
+ 'javelin-stratcom',
+ 'javelin-workflow',
+ 'phabricator-drag-and-drop-file-upload',
+ 'javelin-workboard-board',
+ ),
'2926fff2' => array(
'javelin-behavior',
'javelin-dom',
@@ -1174,6 +1184,15 @@
'javelin-dom',
'javelin-request',
),
+ '4250a34e' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-vector',
+ 'javelin-stratcom',
+ 'javelin-workflow',
+ 'javelin-workboard-controller',
+ ),
'44959b73' => array(
'javelin-util',
'javelin-uri',
@@ -1307,16 +1326,6 @@
'javelin-vector',
'javelin-dom',
),
- '55baf5ed' => array(
- 'javelin-install',
- 'javelin-dom',
- 'javelin-util',
- 'javelin-vector',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'phabricator-drag-and-drop-file-upload',
- 'javelin-workboard-board',
- ),
'58dea2fa' => array(
'javelin-install',
'javelin-util',
@@ -1629,15 +1638,6 @@
'javelin-stratcom',
'javelin-dom',
),
- '93ae974f' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-util',
- 'javelin-vector',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'javelin-workboard-controller',
- ),
'93d0c9e3' => array(
'javelin-behavior',
'javelin-stratcom',
diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
--- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php
+++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
@@ -372,7 +372,6 @@
$behavior_config = array(
'moveURI' => $this->getApplicationURI('move/'.$project->getID().'/'),
- 'createURI' => $this->getCreateURI(),
'uploadURI' => '/file/dropupload/',
'coverURI' => $this->getApplicationURI('cover/'),
'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(),
@@ -800,17 +799,30 @@
$default_phid = $column->getProjectPHID();
}
- $column_items[] = id(new PhabricatorActionView())
- ->setIcon('fa-plus')
- ->setName(pht('Create Task...'))
- ->setHref($this->getCreateURI())
- ->addSigil('column-add-task')
- ->setMetadata(
- array(
- 'columnPHID' => $column->getPHID(),
- 'boardPHID' => $project->getPHID(),
- 'projectPHID' => $default_phid,
- ));
+ $specs = id(new ManiphestEditEngine())
+ ->setViewer($viewer)
+ ->newCreateActionSpecifications(array());
+
+ foreach ($specs as $spec) {
+ $column_items[] = id(new PhabricatorActionView())
+ ->setIcon($spec['icon'])
+ ->setName($spec['name'])
+ ->setHref($spec['uri'])
+ ->setDisabled($spec['disabled'])
+ ->addSigil('column-add-task')
+ ->setMetadata(
+ array(
+ 'createURI' => $spec['uri'],
+ 'columnPHID' => $column->getPHID(),
+ 'boardPHID' => $project->getPHID(),
+ 'projectPHID' => $default_phid,
+ ));
+ }
+
+ if (count($specs) > 1) {
+ $column_items[] = id(new PhabricatorActionView())
+ ->setType(PhabricatorActionView::TYPE_DIVIDER);
+ }
$batch_edit_uri = $request->getRequestURI();
$batch_edit_uri->setQueryParam('batch', $column->getID());
@@ -903,25 +915,6 @@
return $base;
}
- private function getCreateURI() {
- $viewer = $this->getViewer();
-
- // TODO: This should be cleaned up, but maybe we're going to make options
- // for each column or board?
- $edit_config = id(new ManiphestEditEngine())
- ->setViewer($viewer)
- ->loadDefaultEditConfiguration(new ManiphestTask());
- if ($edit_config) {
- $form_key = $edit_config->getIdentifier();
- $create_uri = "/maniphest/task/edit/form/{$form_key}/";
- } else {
- $create_uri = '/maniphest/task/edit/';
- }
-
- return $create_uri;
- }
-
-
private function buildInitializeContent(PhabricatorProject $project) {
$request = $this->getRequest();
$viewer = $this->getViewer();
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -1483,7 +1483,7 @@
* Build a raw description of available "Create New Object" UI options so
* other methods can build menus or buttons.
*/
- private function newCreateActionSpecifications(array $parameters) {
+ public function newCreateActionSpecifications(array $parameters) {
$viewer = $this->getViewer();
$can_create = $this->hasCreateCapability();
diff --git a/webroot/rsrc/js/application/projects/WorkboardController.js b/webroot/rsrc/js/application/projects/WorkboardController.js
--- a/webroot/rsrc/js/application/projects/WorkboardController.js
+++ b/webroot/rsrc/js/application/projects/WorkboardController.js
@@ -21,7 +21,6 @@
uploadURI: null,
coverURI: null,
moveURI: null,
- createURI: null,
chunkThreshold: null
},
@@ -170,7 +169,7 @@
order: board.getOrder()
};
- new JX.Workflow(this.getCreateURI(), request_data)
+ new JX.Workflow(column_data.createURI, request_data)
.setHandler(JX.bind(board, board.updateCard))
.start();
},
diff --git a/webroot/rsrc/js/application/projects/behavior-project-boards.js b/webroot/rsrc/js/application/projects/behavior-project-boards.js
--- a/webroot/rsrc/js/application/projects/behavior-project-boards.js
+++ b/webroot/rsrc/js/application/projects/behavior-project-boards.js
@@ -16,7 +16,6 @@
statics.projectPHID = update_config.projectPHID;
statics.order = update_config.order;
statics.moveURI = update_config.moveURI;
- statics.createURI = update_config.createURI;
}
function setup() {
@@ -71,7 +70,6 @@
.setUploadURI(config.uploadURI)
.setCoverURI(config.coverURI)
.setMoveURI(config.moveURI)
- .setCreateURI(config.createURI)
.setChunkThreshold(config.chunkThreshold)
.start();
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 2:23 PM (21 h, 53 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6786102
Default Alt Text
D17446.diff (8 KB)

Event Timeline