Put "Push Policy" last in Diffusion, make editing Spaces work
Summary: Ref T10923. - The "Policy" edit form currently goes "Push, View, Edit". Reorder the defaults to "View, Edit, Push". - Editing Spaces doesn't currently work: the element appears in the UI, but isn't actually processed when handling transactions. Make that work. Test Plan: - Edited a repository policies, saw "View, Edit, Push". - Moved a repository between Spaces. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10923 Differential Revision: https://secure.phabricator.com/D15866
This commit is contained in:
@@ -165,6 +165,35 @@ final class DiffusionRepositoryEditEngine
|
||||
return $pages;
|
||||
}
|
||||
|
||||
protected function willConfigureFields($object, array $fields) {
|
||||
// Change the default field order so related fields are adjacent.
|
||||
$after = array(
|
||||
'policy.edit' => array('policy.push'),
|
||||
);
|
||||
|
||||
$result = array();
|
||||
foreach ($fields as $key => $value) {
|
||||
$result[$key] = $value;
|
||||
|
||||
if (!isset($after[$key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($after[$key] as $next_key) {
|
||||
if (!isset($fields[$next_key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($result[$next_key]);
|
||||
$result[$next_key] = $fields[$next_key];
|
||||
unset($fields[$next_key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
protected function buildCustomEditFields($object) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user