1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00

Give IconSetControl a meaningful disabled state

Summary: Ref T10004. This control doesn't disable visually or behaviorally, e.g. when locked in an EditEngine configuration.

Test Plan:
  - Locked field for Projects.
  - Reviewed form in EditEngine.
  - Created/edited a project.
  - Swapped default.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14911
This commit is contained in:
epriestley 2015-12-30 03:24:19 -08:00
parent 5ea5b0c41c
commit 972788b8b5
4 changed files with 28 additions and 12 deletions

View file

@ -465,7 +465,7 @@ return array(
'rsrc/js/core/behavior-active-nav.js' => 'e379b58e',
'rsrc/js/core/behavior-audio-source.js' => '59b251eb',
'rsrc/js/core/behavior-autofocus.js' => '7319e029',
'rsrc/js/core/behavior-choose-control.js' => 'dfaafb14',
'rsrc/js/core/behavior-choose-control.js' => '8fee767e',
'rsrc/js/core/behavior-crop.js' => 'fa0f4fc2',
'rsrc/js/core/behavior-dark-console.js' => 'f411b6ae',
'rsrc/js/core/behavior-device.js' => 'a205cf28',
@ -571,7 +571,7 @@ return array(
'javelin-behavior-audio-source' => '59b251eb',
'javelin-behavior-audit-preview' => 'd835b03a',
'javelin-behavior-bulk-job-reload' => 'edf8a145',
'javelin-behavior-choose-control' => 'dfaafb14',
'javelin-behavior-choose-control' => '8fee767e',
'javelin-behavior-comment-actions' => 'b65559c0',
'javelin-behavior-config-reorder-fields' => 'b6993408',
'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a',
@ -1517,6 +1517,12 @@ return array(
'javelin-install',
'javelin-dom',
),
'8fee767e' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-workflow',
),
'9007c197' => array(
'javelin-behavior',
'javelin-dom',
@ -1909,12 +1915,6 @@ return array(
'df5e11d2' => array(
'javelin-install',
),
'dfaafb14' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-workflow',
),
'e10f8e18' => array(
'javelin-behavior',
'javelin-dom',

View file

@ -102,7 +102,7 @@ final class PhabricatorProjectTransactionEditor
case PhabricatorProjectTransaction::TYPE_NAME:
$name = $xaction->getNewValue();
$object->setName($name);
if ($this->getIsMilestone()) {
if (!$this->getIsMilestone()) {
$object->setPrimarySlug(PhabricatorSlug::normalizeProjectSlug($name));
}
return;

View file

@ -26,11 +26,21 @@ final class PHUIFormIconSetControl
$input_id = celerity_generate_unique_node_id();
$display_id = celerity_generate_unique_node_id();
$is_disabled = $this->getDisabled();
$classes = array();
$classes[] = 'button';
$classes[] = 'grey';
if ($is_disabled) {
$classes[] = 'disabled';
}
$button = javelin_tag(
'a',
array(
'href' => '#',
'class' => 'button grey',
'class' => implode(' ', $classes),
'sigil' => 'phui-form-iconset-button',
),
$set->getChooseButtonText());
@ -79,6 +89,7 @@ final class PHUIFormIconSetControl
'input',
array(
'type' => 'hidden',
'disabled' => ($is_disabled ? 'disabled' : null),
'name' => $this->getName(),
'value' => $this->getValue(),
'id' => $input_id,

View file

@ -15,14 +15,19 @@ JX.behavior('choose-control', function() {
e.kill();
var data = e.getNodeData('phui-form-iconset');
var input = JX.$(data.inputID);
if (input.disabled) {
return;
}
var params = {
value: JX.$(data.inputID).value
value: input.value
};
new JX.Workflow(data.uri, params)
.setHandler(function(r) {
JX.$(data.inputID).value = r.value;
input.value = r.value;
JX.DOM.setContent(JX.$(data.displayID), JX.$H(r.display));
})
.start();