[AAE-7243] fix process services eslint warnings (#7498)

* fix process services eslint warnings

* fix constants

* revert type changes
This commit is contained in:
Denys Vuika
2022-02-17 13:07:13 +00:00
committed by GitHub
parent 1a6746ff3c
commit e017423c8c
91 changed files with 1863 additions and 1920 deletions

View File

@@ -114,41 +114,11 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit
});
}
private loadAttachmentsByTaskId(taskId: string) {
if (taskId) {
this.isLoading = true;
this.reset();
const isRelatedContent = 'true';
this.activitiContentService.getTaskRelatedContent(taskId, { isRelatedContent }).subscribe(
(res: any) => {
const attachList = [];
res.data.forEach((content) => {
attachList.push({
id: content.id,
name: content.name,
created: content.created,
createdBy: content.createdBy.firstName + ' ' + content.createdBy.lastName,
icon: this.thumbnailService.getMimeTypeIcon(content.mimeType)
});
});
this.attachments = attachList;
this.success.emit(this.attachments);
this.isLoading = false;
},
(err) => {
this.error.emit(err);
this.isLoading = false;
});
}
}
deleteAttachmentById(contentId: number) {
if (contentId) {
this.activitiContentService.deleteRelatedContent(contentId).subscribe(
() => {
this.attachments = this.attachments.filter((content) => {
return content.id !== contentId;
});
this.attachments = this.attachments.filter((content) => content.id !== contentId);
},
(err) => {
this.error.emit(err);
@@ -227,4 +197,32 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit
isDisabled(): boolean {
return this.disabled;
}
private loadAttachmentsByTaskId(taskId: string) {
if (taskId) {
this.isLoading = true;
this.reset();
const isRelatedContent = 'true';
this.activitiContentService.getTaskRelatedContent(taskId, { isRelatedContent }).subscribe(
(res: any) => {
const attachList = [];
res.data.forEach((content) => {
attachList.push({
id: content.id,
name: content.name,
created: content.created,
createdBy: content.createdBy.firstName + ' ' + content.createdBy.lastName,
icon: this.thumbnailService.getMimeTypeIcon(content.mimeType)
});
});
this.attachments = attachList;
this.success.emit(this.attachments);
this.isLoading = false;
},
(err) => {
this.error.emit(err);
this.isLoading = false;
});
}
}
}