diff --git a/src/applications/project/controller/PhabricatorProjectEditDetailsController.php b/src/applications/project/controller/PhabricatorProjectEditDetailsController.php index 6e67c6332f..f4cb1894df 100644 --- a/src/applications/project/controller/PhabricatorProjectEditDetailsController.php +++ b/src/applications/project/controller/PhabricatorProjectEditDetailsController.php @@ -47,6 +47,7 @@ final class PhabricatorProjectEditDetailsController $v_primary_slug = $project->getPrimarySlug(); unset($project_slugs[$v_primary_slug]); $v_slugs = $project_slugs; + $v_color = $project->getColor(); $validation_exception = null; @@ -59,6 +60,7 @@ final class PhabricatorProjectEditDetailsController $v_view = $request->getStr('can_view'); $v_edit = $request->getStr('can_edit'); $v_join = $request->getStr('can_join'); + $v_color = $request->getStr('color'); $xactions = $field_list->buildFieldTransactionsFromRequest( new PhabricatorProjectTransaction(), @@ -67,6 +69,7 @@ final class PhabricatorProjectEditDetailsController $type_name = PhabricatorProjectTransaction::TYPE_NAME; $type_slugs = PhabricatorProjectTransaction::TYPE_SLUGS; $type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY; + $type_color = PhabricatorProjectTransaction::TYPE_COLOR; $xactions[] = id(new PhabricatorProjectTransaction()) ->setTransactionType($type_name) @@ -88,6 +91,10 @@ final class PhabricatorProjectEditDetailsController ->setTransactionType(PhabricatorTransactions::TYPE_JOIN_POLICY) ->setNewValue($v_join); + $xactions[] = id(new PhabricatorProjectTransaction()) + ->setTransactionType($type_color) + ->setNewValue($v_color); + $editor = id(new PhabricatorProjectTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) @@ -130,7 +137,19 @@ final class PhabricatorProjectEditDetailsController ->setError($e_name)); $field_list->appendFieldsToForm($form); + $shades = PHUITagView::getShadeMap(); + $shades = array_select_keys( + $shades, + array(PhabricatorProject::DEFAULT_COLOR)) + $shades; + unset($shades[PHUITagView::COLOR_DISABLED]); + $form + ->appendChild( + id(new AphrontFormSelectControl()) + ->setLabel(pht('Color')) + ->setName('color') + ->setValue($v_color) + ->setOptions($shades)) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel(pht('Primary Hashtag')) diff --git a/src/applications/project/controller/PhabricatorProjectEditIconController.php b/src/applications/project/controller/PhabricatorProjectEditIconController.php index 885ec5033f..6b4f2abf41 100644 --- a/src/applications/project/controller/PhabricatorProjectEditIconController.php +++ b/src/applications/project/controller/PhabricatorProjectEditIconController.php @@ -33,18 +33,12 @@ final class PhabricatorProjectEditIconController $xactions = array(); $v_icon = $request->getStr('icon'); - $v_icon_color = $request->getStr('color'); $type_icon = PhabricatorProjectTransaction::TYPE_ICON; $xactions[] = id(new PhabricatorProjectTransaction()) ->setTransactionType($type_icon) ->setNewValue($v_icon); - $type_icon_color = PhabricatorProjectTransaction::TYPE_COLOR; - $xactions[] = id(new PhabricatorProjectTransaction()) - ->setTransactionType($type_icon_color) - ->setNewValue($v_icon_color); - $editor = id(new PhabricatorProjectTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) @@ -56,20 +50,6 @@ final class PhabricatorProjectEditIconController return id(new AphrontReloadResponse())->setURI($edit_uri); } - $shades = PHUITagView::getShadeMap(); - $shades = array_select_keys( - $shades, - array(PhabricatorProject::DEFAULT_COLOR)) + $shades; - unset($shades[PHUITagView::COLOR_DISABLED]); - - $color_form = id(new AphrontFormView()) - ->appendChild( - id(new AphrontFormSelectControl()) - ->setLabel(pht('Color')) - ->setName('color') - ->setValue($project->getColor()) - ->setOptions($shades)); - require_celerity_resource('project-icon-css'); Javelin::initBehavior('phabricator-tooltips'); @@ -121,14 +101,9 @@ final class PhabricatorProjectEditIconController ), $buttons); - $color_form->appendChild( - id(new AphrontFormMarkupControl()) - ->setLabel(pht('Icon')) - ->setValue($buttons)); - return $this->newDialog() ->setTitle(pht('Choose Project Icon')) - ->appendChild($color_form->buildLayoutView()) + ->appendChild($buttons) ->addCancelButton($edit_uri); } }