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:
@@ -160,12 +160,6 @@
|
||||
"DESCRIPTION_UPLOAD": "Enable upload",
|
||||
"ENABLE_INFINITE_SCROLL": "Enable Infinite Scrolling",
|
||||
"MULTISELECT_DESCRIPTION": "Use Cmd (Mac) or Ctrl (Windows) to toggle selection of multiple items",
|
||||
"RECENT": {
|
||||
"EMPTY_STATE": {
|
||||
"TITLE": "Recent Files list is empty"
|
||||
},
|
||||
"TITLE": "Recent Files"
|
||||
},
|
||||
"COLUMNS": {
|
||||
"DISPLAY_NAME": "Display name",
|
||||
"IS_LOCKED": "Lock",
|
||||
|
@@ -1,33 +1,4 @@
|
||||
<div class="app-container">
|
||||
|
||||
<mat-accordion *ngIf="showRecentFiles" class="app-container-recent">
|
||||
<mat-expansion-panel hideToggle="true">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{ 'DOCUMENT_LIST.RECENT.TITLE' | translate }}
|
||||
<mat-icon>history</mat-icon>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<adf-document-list
|
||||
[currentFolderId]="'-recent-'"
|
||||
locationFormat="/files"
|
||||
[display]="'gallery'"
|
||||
[preselectNodes]="selectedNodes"
|
||||
[showHeader]="noHeaderMode"
|
||||
[maxItems]="5"
|
||||
(preview)="showFile($event)"
|
||||
selectionMode="null">
|
||||
<adf-custom-empty-content-template>
|
||||
<div class="app-empty-list__block">
|
||||
<mat-icon>history</mat-icon>
|
||||
<p class="app-empty-list__title">{{ 'DOCUMENT_LIST.RECENT.EMPTY_STATE.TITLE' | translate}}</p>
|
||||
</div>
|
||||
</adf-custom-empty-content-template>
|
||||
</adf-document-list>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
|
||||
<div *ngIf="showSitePicker" class="app-site-container-style" id="site-container">
|
||||
<adf-sites-dropdown (change)="onSiteChange($event)" [hideMyFiles]="false" [relations]="'members'">
|
||||
</adf-sites-dropdown>
|
||||
@@ -304,17 +275,7 @@
|
||||
</div>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
<!-- Notes: has performance overhead due to multiple files/folders causing separate HTTP calls to get tags -->
|
||||
<!--
|
||||
<data-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.TAG' | translate}}"
|
||||
key="id"
|
||||
class="app-full-width adf-ellipsis-cell">
|
||||
<ng-template let-entry="$implicit">
|
||||
<alfresco-tag-node-list [nodeId]="entry.data.getValue(entry.row, entry.col)"></alfresco-tag-node-list>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
-->
|
||||
|
||||
<data-column
|
||||
class="app-full-width adf-ellipsis-cell adf-desktop-only"
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.NODE_ID' | translate}}"
|
||||
@@ -546,7 +507,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle id="adf-multiple-upload-switch" [color]="'primary'" (change)="onMultipleFilesUpload()" [(ngModel)]="multipleFileUpload" >
|
||||
<mat-slide-toggle id="adf-multiple-upload-switch" [color]="'primary'" [(ngModel)]="multipleFileUpload" >
|
||||
{{'DOCUMENT_LIST.MULTIPLE_FILE_UPLOAD' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
@@ -639,21 +600,6 @@
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle
|
||||
color="primary" [(ngModel)]="preselectNodes" id="preselectNodes">
|
||||
Preselect Nodes
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<form class="example-form">
|
||||
<mat-form-field *ngIf="preselectNodes" class="adf-preselect-nodes-input">
|
||||
<input matInput
|
||||
(input)="setPreselectNodes($any($event).target?.value)"
|
||||
placeholder="NodeEntry[] => [{ entry: { isFile: true, id: 'node-id' }}, { entry: { isFile: true, id: 'node-id' }} ]">
|
||||
</mat-form-field>
|
||||
</form>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle
|
||||
color="primary" [(ngModel)]="enableDownloadPrompt" id="enableDownloadPrompt" (change)="onEnableDownloadPrompt()">
|
||||
|
@@ -103,22 +103,3 @@
|
||||
line-height: 1.33;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
|
||||
.app-container-recent {
|
||||
mat-icon {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.app-empty-list__block {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.adf-preselect-nodes-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -44,16 +44,6 @@ export class UploadTogglesPage {
|
||||
await this.togglePage.enableToggle(this.uploadFolderToggle);
|
||||
}
|
||||
|
||||
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const enabledFolderUpload = $('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledFolderUpload);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async checkMultipleFileUploadToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = $('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
@@ -69,19 +59,6 @@ export class UploadTogglesPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async disableFolderUpload(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.uploadFolderToggle);
|
||||
}
|
||||
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const inactiveToggleFolder = $('#adf-folder-upload-switch .mat-slide-toggle-label');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(inactiveToggleFolder);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async enableExtensionFilter(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
|
||||
await this.togglePage.enableToggle(this.extensionFilterToggle);
|
||||
@@ -125,5 +102,4 @@ export class UploadTogglesPage {
|
||||
async clearText(): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.maxSizeField, '');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user