mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Move Maniphest attached files section into textbox.
Summary: Add a button to the Remarkup area that explains how to attach an image and remove the separate upload field. Test Plan: Check that the dialog pops up correctly and that dropping images onto the Remarkup area works. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, AnhNhan Maniphest Tasks: T879 Differential Revision: https://secure.phabricator.com/D6049
This commit is contained in:
parent
ef797494ca
commit
59bb8ca9dd
7 changed files with 31 additions and 15 deletions
|
@ -1009,6 +1009,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFileTestDataGenerator' => 'applications/files/lipsum/PhabricatorFileTestDataGenerator.php',
|
||||
'PhabricatorFileTransformController' => 'applications/files/controller/PhabricatorFileTransformController.php',
|
||||
'PhabricatorFileUploadController' => 'applications/files/controller/PhabricatorFileUploadController.php',
|
||||
'PhabricatorFileUploadDialogController' => 'applications/files/controller/PhabricatorFileUploadDialogController.php',
|
||||
'PhabricatorFileUploadException' => 'applications/files/exception/PhabricatorFileUploadException.php',
|
||||
'PhabricatorFilesConfigOptions' => 'applications/files/config/PhabricatorFilesConfigOptions.php',
|
||||
'PhabricatorFilesManagementEnginesWorkflow' => 'applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php',
|
||||
|
@ -2805,6 +2806,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFileTestDataGenerator' => 'PhabricatorTestDataGenerator',
|
||||
'PhabricatorFileTransformController' => 'PhabricatorFileController',
|
||||
'PhabricatorFileUploadController' => 'PhabricatorFileController',
|
||||
'PhabricatorFileUploadDialogController' => 'PhabricatorFileController',
|
||||
'PhabricatorFileUploadException' => 'Exception',
|
||||
'PhabricatorFilesConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorFilesManagementEnginesWorkflow' => 'PhabricatorFilesManagementWorkflow',
|
||||
|
|
|
@ -49,6 +49,7 @@ final class PhabricatorApplicationFiles extends PhabricatorApplication {
|
|||
'proxy/' => 'PhabricatorFileProxyController',
|
||||
'xform/(?P<transform>[^/]+)/(?P<phid>[^/]+)/(?P<key>[^/]+)/'
|
||||
=> 'PhabricatorFileTransformController',
|
||||
'uploaddialog/' => 'PhabricatorFileUploadDialogController',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorFileUploadDialogController
|
||||
extends PhabricatorFileController {
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
$user = $request->getUser();
|
||||
|
||||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle(pht('Upload Image'))
|
||||
->appendChild(pht(
|
||||
'To add files, drag and drop them into the comment text area.'))
|
||||
->addCancelButton('/', pht('Close'));
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
}
|
||||
|
||||
}
|
|
@ -257,11 +257,6 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
->setValue($draft_text)
|
||||
->setID('transaction-comments')
|
||||
->setUser($user))
|
||||
->appendChild(
|
||||
id(new AphrontFormDragAndDropUploadControl())
|
||||
->setLabel(pht('Attached Files'))
|
||||
->setName('files')
|
||||
->setActivatedClass('aphront-panel-view-drag-and-drop'))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue($is_serious ? pht('Submit') : pht('Avast!')));
|
||||
|
|
|
@ -485,15 +485,6 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
$form
|
||||
->appendChild($description_control);
|
||||
|
||||
if (!$task->getID()) {
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormDragAndDropUploadControl())
|
||||
->setLabel(pht('Attached Files'))
|
||||
->setName('files')
|
||||
->setActivatedClass('aphront-panel-view-drag-and-drop'));
|
||||
}
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
|
|
|
@ -54,8 +54,12 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
|
|||
),
|
||||
'table' => array(
|
||||
'tip' => pht('Table'),
|
||||
)
|
||||
),
|
||||
'image' => array(
|
||||
'tip' => pht('Upload File'),
|
||||
),
|
||||
);
|
||||
|
||||
if (!$this->disableMacro and function_exists('imagettftext')) {
|
||||
$actions[] = array(
|
||||
'spacer' => true,
|
||||
|
|
|
@ -174,6 +174,9 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
|
|||
})
|
||||
.start();
|
||||
break;
|
||||
case 'image':
|
||||
new JX.Workflow('/file/uploaddialog/').start();
|
||||
break;
|
||||
case 'chaos':
|
||||
if (edit_mode == 'chaos') {
|
||||
set_edit_mode(root, 'normal');
|
||||
|
|
Loading…
Reference in a new issue