1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 17:28:51 +02:00
phorge-phorge/webroot/rsrc/js/application/maniphest/behavior-project-create.js
epriestley eab768f705 Allow projects to be quickly added from the Maniphest task creation interface
Summary:
Provide a quick workflow for adding a new project. This ended up being sort of
complicated because we don't currently put forms in dialogs. I separated the
actual <form /> tag out of the display/layout of AphrontFormView to enable this
(the dialog is itself a form).

Limitations: if you create a new project and then remove it, it won't appear in
the tokenizer until you reload the page. We need to add the ability for the
datasource to drop its cache to enable this, which is super complicated.

Test Plan:
Used "Create new project" to add a new project when creating a task.

Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: anjali, aran, epriestley
Differential Revision: 422
2011-06-13 10:17:08 -07:00

26 lines
608 B
JavaScript

/**
* @provides javelin-behavior-maniphest-project-create
* @requires javelin-behavior
* javelin-dom
* javelin-stratcom
* javelin-workflow
*/
JX.behavior('maniphest-project-create', function(config) {
JX.Stratcom.listen(
'click',
'project-create',
function(e) {
JX.Workflow.newFromLink(e.getTarget())
.setHandler(function(r) {
var node = JX.$(config.tokenizerID);
var tokenizer = JX.Stratcom.getData(node).tokenizer;
tokenizer.addToken(r.phid, r.name);
})
.start();
e.kill();
});
});