@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update EditEngine for two column

Summary: Cleans up EditEngine, adds new layout to EditEngine and descendents

Test Plan: Test creating a new form, reordering, marking and unmarking defaults. View new forms.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15531

+219 -55
+2 -2
resources/celerity/map.php
··· 156 156 'rsrc/css/phui/phui-status.css' => '37309046', 157 157 'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2', 158 158 'rsrc/css/phui/phui-timeline-view.css' => '6e342216', 159 - 'rsrc/css/phui/phui-two-column-view.css' => '9c43b599', 159 + 'rsrc/css/phui/phui-two-column-view.css' => '691fec04', 160 160 'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7', 161 161 'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647', 162 162 'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96', ··· 846 846 'phui-tag-view-css' => '6bbd83e2', 847 847 'phui-theme-css' => '027ba77e', 848 848 'phui-timeline-view-css' => '6e342216', 849 - 'phui-two-column-view-css' => '9c43b599', 849 + 'phui-two-column-view-css' => '691fec04', 850 850 'phui-workboard-color-css' => 'ac6fe6a7', 851 851 'phui-workboard-view-css' => 'e6d89647', 852 852 'phui-workcard-view-css' => '3646fb96',
+4
src/applications/almanac/editor/AlmanacBindingPropertyEditEngine.php
··· 13 13 return $object->getURI(); 14 14 } 15 15 16 + protected function getObjectName() { 17 + return pht('Property'); 18 + } 19 + 16 20 }
+4
src/applications/almanac/editor/AlmanacDeviceEditEngine.php
··· 53 53 return pht('Create Device'); 54 54 } 55 55 56 + protected function getObjectName() { 57 + return pht('Device'); 58 + } 59 + 56 60 protected function getEditorURI() { 57 61 return '/almanac/device/edit/'; 58 62 }
+4
src/applications/almanac/editor/AlmanacDevicePropertyEditEngine.php
··· 13 13 return $object->getURI(); 14 14 } 15 15 16 + protected function getObjectName() { 17 + return pht('Property'); 18 + } 19 + 16 20 }
+4
src/applications/almanac/editor/AlmanacNamespaceEditEngine.php
··· 53 53 return pht('Create Namespace'); 54 54 } 55 55 56 + protected function getObjectName() { 57 + return pht('Namespace'); 58 + } 59 + 56 60 protected function getEditorURI() { 57 61 return '/almanac/namespace/edit/'; 58 62 }
+4
src/applications/almanac/editor/AlmanacNetworkEditEngine.php
··· 53 53 return pht('Create Network'); 54 54 } 55 55 56 + protected function getObjectName() { 57 + return pht('Network'); 58 + } 59 + 56 60 protected function getEditorURI() { 57 61 return '/almanac/network/edit/'; 58 62 }
+4
src/applications/almanac/editor/AlmanacServiceEditEngine.php
··· 65 65 return pht('Create Service'); 66 66 } 67 67 68 + protected function getObjectName() { 69 + return pht('Service'); 70 + } 71 + 68 72 protected function getEditorURI() { 69 73 return '/almanac/service/edit/'; 70 74 }
+4
src/applications/almanac/editor/AlmanacServicePropertyEditEngine.php
··· 13 13 return $object->getURI(); 14 14 } 15 15 16 + protected function getObjectName() { 17 + return pht('Property'); 18 + } 19 + 16 20 }
+5 -1
src/applications/badges/editor/PhabricatorBadgesEditEngine.php
··· 34 34 } 35 35 36 36 protected function getObjectEditTitleText($object) { 37 - return pht('Edit %s', $object->getName()); 37 + return pht('Edit Badge: %s', $object->getName()); 38 38 } 39 39 40 40 protected function getObjectEditShortText($object) { ··· 43 43 44 44 protected function getObjectCreateShortText() { 45 45 return pht('Create Badge'); 46 + } 47 + 48 + protected function getObjectName() { 49 + return pht('Badge'); 46 50 } 47 51 48 52 protected function getCommentViewHeaderText($object) {
+4
src/applications/drydock/editor/DrydockBlueprintEditEngine.php
··· 75 75 return pht('Create Blueprint'); 76 76 } 77 77 78 + protected function getObjectName() { 79 + return pht('Blueprint'); 80 + } 81 + 78 82 protected function getEditorURI() { 79 83 return '/drydock/blueprint/edit/'; 80 84 }
+4
src/applications/harbormaster/editor/HarbormasterBuildPlanEditEngine.php
··· 54 54 return pht('Create Build Plan'); 55 55 } 56 56 57 + protected function getObjectName() { 58 + return pht('Build Plan'); 59 + } 60 + 57 61 protected function getEditorURI() { 58 62 return '/harbormaster/plan/edit/'; 59 63 }
+5 -1
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 34 34 } 35 35 36 36 protected function getObjectEditTitleText($object) { 37 - return pht('Edit %s %s', $object->getMonogram(), $object->getTitle()); 37 + return pht('Edit Task: %s', $object->getTitle()); 38 38 } 39 39 40 40 protected function getObjectEditShortText($object) { ··· 43 43 44 44 protected function getObjectCreateShortText() { 45 45 return pht('Create Task'); 46 + } 47 + 48 + protected function getObjectName() { 49 + return pht('Task'); 46 50 } 47 51 48 52 protected function getEditorURI() {
+4
src/applications/nuance/editor/NuanceQueueEditEngine.php
··· 53 53 return pht('Create Queue'); 54 54 } 55 55 56 + protected function getObjectName() { 57 + return pht('Queue'); 58 + } 59 + 56 60 protected function getEditorURI() { 57 61 return '/nuance/queue/edit/'; 58 62 }
+4
src/applications/nuance/editor/NuanceSourceEditEngine.php
··· 74 74 return pht('Create Source'); 75 75 } 76 76 77 + protected function getObjectName() { 78 + return pht('Source'); 79 + } 80 + 77 81 protected function getEditorURI() { 78 82 return '/nuance/source/edit/'; 79 83 }
+5 -1
src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php
··· 35 35 } 36 36 37 37 protected function getObjectEditTitleText($object) { 38 - return pht('Edit Package %s', $object->getName()); 38 + return pht('Edit Package: %s', $object->getName()); 39 39 } 40 40 41 41 protected function getObjectEditShortText($object) { ··· 44 44 45 45 protected function getObjectCreateShortText() { 46 46 return pht('Create Package'); 47 + } 48 + 49 + protected function getObjectName() { 50 + return pht('Package'); 47 51 } 48 52 49 53 protected function getObjectViewURI($object) {
+4
src/applications/paste/editor/PhabricatorPasteEditEngine.php
··· 46 46 return pht('Create Paste'); 47 47 } 48 48 49 + protected function getObjectName() { 50 + return pht('Paste'); 51 + } 52 + 49 53 protected function getCommentViewHeaderText($object) { 50 54 return pht('Eat Paste'); 51 55 }
+4
src/applications/phame/editor/PhameBlogEditEngine.php
··· 46 46 return pht('Create Blog'); 47 47 } 48 48 49 + protected function getObjectName() { 50 + return pht('Blog'); 51 + } 52 + 49 53 protected function getObjectCreateCancelURI($object) { 50 54 return $this->getApplication()->getApplicationURI('blog/'); 51 55 }
+4
src/applications/phame/editor/PhamePostEditEngine.php
··· 60 60 return pht('Create Post'); 61 61 } 62 62 63 + protected function getObjectName() { 64 + return pht('Post'); 65 + } 66 + 63 67 protected function getObjectViewURI($object) { 64 68 return $object->getViewURI(); 65 69 }
+5 -1
src/applications/project/engine/PhabricatorProjectEditEngine.php
··· 56 56 } 57 57 58 58 protected function getObjectEditTitleText($object) { 59 - return pht('Edit %s', $object->getName()); 59 + return pht('Edit Project: %s', $object->getName()); 60 60 } 61 61 62 62 protected function getObjectEditShortText($object) { ··· 65 65 66 66 protected function getObjectCreateShortText() { 67 67 return pht('Create Project'); 68 + } 69 + 70 + protected function getObjectName() { 71 + return pht('Project'); 68 72 } 69 73 70 74 protected function getObjectViewURI($object) {
+4
src/applications/search/editor/PhabricatorProfilePanelEditEngine.php
··· 108 108 return pht('Edit Menu Item'); 109 109 } 110 110 111 + protected function getObjectName() { 112 + return pht('Menu Item'); 113 + } 114 + 111 115 protected function getObjectCreateCancelURI($object) { 112 116 return $this->getPanelEngine()->getConfigureURI(); 113 117 }
+16 -4
src/applications/transactions/controller/PhabricatorEditEngineConfigurationDefaultsController.php
··· 86 86 ->addCancelButton($cancel_uri)); 87 87 88 88 $info = id(new PHUIInfoView()) 89 - ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) 89 + ->setSeverity(PHUIInfoView::SEVERITY_WARNING) 90 90 ->setErrors( 91 91 array( 92 92 pht('You are editing the default values for this form.'), ··· 94 94 95 95 96 96 $box = id(new PHUIObjectBoxView()) 97 - ->setHeaderText($title) 98 - ->setInfoView($info) 97 + ->setHeaderText(pht('Form')) 98 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 99 99 ->setForm($form); 100 100 101 101 $crumbs = $this->buildApplicationCrumbs(); 102 102 $crumbs->addTextCrumb(pht('Form %d', $config->getID()), $cancel_uri); 103 103 $crumbs->addTextCrumb(pht('Edit Defaults')); 104 + $crumbs->setBorder(true); 105 + 106 + $header = id(new PHUIHeaderView()) 107 + ->setHeader(pht('Edit Form Defaults')) 108 + ->setHeaderIcon('fa-pencil'); 109 + 110 + $view = id(new PHUITwoColumnView()) 111 + ->setHeader($header) 112 + ->setFooter(array( 113 + $info, 114 + $box, 115 + )); 104 116 105 117 return $this->newPage() 106 118 ->setTitle($title) 107 119 ->setCrumbs($crumbs) 108 - ->appendChild($box); 120 + ->appendChild($view); 109 121 } 110 122 111 123 }
+44 -35
src/applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php
··· 17 17 18 18 $is_concrete = (bool)$config->getID(); 19 19 20 - $actions = $this->buildActionView($config); 21 - 22 - $properties = $this->buildPropertyView($config) 23 - ->setActionList($actions); 20 + $curtain = $this->buildCurtainView($config); 21 + $properties = $this->buildPropertyView($config); 24 22 25 23 $header = id(new PHUIHeaderView()) 26 24 ->setUser($viewer) 27 25 ->setPolicyObject($config) 28 - ->setHeader(pht('Edit Form: %s', $config->getDisplayName())); 26 + ->setHeader(pht('Edit Form: %s', $config->getDisplayName())) 27 + ->setHeaderIcon('fa-pencil'); 29 28 30 - $box = id(new PHUIObjectBoxView()) 31 - ->setHeader($header) 32 - ->addPropertyList($properties); 29 + if ($config->getIsDisabled()) { 30 + $name = pht('Disabled'); 31 + $icon = 'fa-ban'; 32 + $color = 'indigo'; 33 + } else { 34 + $name = pht('Enabled'); 35 + $icon = 'fa-check'; 36 + $color = 'green'; 37 + } 38 + $header->setStatus($icon, $color, $name); 33 39 34 40 $field_list = $this->buildFieldList($config); 35 - 36 41 $crumbs = $this->buildApplicationCrumbs(); 42 + $crumbs->setBorder(true); 37 43 38 44 if ($is_concrete) { 39 - $crumbs->addTextCrumb(pht('Form %d', $config->getID())); 45 + $title = pht('Form %d', $config->getID()); 46 + $crumbs->addTextCrumb($title); 40 47 } else { 48 + $title = pht('Builtin'); 41 49 $crumbs->addTextCrumb(pht('Builtin')); 42 50 } 43 51 ··· 51 59 $timeline = null; 52 60 } 53 61 62 + $view = id(new PHUITwoColumnView()) 63 + ->setHeader($header) 64 + ->setCurtain($curtain) 65 + ->setMainColumn(array( 66 + $field_list, 67 + $timeline, 68 + )); 69 + 54 70 return $this->newPage() 71 + ->setTitle($title) 55 72 ->setCrumbs($crumbs) 56 - ->appendChild( 57 - array( 58 - $box, 59 - $field_list, 60 - $timeline, 61 - )); 73 + ->appendChild($view); 62 74 } 63 75 64 - private function buildActionView( 76 + private function buildCurtainView( 65 77 PhabricatorEditEngineConfiguration $config) { 66 78 $viewer = $this->getViewer(); 67 79 $engine = $config->getEngine(); ··· 72 84 $config, 73 85 PhabricatorPolicyCapability::CAN_EDIT); 74 86 75 - $view = id(new PhabricatorActionListView()) 76 - ->setUser($viewer); 77 - 87 + $curtain = $this->newCurtainView($config); 78 88 $form_key = $config->getIdentifier(); 79 89 80 90 $base_uri = "/transactions/editengine/{$engine_key}"; ··· 83 93 if (!$is_concrete) { 84 94 $save_uri = "{$base_uri}/save/{$form_key}/"; 85 95 86 - $view->addAction( 96 + $curtain->addAction( 87 97 id(new PhabricatorActionView()) 88 98 ->setName(pht('Make Editable')) 89 99 ->setIcon('fa-pencil') ··· 94 104 $can_edit = false; 95 105 } else { 96 106 $edit_uri = "{$base_uri}/edit/{$form_key}/"; 97 - $view->addAction( 107 + $curtain->addAction( 98 108 id(new PhabricatorActionView()) 99 109 ->setName(pht('Edit Form Configuration')) 100 110 ->setIcon('fa-pencil') ··· 105 115 106 116 $use_uri = $engine->getEditURI(null, "form/{$form_key}/"); 107 117 108 - $view->addAction( 118 + $curtain->addAction( 109 119 id(new PhabricatorActionView()) 110 120 ->setName(pht('Use Form')) 111 121 ->setIcon('fa-th-list') ··· 113 123 114 124 $defaults_uri = "{$base_uri}/defaults/{$form_key}/"; 115 125 116 - $view->addAction( 126 + $curtain->addAction( 117 127 id(new PhabricatorActionView()) 118 128 ->setName(pht('Change Default Values')) 119 129 ->setIcon('fa-paint-brush') ··· 123 133 124 134 $reorder_uri = "{$base_uri}/reorder/{$form_key}/"; 125 135 126 - $view->addAction( 136 + $curtain->addAction( 127 137 id(new PhabricatorActionView()) 128 138 ->setName(pht('Change Field Order')) 129 139 ->setIcon('fa-sort-alpha-asc') ··· 133 143 134 144 $lock_uri = "{$base_uri}/lock/{$form_key}/"; 135 145 136 - $view->addAction( 146 + $curtain->addAction( 137 147 id(new PhabricatorActionView()) 138 148 ->setName(pht('Lock / Hide Fields')) 139 149 ->setIcon('fa-lock') ··· 151 161 $disable_icon = 'fa-ban'; 152 162 } 153 163 154 - $view->addAction( 164 + $curtain->addAction( 155 165 id(new PhabricatorActionView()) 156 166 ->setName($disable_name) 157 167 ->setIcon($disable_icon) ··· 169 179 $defaultcreate_icon = 'fa-plus'; 170 180 } 171 181 172 - $view->addAction( 182 + $curtain->addAction( 173 183 id(new PhabricatorActionView()) 174 184 ->setName($defaultcreate_name) 175 185 ->setIcon($defaultcreate_icon) ··· 187 197 188 198 $isedit_uri = "{$base_uri}/defaultedit/{$form_key}/"; 189 199 190 - $view->addAction( 200 + $curtain->addAction( 191 201 id(new PhabricatorActionView()) 192 202 ->setName($isedit_name) 193 203 ->setIcon($isedit_icon) ··· 195 205 ->setWorkflow(true) 196 206 ->setDisabled(!$can_edit)); 197 207 198 - return $view; 208 + return $curtain; 199 209 } 200 210 201 211 private function buildPropertyView( ··· 203 213 $viewer = $this->getViewer(); 204 214 205 215 $properties = id(new PHUIPropertyListView()) 206 - ->setUser($viewer) 207 - ->setObject($config); 216 + ->setUser($viewer); 208 217 209 218 return $properties; 210 219 } ··· 226 235 } 227 236 228 237 $info = id(new PHUIInfoView()) 229 - ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) 238 + ->setSeverity(PHUIInfoView::SEVERITY_WARNING) 230 239 ->setErrors( 231 240 array( 232 241 pht('This is a preview of the current form configuration.'), ··· 234 243 235 244 $box = id(new PHUIObjectBoxView()) 236 245 ->setHeaderText(pht('Form Preview')) 237 - ->setInfoView($info) 246 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 238 247 ->setForm($form); 239 248 240 - return $box; 249 + return array($info, $box); 241 250 } 242 251 243 252 }
+21 -4
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 191 191 /** 192 192 * @task text 193 193 */ 194 + abstract protected function getObjectName(); 195 + 196 + 197 + /** 198 + * @task text 199 + */ 194 200 abstract protected function getObjectEditShortText($object); 195 201 196 202 ··· 988 994 989 995 if ($this->getIsCreate()) { 990 996 $header_text = $this->getFormHeaderText($object); 997 + $header_icon = 'fa-plus-square'; 991 998 } else { 992 999 $header_text = $this->getObjectEditTitleText($object); 1000 + $header_icon = 'fa-pencil'; 993 1001 } 994 1002 995 1003 $show_preview = !$request->isAjax(); ··· 1036 1044 } 1037 1045 1038 1046 $header = id(new PHUIHeaderView()) 1039 - ->setHeader($header_text); 1047 + ->setHeader($header_text) 1048 + ->setHeaderIcon($header_icon); 1040 1049 1041 1050 if ($action_button) { 1042 1051 $header->addActionLink($action_button); 1043 1052 } 1044 1053 1045 1054 $crumbs = $this->buildCrumbs($object, $final = true); 1055 + $crumbs->setBorder(true); 1046 1056 1047 1057 $box = id(new PHUIObjectBoxView()) 1048 1058 ->setUser($viewer) 1049 - ->setHeader($header) 1059 + ->setHeaderText($this->getObjectName()) 1050 1060 ->setValidationException($validation_exception) 1061 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 1051 1062 ->appendChild($form); 1052 1063 1064 + $view = id(new PHUITwoColumnView()) 1065 + ->setHeader($header) 1066 + ->setFooter(array( 1067 + $box, 1068 + $previews, 1069 + )); 1070 + 1053 1071 return $controller->newPage() 1054 1072 ->setTitle($header_text) 1055 1073 ->setCrumbs($crumbs) 1056 - ->appendChild($box) 1057 - ->appendChild($previews); 1074 + ->appendChild($view); 1058 1075 } 1059 1076 1060 1077 protected function newEditResponse(
+4
src/applications/transactions/editor/PhabricatorEditEngineConfigurationEditEngine.php
··· 70 70 return pht('Create Form'); 71 71 } 72 72 73 + protected function getObjectName() { 74 + return pht('Form'); 75 + } 76 + 73 77 protected function getObjectViewURI($object) { 74 78 $id = $object->getID(); 75 79 return $this->getURI("view/{$id}/");
+8 -5
src/applications/transactions/query/PhabricatorEditEngineConfigurationSearchEngine.php
··· 116 116 117 117 $id = $config->getID(); 118 118 if ($id) { 119 - $item->setObjectName(pht('Form %d', $id)); 119 + $item->addIcon('fa-file-text-o bluegrey', pht('Form %d', $id)); 120 120 $key = $id; 121 121 } else { 122 - $item->setObjectName(pht('Builtin')); 122 + $item->addIcon('fa-file-text bluegrey', pht('Builtin')); 123 123 $key = $config->getBuiltinKey(); 124 124 } 125 125 $item->setHref("/transactions/editengine/{$engine_key}/view/{$key}/"); 126 126 127 127 if ($config->getIsDefault()) { 128 - $item->addIcon('fa-plus', pht('Default')); 128 + $item->addAttribute(pht('Default Create Form')); 129 129 } 130 130 131 131 if ($config->getIsEdit()) { 132 - $item->addIcon('fa-pencil', pht('Edit Form')); 132 + $item->addAttribute(pht('Edit Form')); 133 133 } 134 134 135 135 if ($config->getIsDisabled()) { 136 - $item->addIcon('fa-ban', pht('Disabled')); 136 + $item->setDisabled(true); 137 + $item->setStatusIcon('fa-ban grey', pht('Disabled')); 138 + } else { 139 + $item->setStatusIcon('fa-file-text-o green', pht('Enabled')); 137 140 } 138 141 139 142 $list->addItem($item);
+43
src/applications/transactions/storage/PhabricatorEditEngineConfigurationTransaction.php
··· 104 104 return parent::getTitle(); 105 105 } 106 106 107 + public function getColor() { 108 + $author_phid = $this->getAuthorPHID(); 109 + 110 + $old = $this->getOldValue(); 111 + $new = $this->getNewValue(); 112 + 113 + $type = $this->getTransactionType(); 114 + switch ($type) { 115 + case PhabricatorTransactions::TYPE_CREATE: 116 + return 'green'; 117 + case self::TYPE_DISABLE: 118 + if ($new) { 119 + return 'indigo'; 120 + } else { 121 + return 'green'; 122 + } 123 + } 124 + 125 + return parent::getColor(); 126 + } 127 + 128 + public function getIcon() { 129 + $author_phid = $this->getAuthorPHID(); 130 + 131 + $old = $this->getOldValue(); 132 + $new = $this->getNewValue(); 133 + 134 + $type = $this->getTransactionType(); 135 + switch ($type) { 136 + case PhabricatorTransactions::TYPE_CREATE: 137 + return 'fa-plus'; 138 + case self::TYPE_DISABLE: 139 + if ($new) { 140 + return 'fa-ban'; 141 + } else { 142 + return 'fa-check'; 143 + } 144 + } 145 + 146 + return parent::getIcon(); 147 + } 148 + 149 + 107 150 }
+1 -1
webroot/rsrc/css/phui/phui-two-column-view.css
··· 188 188 189 189 /* Info View */ 190 190 191 - .phui-two-column-view .phui-two-column-row .phui-info-view { 191 + .phui-two-column-view .phui-info-view { 192 192 margin: 0 0 20px 0; 193 193 padding: 16px; 194 194 }