Herald JS basics.

This commit is contained in:
epriestley
2011-03-22 17:08:08 -07:00
parent 9c5e7bb71d
commit b060f0a80f
7 changed files with 598 additions and 28 deletions

View File

@@ -81,7 +81,7 @@ celerity_register_resource_map(array(
),
'aphront-side-nav-view-css' =>
array(
'uri' => '/res/09b7eb85/rsrc/css/aphront/side-nav-view.css',
'uri' => '/res/4f4c5ca8/rsrc/css/aphront/side-nav-view.css',
'type' => 'css',
'requires' =>
array(
@@ -199,7 +199,7 @@ celerity_register_resource_map(array(
),
'diffusion-commit-view-css' =>
array(
'uri' => '/res/4593ecc8/rsrc/css/application/diffusion/commit-view.css',
'uri' => '/res/8c139192/rsrc/css/application/diffusion/commit-view.css',
'type' => 'css',
'requires' =>
array(
@@ -336,6 +336,16 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/application/core/behavior-workflow.js',
),
'multirow-row-manager' =>
array(
'uri' => '/res/330d076b/rsrc/js/application/core/MultirowRowManager.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-lib-dev',
),
'disk' => '/rsrc/js/application/core/MultirowRowManager.js',
),
'javelin-behavior-differential-add-reviewers' =>
array(
'uri' => '/res/330154e4/rsrc/js/application/differential/behavior-add-reviewers.js',
@@ -406,6 +416,26 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/application/differential/behavior-show-more.js',
),
'javelin-behavior-herald-rule-editor' =>
array(
'uri' => '/res/f18bcd5e/rsrc/js/application/herald/herald-rule-editor.js',
'type' => 'js',
'requires' =>
array(
0 => 'herald-rule-editor',
),
'disk' => '/rsrc/js/application/herald/herald-rule-editor.js',
),
'herald-rule-editor' =>
array(
'uri' => '/res/e71d1d0e/rsrc/js/application/herald/HeraldRuleEditor.js',
'type' => 'js',
'requires' =>
array(
0 => 'multirow-row-manager',
),
'disk' => '/rsrc/js/application/herald/HeraldRuleEditor.js',
),
'javelin-behavior-maniphest-transaction-controls' =>
array(
'uri' => '/res/fc6a8722/rsrc/js/application/maniphest/behavior-transaction-controls.js',
@@ -491,7 +521,7 @@ celerity_register_resource_map(array(
), array (
'packages' =>
array (
73063447 =>
'848f4c9f' =>
array (
'name' => 'core.pkg.css',
'symbols' =>
@@ -511,7 +541,7 @@ celerity_register_resource_map(array(
12 => 'phabricator-remarkup-css',
13 => 'syntax-highlighting-css',
),
'uri' => '/res/pkg/73063447/core.pkg.css',
'uri' => '/res/pkg/848f4c9f/core.pkg.css',
'type' => 'css',
),
'76f3c1f8' =>
@@ -545,33 +575,33 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/30d594cf/differential.pkg.js',
'type' => 'js',
),
'2393c3a4' =>
'eadf6ec3' =>
array (
'name' => 'diffusion.pkg.css',
'symbols' =>
array (
0 => 'diffusion-commit-view-css',
),
'uri' => '/res/pkg/2393c3a4/diffusion.pkg.css',
'uri' => '/res/pkg/eadf6ec3/diffusion.pkg.css',
'type' => 'css',
),
),
'reverse' =>
array (
'phabricator-core-css' => '73063447',
'phabricator-core-buttons-css' => '73063447',
'phabricator-standard-page-view' => '73063447',
'aphront-dialog-view-css' => '73063447',
'aphront-form-view-css' => '73063447',
'aphront-panel-view-css' => '73063447',
'aphront-side-nav-view-css' => '73063447',
'aphront-table-view-css' => '73063447',
'aphront-crumbs-view-css' => '73063447',
'aphront-tokenizer-control-css' => '73063447',
'aphront-typeahead-control-css' => '73063447',
'phabricator-directory-css' => '73063447',
'phabricator-remarkup-css' => '73063447',
'syntax-highlighting-css' => '73063447',
'phabricator-core-css' => '848f4c9f',
'phabricator-core-buttons-css' => '848f4c9f',
'phabricator-standard-page-view' => '848f4c9f',
'aphront-dialog-view-css' => '848f4c9f',
'aphront-form-view-css' => '848f4c9f',
'aphront-panel-view-css' => '848f4c9f',
'aphront-side-nav-view-css' => '848f4c9f',
'aphront-table-view-css' => '848f4c9f',
'aphront-crumbs-view-css' => '848f4c9f',
'aphront-tokenizer-control-css' => '848f4c9f',
'aphront-typeahead-control-css' => '848f4c9f',
'phabricator-directory-css' => '848f4c9f',
'phabricator-remarkup-css' => '848f4c9f',
'syntax-highlighting-css' => '848f4c9f',
'differential-core-view-css' => '76f3c1f8',
'differential-changeset-view-css' => '76f3c1f8',
'differential-revision-detail-css' => '76f3c1f8',
@@ -585,6 +615,6 @@ celerity_register_resource_map(array(
'javelin-behavior-differential-populate' => '30d594cf',
'javelin-behavior-differential-show-more' => '30d594cf',
'javelin-behavior-differential-diff-radios' => '30d594cf',
'diffusion-commit-view-css' => '2393c3a4',
'diffusion-commit-view-css' => 'eadf6ec3',
),
));

View File

@@ -251,6 +251,7 @@ class HeraldRuleController extends HeraldController {
$form = id(new AphrontFormView())
->setUser($user)
->setID('herald-rule-edit-form')
->addHiddenInput('type', $rule->getContentType())
->addHiddenInput('save', true)
->addHiddenInput('rule', '')
@@ -270,16 +271,33 @@ class HeraldRuleController extends HeraldController {
->appendChild(
'<h1>Conditions</h1>'.
'<div style="margin: .5em 0 1em; padding: .5em; background: #aaa;">'.
'<a href="#" class="button green">Create New Condition</a>'.
javelin_render_tag(
'a',
array(
'href' => '#',
'class' => 'button green',
'sigil' => 'create-action',
),
'Create New Condition').
'<p>When '.$must_match.' these conditions are met:</p>'.
'<table></table>'.
javelin_render_tag(
'table',
array(
'sigil' => 'rule-conditions',
),
'').
'</div>')
->appendChild(
'<h1>Action</h1>'.
'<div style="margin: .5em 0 1em; padding: .5em; background: #aaa;">'.
'<a href="#" class="button green">Create New Action</a>'.
'<p>Take these actions:</p>'.
'<table></table>'.
javelin_render_tag(
'table',
array(
'sigil' => 'rule-actions',
),
'').
'</div>')
->appendChild(
id(new AphrontFormSubmitControl())
@@ -439,11 +457,10 @@ class HeraldRuleController extends HeraldController {
HeraldValueTypeConfig::getValueTypeForAction($action);
}
/*
Javelin::initBehavior(
'herald-rule-editor',
array(
'root' => 'qq',//$form->requireUniqueId(),
'root' => 'herald-rule-edit-form',
'conditions' => (object) $serial_conditions,
'actions' => (object) $serial_actions,
'template' => $this->buildTokenizerTemplates() + array(
@@ -452,8 +469,6 @@ class HeraldRuleController extends HeraldController {
'info' => $config_info,
));
*/
$panel = new AphrontPanelView();
$panel->setHeader('Edit Herald Rule');
$panel->setWidth(AphrontPanelView::WIDTH_WIDE);

View File

@@ -25,6 +25,12 @@ final class AphrontFormView extends AphrontView {
private $encType;
private $user;
private $workflow;
private $id;
public function setID($id) {
$this->id = $id;
return $this;
}
public function setUser(PhabricatorUser $user) {
$this->user = $user;
@@ -66,6 +72,7 @@ final class AphrontFormView extends AphrontView {
'class' => 'aphront-form-view',
'enctype' => $this->encType,
'sigil' => $this->workflow ? 'workflow' : null,
'id' => $this->id,
),
$this->renderDataInputs().
$this->renderChildren());