[ACS-5743] Cleanup Content tests (Demo Shell) (#8799)

* remove unused demo shell api

* remove recent files and cleanup unused api

* cleanup upload dialog page

* [ci:force] dummy commit

* [ci:force] cleanup the toolbar and tooltips

* [ci:force] remove dead code

* [ci:force] remove logger and custom action

* [ci:force] remove custom permission e2e test as already tested by unit

* [ci:force] remove "Start process" from the Content demo as not related to document list

* [ci:force] remove useless divs for selection

* [ci:force] dummy change to trigger CI/CD

* Revert "[ci:force] remove useless divs for selection"

This reverts commit fb3ae0b439.

* [ci:force] remove e2e for artificial scenario

* [ci:force] cleanup unused navigation bar protractor api

* [ci:force] cleanup unused datatable protractor api

* [ci:force] cleanup unused login protractor api

* [ci:force] fix process cloud demo page selector
This commit is contained in:
Denys Vuika
2023-08-01 18:48:19 +01:00
committed by GitHub
parent 3f3e83057d
commit 9497abcb43
18 changed files with 42 additions and 814 deletions

View File

@@ -37,20 +37,15 @@ import {
Pagination,
MinimalNodeEntryEntity,
SiteEntry,
SearchEntry,
NodeEntry
SearchEntry
} from '@alfresco/js-api';
import {
AlfrescoApiService,
AuthenticationService,
AppConfigService,
AppConfigValues,
LogService,
NotificationService,
DataRow,
UserPreferencesService,
PaginationComponent,
FormValues,
DisplayMode,
ShowHeaderMode,
InfinitePaginationComponent,
@@ -73,15 +68,12 @@ import {
NodesApiService,
SharedLinksApiService
} from '@alfresco/adf-content-services';
import { SelectAppsDialogComponent, ProcessFormRenderingService } from '@alfresco/adf-process-services';
import { ProcessFormRenderingService } from '@alfresco/adf-process-services';
import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component';
import { MetadataDialogAdapterComponent } from './metadata-dialog-adapter.component';
import { Subject } from 'rxjs';
import { PreviewService } from '../../services/preview.service';
import { takeUntil, debounceTime, scan } from 'rxjs/operators';
import { ThemePalette } from '@angular/material/core';
const DEFAULT_FOLDER_TO_SHOW = '-my-';
@@ -110,8 +102,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.appConfig.get<string>(AppConfigValues.BASESHAREURL) ||
this.appConfig.get<string>(AppConfigValues.ECMHOST)) + '/preview/s/';
toolbarColor: ThemePalette;
selectionModes = [
{value: 'none', viewValue: 'None'},
{value: 'single', viewValue: 'Single'},
@@ -122,10 +112,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@Input()
currentFolderId: string = DEFAULT_FOLDER_TO_SHOW;
formValues: FormValues = {};
processId;
@Input()
sorting = ['name', 'ASC'];
@@ -240,18 +226,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);
enableDownloadPrompt = this.appConfig.get<boolean>('viewer.enableDownloadPrompt', false);
enableDownloadPromptReminder: boolean = this.appConfig.get('viewer.enableDownloadPromptReminders', false);
downloadPromptDelay = this.appConfig.get('viewer.downloadPromptDelay', 50);
downloadPromptReminderDelay = this.appConfig.get('viewer.downloadPromptReminderDelay', 30);
@@ -264,13 +245,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
private dialog: MatDialog,
private location: Location,
private router: Router,
private logService: LogService,
private appConfig: AppConfigService,
private preference: UserPreferencesService,
private preview: PreviewService,
@Optional() private route: ActivatedRoute,
public authenticationService: AuthenticationService,
public alfrescoApiService: AlfrescoApiService,
private contentMetadataService: ContentMetadataService,
private sharedLinksApiService: SharedLinksApiService,
private dialogAspectListService: DialogAspectListService,
@@ -284,12 +262,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 +299,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]);
});
@@ -421,15 +380,12 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
onFolderCreated(event: FolderCreatedEvent) {
this.logService.log('FOLDER CREATED');
this.logService.log(event);
if (event && event.parentId === this.documentList.currentFolderId) {
this.documentList.reload();
}
}
onFolderAction(node) {
this.logService.log(node);
if (node && node.parentId === this.documentList.currentFolderId) {
this.documentList.reload();
}
@@ -459,10 +415,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;
@@ -582,24 +534,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
return false;
}
startProcessAction($event: any) {
this.formValues['file'] = $event.value.entry;
const dialogRef = this.dialog.open(SelectAppsDialogComponent, {
width: '630px',
panelClass: 'adf-version-manager-dialog'
});
dialogRef.afterClosed().subscribe((selectedProcess) => {
this.processId = selectedProcess.id;
});
}
closeStartProcess() {
this.processId = null;
}
onChangePageSize(event: Pagination): void {
this.preference.paginationSize = event.maxItems;
this.pagination.maxItems = event.maxItems;
@@ -619,12 +553,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;
@@ -646,10 +574,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.infinitePaginationComponent.reset();
}
canDownloadNode(node: MinimalNodeEntity): boolean {
return node && node.entry && node.entry.name === 'custom';
}
onBeginUpload(event: UploadFilesEvent) {
if (this.warnOnMultipleUploads && event) {
const files = event.files || [];
@@ -673,14 +597,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
}
isCustomActionDisabled(node: MinimalNodeEntity): boolean {
return !(node && node.entry && node.entry.name === 'custom');
}
runCustomAction(event: any) {
this.logService.log(event);
}
onUploadNewVersion(ev) {
const contentEntry = ev.detail.data.node.entry;
const showComments = this.showVersionComments;
@@ -758,32 +674,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 +703,4 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
const previewConfig = this.appConfig?.config['viewer'];
previewConfig['fileAutoDownloadSizeThresholdInMB'] = this.fileAutoDownloadSizeThresholdInMB;
}
}