mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
remove recent files and cleanup unused api
This commit is contained in:
@@ -37,8 +37,7 @@ import {
|
||||
Pagination,
|
||||
MinimalNodeEntryEntity,
|
||||
SiteEntry,
|
||||
SearchEntry,
|
||||
NodeEntry
|
||||
SearchEntry
|
||||
} from '@alfresco/js-api';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
@@ -240,17 +239,13 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
permissionsStyle: PermissionStyleModel[] = [];
|
||||
infiniteScrolling: boolean;
|
||||
stickyHeader: boolean;
|
||||
preselectNodes: boolean;
|
||||
warnOnMultipleUploads = false;
|
||||
thumbnails = false;
|
||||
noHeaderMode = ShowHeaderMode.Never;
|
||||
enableCustomPermissionMessage = false;
|
||||
enableMediumTimeFormat = false;
|
||||
displayEmptyMetadata = false;
|
||||
hyperlinkNavigation = false;
|
||||
|
||||
selectedNodes = [];
|
||||
|
||||
enableDownloadPrompt: boolean = this.appConfig.get('viewer.enableDownloadPrompt', false);
|
||||
enableDownloadPromptReminder: boolean = this.appConfig.get('viewer.enableDownloadPromptReminders', false);
|
||||
downloadPromptDelay = this.appConfig.get('viewer.downloadPromptDelay', 50);
|
||||
@@ -284,12 +279,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
toggleFolder() {
|
||||
this.multipleFileUpload = false;
|
||||
this.folderUpload = !this.folderUpload;
|
||||
return this.folderUpload;
|
||||
}
|
||||
|
||||
toggleThumbnails() {
|
||||
this.thumbnails = !this.thumbnails;
|
||||
this.documentList.reload();
|
||||
@@ -327,19 +316,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
takeUntil(this.onDestroy$)
|
||||
)
|
||||
.subscribe((value: any[]) => {
|
||||
let selectedNodes: NodeEntry[] = [];
|
||||
|
||||
if (this.preselectNodes) {
|
||||
if (value && value.length > 0) {
|
||||
if (this.selectionMode === 'single') {
|
||||
selectedNodes = [...[value[value.length - 1]].map((uploadedFile) => uploadedFile.data)];
|
||||
} else {
|
||||
selectedNodes = [...value.map((uploadedFile) => uploadedFile.data)];
|
||||
}
|
||||
this.selectedNodes = [...selectedNodes];
|
||||
}
|
||||
}
|
||||
|
||||
this.onFileUploadEvent(value[0]);
|
||||
});
|
||||
|
||||
@@ -459,10 +435,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.documentListReady.emit(event);
|
||||
}
|
||||
|
||||
pageIsEmpty(node: NodePaging) {
|
||||
return node && node.list && node.list.entries.length === 0;
|
||||
}
|
||||
|
||||
onContentActionError(errors: any) {
|
||||
const errorStatusCode = JSON.parse(errors.message).error.statusCode;
|
||||
let message: string;
|
||||
@@ -619,12 +591,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.turnedNextPage.emit(event);
|
||||
}
|
||||
|
||||
loadNextBatch(event: Pagination): void {
|
||||
this.pagination.maxItems = event.maxItems;
|
||||
this.pagination.skipCount = event.skipCount;
|
||||
this.loadNext.emit(event);
|
||||
}
|
||||
|
||||
onPrevPage(event: Pagination): void {
|
||||
this.pagination.maxItems = event.maxItems;
|
||||
this.pagination.skipCount = event.skipCount;
|
||||
@@ -758,32 +724,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
setPreselectNodes(nodes: string) {
|
||||
this.selectedNodes = this.getArrayFromString(nodes);
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
isStringArray(str: string): boolean {
|
||||
try {
|
||||
const result = JSON.parse(str);
|
||||
return Array.isArray(result);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private getArrayFromString<T = any>(value: string): T[] {
|
||||
if (this.isStringArray(value)) {
|
||||
return JSON.parse(value);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
onMultipleFilesUpload() {
|
||||
this.selectedNodes = [];
|
||||
}
|
||||
|
||||
onEnableDownloadPrompt() {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['enableDownloadPrompt'] = this.enableDownloadPrompt;
|
||||
@@ -813,5 +753,4 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['fileAutoDownloadSizeThresholdInMB'] = this.fileAutoDownloadSizeThresholdInMB;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user