@@ -33,6 +33,7 @@ rules:
|
|||||||
no-fallthrough: error
|
no-fallthrough: error
|
||||||
no-mixed-spaces-and-tabs: error
|
no-mixed-spaces-and-tabs: error
|
||||||
no-unused-vars: warn
|
no-unused-vars: warn
|
||||||
|
no-useless-escape: warn
|
||||||
no-use-before-define: error
|
no-use-before-define: error
|
||||||
semi: ["error", "always"]
|
semi: ["error", "always"]
|
||||||
indent:
|
indent:
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class AttachmentListController {
|
|||||||
insertText = ``;
|
insertText = ``;
|
||||||
}
|
}
|
||||||
return insertText;
|
return insertText;
|
||||||
};
|
}
|
||||||
|
|
||||||
select(attachment) {
|
select(attachment) {
|
||||||
this.onSelect({attachment: this.getAttachmentMarkdown(attachment)});
|
this.onSelect({attachment: this.getAttachmentMarkdown(attachment)});
|
||||||
|
|||||||
@@ -42,14 +42,10 @@ export default class FileService {
|
|||||||
{
|
{
|
||||||
requesttoken: oc_requesttoken,
|
requesttoken: oc_requesttoken,
|
||||||
type: 'deck_file',
|
type: 'deck_file',
|
||||||
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
fileItem.headers =
|
fileItem.headers = {requesttoken: oc_requesttoken};
|
||||||
{
|
|
||||||
requesttoken: oc_requesttoken,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.uploader.uploadItem(fileItem);
|
this.uploader.uploadItem(fileItem);
|
||||||
}
|
}
|
||||||
@@ -97,7 +93,7 @@ export default class FileService {
|
|||||||
attachments = attachments.splice(index, 1);
|
attachments = attachments.splice(index, 1);
|
||||||
}
|
}
|
||||||
this.cardservice.get(item.cardId).attachments.push(response);
|
this.cardservice.get(item.cardId).attachments.push(response);
|
||||||
};
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class FileServiceTest extends TestCase {
|
|||||||
private function mockGetUploadedFileEmpty() {
|
private function mockGetUploadedFileEmpty() {
|
||||||
$this->request->expects($this->once())
|
$this->request->expects($this->once())
|
||||||
->method('getUploadedFile')
|
->method('getUploadedFile')
|
||||||
->willReturn(null);
|
->willReturn([]);
|
||||||
}
|
}
|
||||||
private function mockGetUploadedFileError($error) {
|
private function mockGetUploadedFileError($error) {
|
||||||
$this->request->expects($this->once())
|
$this->request->expects($this->once())
|
||||||
@@ -107,6 +107,9 @@ class FileServiceTest extends TestCase {
|
|||||||
*/
|
*/
|
||||||
public function testCreateEmpty() {
|
public function testCreateEmpty() {
|
||||||
$attachment = $this->getAttachment();
|
$attachment = $this->getAttachment();
|
||||||
|
$this->l10n->expects($this->any())
|
||||||
|
->method('t')
|
||||||
|
->willReturn('Error');
|
||||||
$this->mockGetUploadedFileEmpty();
|
$this->mockGetUploadedFileEmpty();
|
||||||
$this->fileService->create($attachment);
|
$this->fileService->create($attachment);
|
||||||
}
|
}
|
||||||
@@ -117,6 +120,9 @@ class FileServiceTest extends TestCase {
|
|||||||
public function testCreateError() {
|
public function testCreateError() {
|
||||||
$attachment = $this->getAttachment();
|
$attachment = $this->getAttachment();
|
||||||
$this->mockGetUploadedFileError(UPLOAD_ERR_INI_SIZE);
|
$this->mockGetUploadedFileError(UPLOAD_ERR_INI_SIZE);
|
||||||
|
$this->l10n->expects($this->any())
|
||||||
|
->method('t')
|
||||||
|
->willReturn('Error');
|
||||||
$this->fileService->create($attachment);
|
$this->fileService->create($attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user