Generalize rules for "workflow" sigil

Summary:
See discussion in D6130. Basically, all of these should activate workflow:

  <a data-sigil="workflow" href="...">...</a>

  <div data-sigil="workflow">
    <a href="...">...</a>
  </div>

  <form data-sigil="workflow" action="...">...</form>

  <div data-sigil="workflow">
    <form action="...">...</form>
  </div>

The only case where we don't want to activate workflow is this one:

  <form data-sigil="workflow">
    <a href="...">...</a>
  </form>

Here, the form should workflow but the `<a />` should not.

These cases aren't really covered:

  // Undefined no matter where "workflow" is because it's nonsense.
  <a><a>...</a></a>

  // As above except like a million times more dumb.
  <form><form>...</form></form>

  // This one is ambiguous. The <a /> will currently workflow. We don't do
  // this anywhere and probably never will. If we want a different rule we
  // can cross that bridge when we come to it.
  <div data-sigil="workflow">
    <form action="...">
      <a href="...">...</a>
    </form>
  </div>

Test Plan: Clicked/submitted some things with workflow.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6131
This commit is contained in:
epriestley
2013-06-05 16:21:21 -07:00
parent 3029d72d5c
commit 94c29007b6
2 changed files with 56 additions and 46 deletions

View File

@@ -2335,7 +2335,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-workflow' =>
array(
'uri' => '/res/425777cc/rsrc/js/core/behavior-workflow.js',
'uri' => '/res/4a0595c1/rsrc/js/core/behavior-workflow.js',
'type' => 'js',
'requires' =>
array(
@@ -3705,7 +3705,7 @@ celerity_register_resource_map(array(
),
'phui-list-view-css' =>
array(
'uri' => '/res/0dc7b882/rsrc/css/phui/phui-list.css',
'uri' => '/res/77c3509f/rsrc/css/phui/phui-list.css',
'type' => 'css',
'requires' =>
array(
@@ -4063,7 +4063,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/21f9f13d/core.pkg.css',
'type' => 'css',
),
'98f60e3f' =>
'f2ad0683' =>
array(
'name' => 'core.pkg.js',
'symbols' =>
@@ -4106,7 +4106,7 @@ celerity_register_resource_map(array(
35 => 'phabricator-hovercard',
36 => 'javelin-behavior-phabricator-hovercards',
),
'uri' => '/res/pkg/98f60e3f/core.pkg.js',
'uri' => '/res/pkg/f2ad0683/core.pkg.js',
'type' => 'js',
),
'4ccfeb47' =>
@@ -4279,17 +4279,17 @@ celerity_register_resource_map(array(
'diffusion-icons-css' => 'c8ce2d88',
'global-drag-and-drop-css' => '21f9f13d',
'inline-comment-summary-css' => 'dd27a69b',
'javelin-aphlict' => '98f60e3f',
'javelin-aphlict' => 'f2ad0683',
'javelin-behavior' => 'a9f14d76',
'javelin-behavior-aphlict-dropdown' => '98f60e3f',
'javelin-behavior-aphlict-listen' => '98f60e3f',
'javelin-behavior-aphront-basic-tokenizer' => '98f60e3f',
'javelin-behavior-aphlict-dropdown' => 'f2ad0683',
'javelin-behavior-aphlict-listen' => 'f2ad0683',
'javelin-behavior-aphront-basic-tokenizer' => 'f2ad0683',
'javelin-behavior-aphront-drag-and-drop' => '9488bb69',
'javelin-behavior-aphront-drag-and-drop-textarea' => '9488bb69',
'javelin-behavior-aphront-form-disable-on-submit' => '98f60e3f',
'javelin-behavior-aphront-form-disable-on-submit' => 'f2ad0683',
'javelin-behavior-audit-preview' => '96909266',
'javelin-behavior-dark-console' => '4ccfeb47',
'javelin-behavior-device' => '98f60e3f',
'javelin-behavior-device' => 'f2ad0683',
'javelin-behavior-differential-accept-with-errors' => '9488bb69',
'javelin-behavior-differential-add-reviewers-and-ccs' => '9488bb69',
'javelin-behavior-differential-comment-jump' => '9488bb69',
@@ -4305,33 +4305,33 @@ celerity_register_resource_map(array(
'javelin-behavior-diffusion-commit-graph' => '96909266',
'javelin-behavior-diffusion-pull-lastmodified' => '96909266',
'javelin-behavior-error-log' => '4ccfeb47',
'javelin-behavior-global-drag-and-drop' => '98f60e3f',
'javelin-behavior-history-install' => '98f60e3f',
'javelin-behavior-konami' => '98f60e3f',
'javelin-behavior-lightbox-attachments' => '98f60e3f',
'javelin-behavior-global-drag-and-drop' => 'f2ad0683',
'javelin-behavior-history-install' => 'f2ad0683',
'javelin-behavior-konami' => 'f2ad0683',
'javelin-behavior-lightbox-attachments' => 'f2ad0683',
'javelin-behavior-load-blame' => '9488bb69',
'javelin-behavior-maniphest-batch-selector' => 'c0c9bc0b',
'javelin-behavior-maniphest-subpriority-editor' => 'c0c9bc0b',
'javelin-behavior-maniphest-transaction-controls' => 'c0c9bc0b',
'javelin-behavior-maniphest-transaction-expand' => 'c0c9bc0b',
'javelin-behavior-maniphest-transaction-preview' => 'c0c9bc0b',
'javelin-behavior-phabricator-active-nav' => '98f60e3f',
'javelin-behavior-phabricator-autofocus' => '98f60e3f',
'javelin-behavior-phabricator-gesture' => '98f60e3f',
'javelin-behavior-phabricator-hovercards' => '98f60e3f',
'javelin-behavior-phabricator-keyboard-shortcuts' => '98f60e3f',
'javelin-behavior-phabricator-nav' => '98f60e3f',
'javelin-behavior-phabricator-active-nav' => 'f2ad0683',
'javelin-behavior-phabricator-autofocus' => 'f2ad0683',
'javelin-behavior-phabricator-gesture' => 'f2ad0683',
'javelin-behavior-phabricator-hovercards' => 'f2ad0683',
'javelin-behavior-phabricator-keyboard-shortcuts' => 'f2ad0683',
'javelin-behavior-phabricator-nav' => 'f2ad0683',
'javelin-behavior-phabricator-object-selector' => '9488bb69',
'javelin-behavior-phabricator-oncopy' => '98f60e3f',
'javelin-behavior-phabricator-remarkup-assist' => '98f60e3f',
'javelin-behavior-phabricator-reveal-content' => '98f60e3f',
'javelin-behavior-phabricator-search-typeahead' => '98f60e3f',
'javelin-behavior-phabricator-tooltips' => '98f60e3f',
'javelin-behavior-phabricator-watch-anchor' => '98f60e3f',
'javelin-behavior-refresh-csrf' => '98f60e3f',
'javelin-behavior-phabricator-oncopy' => 'f2ad0683',
'javelin-behavior-phabricator-remarkup-assist' => 'f2ad0683',
'javelin-behavior-phabricator-reveal-content' => 'f2ad0683',
'javelin-behavior-phabricator-search-typeahead' => 'f2ad0683',
'javelin-behavior-phabricator-tooltips' => 'f2ad0683',
'javelin-behavior-phabricator-watch-anchor' => 'f2ad0683',
'javelin-behavior-refresh-csrf' => 'f2ad0683',
'javelin-behavior-repository-crossreference' => '9488bb69',
'javelin-behavior-toggle-class' => '98f60e3f',
'javelin-behavior-workflow' => '98f60e3f',
'javelin-behavior-toggle-class' => 'f2ad0683',
'javelin-behavior-workflow' => 'f2ad0683',
'javelin-dom' => 'a9f14d76',
'javelin-event' => 'a9f14d76',
'javelin-history' => 'a9f14d76',
@@ -4356,32 +4356,32 @@ celerity_register_resource_map(array(
'maniphest-transaction-detail-css' => '03ab92cf',
'phabricator-action-list-view-css' => '21f9f13d',
'phabricator-application-launch-view-css' => '21f9f13d',
'phabricator-busy' => '98f60e3f',
'phabricator-busy' => 'f2ad0683',
'phabricator-content-source-view-css' => 'dd27a69b',
'phabricator-core-buttons-css' => '21f9f13d',
'phabricator-core-css' => '21f9f13d',
'phabricator-crumbs-view-css' => '21f9f13d',
'phabricator-drag-and-drop-file-upload' => '9488bb69',
'phabricator-dropdown-menu' => '98f60e3f',
'phabricator-file-upload' => '98f60e3f',
'phabricator-dropdown-menu' => 'f2ad0683',
'phabricator-file-upload' => 'f2ad0683',
'phabricator-filetree-view-css' => '21f9f13d',
'phabricator-flag-css' => '21f9f13d',
'phabricator-form-view-css' => '21f9f13d',
'phabricator-header-view-css' => '21f9f13d',
'phabricator-hovercard' => '98f60e3f',
'phabricator-hovercard' => 'f2ad0683',
'phabricator-jump-nav' => '21f9f13d',
'phabricator-keyboard-shortcut' => '98f60e3f',
'phabricator-keyboard-shortcut-manager' => '98f60e3f',
'phabricator-keyboard-shortcut' => 'f2ad0683',
'phabricator-keyboard-shortcut-manager' => 'f2ad0683',
'phabricator-main-menu-view' => '21f9f13d',
'phabricator-menu-item' => '98f60e3f',
'phabricator-menu-item' => 'f2ad0683',
'phabricator-nav-view-css' => '21f9f13d',
'phabricator-notification' => '98f60e3f',
'phabricator-notification' => 'f2ad0683',
'phabricator-notification-css' => '21f9f13d',
'phabricator-notification-menu-css' => '21f9f13d',
'phabricator-object-item-list-view-css' => '21f9f13d',
'phabricator-object-selector-css' => 'dd27a69b',
'phabricator-phtize' => '98f60e3f',
'phabricator-prefab' => '98f60e3f',
'phabricator-phtize' => 'f2ad0683',
'phabricator-prefab' => 'f2ad0683',
'phabricator-project-tag-css' => '03ab92cf',
'phabricator-property-list-view-css' => '21f9f13d',
'phabricator-remarkup-css' => '21f9f13d',
@@ -4389,8 +4389,8 @@ celerity_register_resource_map(array(
'phabricator-side-menu-view-css' => '21f9f13d',
'phabricator-standard-page-view' => '21f9f13d',
'phabricator-tag-view-css' => '21f9f13d',
'phabricator-textareautils' => '98f60e3f',
'phabricator-tooltip' => '98f60e3f',
'phabricator-textareautils' => 'f2ad0683',
'phabricator-tooltip' => 'f2ad0683',
'phabricator-transaction-view-css' => '21f9f13d',
'phabricator-zindex-css' => '21f9f13d',
'phui-form-css' => '21f9f13d',