@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.

Make the drop target for file attachments smaller

Summary:
Currently, in Maniphest, if you drag-and-drop a file it always attaches. Instead, I want you to have two options:

- Drag and drop to the attachment area to attach; or
- drag and drop to the Remarkup panel to upload + inline.

For the first step, make the input have a clear drop target instead of it being the entire panel.

Test Plan: Attached files in Create Task, task view, meta mta send test.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

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

+59 -68
+46 -46
src/__celerity_resource_map__.php
··· 548 548 ), 549 549 'aphront-form-view-css' => 550 550 array( 551 - 'uri' => '/res/652cb62f/rsrc/css/aphront/form-view.css', 551 + 'uri' => '/res/4cda6bc6/rsrc/css/aphront/form-view.css', 552 552 'type' => 'css', 553 553 'requires' => 554 554 array( ··· 916 916 ), 917 917 'javelin-behavior-aphront-drag-and-drop' => 918 918 array( 919 - 'uri' => '/res/ac21045a/rsrc/js/application/core/behavior-drag-and-drop.js', 919 + 'uri' => '/res/724c922b/rsrc/js/application/core/behavior-drag-and-drop.js', 920 920 'type' => 'js', 921 921 'requires' => 922 922 array( ··· 3003 3003 ), array( 3004 3004 'packages' => 3005 3005 array( 3006 - '1da0b408' => 3006 + 'c88632b0' => 3007 3007 array( 3008 3008 'name' => 'core.pkg.css', 3009 3009 'symbols' => ··· 3032 3032 21 => 'phabricator-flag-css', 3033 3033 22 => 'aphront-error-view-css', 3034 3034 ), 3035 - 'uri' => '/res/pkg/1da0b408/core.pkg.css', 3035 + 'uri' => '/res/pkg/c88632b0/core.pkg.css', 3036 3036 'type' => 'css', 3037 3037 ), 3038 3038 '3a455e4f' => ··· 3084 3084 'uri' => '/res/pkg/2ba14b3d/differential.pkg.css', 3085 3085 'type' => 'css', 3086 3086 ), 3087 - 'd05e3c0f' => 3087 + 'a5cb9310' => 3088 3088 array( 3089 3089 'name' => 'differential.pkg.js', 3090 3090 'symbols' => ··· 3107 3107 15 => 'differential-inline-comment-editor', 3108 3108 16 => 'javelin-behavior-differential-dropdown-menus', 3109 3109 ), 3110 - 'uri' => '/res/pkg/d05e3c0f/differential.pkg.js', 3110 + 'uri' => '/res/pkg/a5cb9310/differential.pkg.js', 3111 3111 'type' => 'js', 3112 3112 ), 3113 3113 'c8ce2d88' => ··· 3199 3199 'reverse' => 3200 3200 array( 3201 3201 'aphront-attached-file-view-css' => '7839ae2d', 3202 - 'aphront-crumbs-view-css' => '1da0b408', 3203 - 'aphront-dialog-view-css' => '1da0b408', 3204 - 'aphront-error-view-css' => '1da0b408', 3205 - 'aphront-form-view-css' => '1da0b408', 3202 + 'aphront-crumbs-view-css' => 'c88632b0', 3203 + 'aphront-dialog-view-css' => 'c88632b0', 3204 + 'aphront-error-view-css' => 'c88632b0', 3205 + 'aphront-form-view-css' => 'c88632b0', 3206 3206 'aphront-headsup-action-list-view-css' => '2ba14b3d', 3207 - 'aphront-headsup-view-css' => '1da0b408', 3208 - 'aphront-list-filter-view-css' => '1da0b408', 3209 - 'aphront-pager-view-css' => '1da0b408', 3210 - 'aphront-panel-view-css' => '1da0b408', 3211 - 'aphront-side-nav-view-css' => '1da0b408', 3212 - 'aphront-table-view-css' => '1da0b408', 3213 - 'aphront-tokenizer-control-css' => '1da0b408', 3214 - 'aphront-tooltip-css' => '1da0b408', 3215 - 'aphront-typeahead-control-css' => '1da0b408', 3207 + 'aphront-headsup-view-css' => 'c88632b0', 3208 + 'aphront-list-filter-view-css' => 'c88632b0', 3209 + 'aphront-pager-view-css' => 'c88632b0', 3210 + 'aphront-panel-view-css' => 'c88632b0', 3211 + 'aphront-side-nav-view-css' => 'c88632b0', 3212 + 'aphront-table-view-css' => 'c88632b0', 3213 + 'aphront-tokenizer-control-css' => 'c88632b0', 3214 + 'aphront-tooltip-css' => 'c88632b0', 3215 + 'aphront-typeahead-control-css' => 'c88632b0', 3216 3216 'differential-changeset-view-css' => '2ba14b3d', 3217 3217 'differential-core-view-css' => '2ba14b3d', 3218 - 'differential-inline-comment-editor' => 'd05e3c0f', 3218 + 'differential-inline-comment-editor' => 'a5cb9310', 3219 3219 'differential-local-commits-view-css' => '2ba14b3d', 3220 3220 'differential-results-table-css' => '2ba14b3d', 3221 3221 'differential-revision-add-comment-css' => '2ba14b3d', ··· 3229 3229 'inline-comment-summary-css' => '2ba14b3d', 3230 3230 'javelin-behavior' => '6c45a1d8', 3231 3231 'javelin-behavior-aphront-basic-tokenizer' => '81c9cd69', 3232 - 'javelin-behavior-aphront-drag-and-drop' => 'd05e3c0f', 3233 - 'javelin-behavior-aphront-drag-and-drop-textarea' => 'd05e3c0f', 3232 + 'javelin-behavior-aphront-drag-and-drop' => 'a5cb9310', 3233 + 'javelin-behavior-aphront-drag-and-drop-textarea' => 'a5cb9310', 3234 3234 'javelin-behavior-aphront-form-disable-on-submit' => '3a455e4f', 3235 3235 'javelin-behavior-audit-preview' => '5e68be89', 3236 - 'javelin-behavior-differential-accept-with-errors' => 'd05e3c0f', 3237 - 'javelin-behavior-differential-add-reviewers-and-ccs' => 'd05e3c0f', 3238 - 'javelin-behavior-differential-comment-jump' => 'd05e3c0f', 3239 - 'javelin-behavior-differential-diff-radios' => 'd05e3c0f', 3240 - 'javelin-behavior-differential-dropdown-menus' => 'd05e3c0f', 3241 - 'javelin-behavior-differential-edit-inline-comments' => 'd05e3c0f', 3242 - 'javelin-behavior-differential-feedback-preview' => 'd05e3c0f', 3243 - 'javelin-behavior-differential-keyboard-navigation' => 'd05e3c0f', 3244 - 'javelin-behavior-differential-populate' => 'd05e3c0f', 3245 - 'javelin-behavior-differential-show-more' => 'd05e3c0f', 3236 + 'javelin-behavior-differential-accept-with-errors' => 'a5cb9310', 3237 + 'javelin-behavior-differential-add-reviewers-and-ccs' => 'a5cb9310', 3238 + 'javelin-behavior-differential-comment-jump' => 'a5cb9310', 3239 + 'javelin-behavior-differential-diff-radios' => 'a5cb9310', 3240 + 'javelin-behavior-differential-dropdown-menus' => 'a5cb9310', 3241 + 'javelin-behavior-differential-edit-inline-comments' => 'a5cb9310', 3242 + 'javelin-behavior-differential-feedback-preview' => 'a5cb9310', 3243 + 'javelin-behavior-differential-keyboard-navigation' => 'a5cb9310', 3244 + 'javelin-behavior-differential-populate' => 'a5cb9310', 3245 + 'javelin-behavior-differential-show-more' => 'a5cb9310', 3246 3246 'javelin-behavior-diffusion-commit-graph' => '5e68be89', 3247 3247 'javelin-behavior-diffusion-pull-lastmodified' => '5e68be89', 3248 3248 'javelin-behavior-maniphest-batch-selector' => '7707de41', ··· 3252 3252 'javelin-behavior-maniphest-transaction-preview' => '7707de41', 3253 3253 'javelin-behavior-phabricator-autofocus' => '3a455e4f', 3254 3254 'javelin-behavior-phabricator-keyboard-shortcuts' => '3a455e4f', 3255 - 'javelin-behavior-phabricator-object-selector' => 'd05e3c0f', 3255 + 'javelin-behavior-phabricator-object-selector' => 'a5cb9310', 3256 3256 'javelin-behavior-phabricator-oncopy' => '3a455e4f', 3257 3257 'javelin-behavior-phabricator-tooltips' => '3a455e4f', 3258 3258 'javelin-behavior-phabricator-watch-anchor' => '3a455e4f', 3259 3259 'javelin-behavior-refresh-csrf' => '3a455e4f', 3260 - 'javelin-behavior-repository-crossreference' => 'd05e3c0f', 3260 + 'javelin-behavior-repository-crossreference' => 'a5cb9310', 3261 3261 'javelin-behavior-workflow' => '3a455e4f', 3262 3262 'javelin-dom' => '6c45a1d8', 3263 3263 'javelin-event' => '6c45a1d8', ··· 3278 3278 'javelin-workflow' => '3a455e4f', 3279 3279 'maniphest-task-summary-css' => '7839ae2d', 3280 3280 'maniphest-transaction-detail-css' => '7839ae2d', 3281 - 'phabricator-app-buttons-css' => '1da0b408', 3281 + 'phabricator-app-buttons-css' => 'c88632b0', 3282 3282 'phabricator-content-source-view-css' => '2ba14b3d', 3283 - 'phabricator-core-buttons-css' => '1da0b408', 3284 - 'phabricator-core-css' => '1da0b408', 3285 - 'phabricator-directory-css' => '1da0b408', 3286 - 'phabricator-drag-and-drop-file-upload' => 'd05e3c0f', 3283 + 'phabricator-core-buttons-css' => 'c88632b0', 3284 + 'phabricator-core-css' => 'c88632b0', 3285 + 'phabricator-directory-css' => 'c88632b0', 3286 + 'phabricator-drag-and-drop-file-upload' => 'a5cb9310', 3287 3287 'phabricator-dropdown-menu' => '3a455e4f', 3288 - 'phabricator-flag-css' => '1da0b408', 3289 - 'phabricator-jump-nav' => '1da0b408', 3288 + 'phabricator-flag-css' => 'c88632b0', 3289 + 'phabricator-jump-nav' => 'c88632b0', 3290 3290 'phabricator-keyboard-shortcut' => '3a455e4f', 3291 3291 'phabricator-keyboard-shortcut-manager' => '3a455e4f', 3292 3292 'phabricator-menu-item' => '3a455e4f', ··· 3294 3294 'phabricator-paste-file-upload' => '3a455e4f', 3295 3295 'phabricator-prefab' => '3a455e4f', 3296 3296 'phabricator-project-tag-css' => '7839ae2d', 3297 - 'phabricator-remarkup-css' => '1da0b408', 3298 - 'phabricator-shaped-request' => 'd05e3c0f', 3299 - 'phabricator-standard-page-view' => '1da0b408', 3297 + 'phabricator-remarkup-css' => 'c88632b0', 3298 + 'phabricator-shaped-request' => 'a5cb9310', 3299 + 'phabricator-standard-page-view' => 'c88632b0', 3300 3300 'phabricator-tooltip' => '3a455e4f', 3301 - 'phabricator-transaction-view-css' => '1da0b408', 3302 - 'syntax-highlighting-css' => '1da0b408', 3301 + 'phabricator-transaction-view-css' => 'c88632b0', 3302 + 'syntax-highlighting-css' => 'c88632b0', 3303 3303 ), 3304 3304 ));
-4
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 364 364 $draft_text = null; 365 365 } 366 366 367 - $panel_id = celerity_generate_unique_node_id(); 368 - 369 367 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 370 368 371 369 if ($is_serious) { ··· 441 439 id(new AphrontFormDragAndDropUploadControl()) 442 440 ->setLabel('Attached Files') 443 441 ->setName('files') 444 - ->setDragAndDropTarget($panel_id) 445 442 ->setActivatedClass('aphront-panel-view-drag-and-drop')) 446 443 ->appendChild( 447 444 id(new AphrontFormSubmitControl()) ··· 496 493 497 494 $comment_panel = new AphrontPanelView(); 498 495 $comment_panel->appendChild($comment_form); 499 - $comment_panel->setID($panel_id); 500 496 $comment_panel->addClass('aphront-panel-accent'); 501 497 $comment_panel->setHeader($is_serious ? 'Add Comment' : 'Weigh In'); 502 498
-4
src/applications/maniphest/controller/ManiphestTaskEditController.php
··· 507 507 $form 508 508 ->appendChild($description_control); 509 509 510 - $panel_id = celerity_generate_unique_node_id(); 511 - 512 510 if (!$task->getID()) { 513 511 $form 514 512 ->appendChild( 515 513 id(new AphrontFormDragAndDropUploadControl()) 516 514 ->setLabel('Attached Files') 517 515 ->setName('files') 518 - ->setDragAndDropTarget($panel_id) 519 516 ->setActivatedClass('aphront-panel-view-drag-and-drop')); 520 517 } 521 518 ··· 528 525 $panel = new AphrontPanelView(); 529 526 $panel->setWidth(AphrontPanelView::WIDTH_FULL); 530 527 $panel->setHeader($header_name); 531 - $panel->setID($panel_id); 532 528 $panel->appendChild($form); 533 529 534 530 $description_preview_panel =
-4
src/applications/metamta/controller/PhabricatorMetaMTASendController.php
··· 90 90 'configure a real adapter.</p>'); 91 91 } 92 92 93 - $panel_id = celerity_generate_unique_node_id(); 94 - 95 93 $phdlink_href = PhabricatorEnv::getDoclink( 96 94 'article/Managing_Daemons_with_phd.html'); 97 95 ··· 139 137 id(new AphrontFormDragAndDropUploadControl()) 140 138 ->setLabel('Attach Files') 141 139 ->setName('files') 142 - ->setDragAndDropTarget($panel_id) 143 140 ->setActivatedClass('aphront-panel-view-drag-and-drop')) 144 141 ->appendChild( 145 142 id(new AphrontFormTextControl()) ··· 171 168 $panel = new AphrontPanelView(); 172 169 $panel->setHeader('Send Email'); 173 170 $panel->appendChild($form); 174 - $panel->setID($panel_id); 175 171 $panel->setWidth(AphrontPanelView::WIDTH_FORM); 176 172 177 173 $nav = $this->buildSideNavView();
-8
src/view/form/control/AphrontFormDragAndDropUploadControl.php
··· 18 18 19 19 final class AphrontFormDragAndDropUploadControl extends AphrontFormControl { 20 20 21 - private $dragAndDropTarget; 22 21 private $activatedClass; 23 22 24 23 public function __construct() { ··· 30 29 return 'aphront-form-drag-and-drop-upload'; 31 30 } 32 31 33 - public function setDragAndDropTarget($id) { 34 - $this->dragAndDropTarget = $id; 35 - return $this; 36 - } 37 - 38 32 public function setActivatedClass($class) { 39 33 $this->activatedClass = $class; 40 34 return $this; ··· 42 36 43 37 protected function renderInput() { 44 38 require_celerity_resource('aphront-attached-file-view-css'); 45 - 46 39 $list_id = celerity_generate_unique_node_id(); 47 40 48 41 $files = $this->getValue(); ··· 66 59 'value' => nonempty($value, null), 67 60 'list' => $list_id, 68 61 'uri' => '/file/dropupload/', 69 - 'target' => $this->dragAndDropTarget, 70 62 'activatedClass' => $this->activatedClass, 71 63 )); 72 64
+6
webroot/rsrc/css/aphront/form-view.css
··· 182 182 padding: 6px 8px; 183 183 } 184 184 185 + .drag-and-drop-file-target { 186 + border: 1px dashed #bfbfbf; 187 + padding-top: 10px; 188 + padding-bottom: 10px; 189 + } 190 + 185 191 .aphront-textarea-drag-and-drop { 186 192 background: #99ff99; 187 193 border-color: #669966;
+7 -2
webroot/rsrc/js/application/core/behavior-drag-and-drop.js
··· 22 22 23 23 var list = JX.$(config.list); 24 24 25 - var drop = new JX.PhabricatorDragAndDropFileUpload(JX.$(config.target)) 25 + var drop = new JX.PhabricatorDragAndDropFileUpload(JX.$(config.list)) 26 26 .setActivatedClass(config.activatedClass) 27 27 .setURI(config.uri); 28 28 ··· 70 70 } 71 71 72 72 var status; 73 + var extra = ''; 73 74 if (!pending) { 74 75 if (completed) { 75 76 status = JX.$H('<strong>Upload complete!</strong>'); ··· 77 78 arrow = String.fromCharCode(0x21EA); 78 79 status = JX.$H( 79 80 arrow + ' <strong>Drag and Drop</strong> files here to upload them.'); 81 + extra = ' drag-and-drop-file-target'; 80 82 } 81 83 } else { 82 84 status = JX.$H( 83 85 'Uploading <strong>' + parseInt(pending, 10) + '<strong> files...'); 84 86 } 85 - status = JX.$N('div', {className: 'drag-and-drop-instructions'}, status); 87 + status = JX.$N( 88 + 'div', 89 + {className: 'drag-and-drop-instructions' + extra}, 90 + status); 86 91 87 92 items.push(status); 88 93 JX.DOM.setContent(list, items);