Protractor cleanup for demo shell (#9019)

* [ci:force] cleanup protractor tests

* [ci:force] cleanup insights test

* [ci:force] cleanup dead demo shell e2e

* [ci:force] cleanup e2e

* [ci:force] cleanup e2e

* cleanup files component

* [ci:force] cleanup e2e

* [ci:force] remove user info SSO protractor e2e

* [ci:force] remove viewer e2e already covered by other tests

* [ci:force] remove custom font from demo shell

* [ci:force] demo shell viewer cleanup

* [ci:force] cleanup viewer in demo shell

* [ci:force] rollback model changes

* [ci:force] remove site picker from content demo

* [ci:force] cleanup files demo shell component

* [ci:force] cleanup e2e and dead code

* [ci:force] cleanup dead code

* [ci:force] fix linting

* [ci:force] standalone home component

* [ci:force] cleanup demo shell app layout

* [ci:force] cleanup css

* [ci:force] cleanup demo shell logout

* Update demo-shell/src/app/components/app-layout/app-layout.component.html

Co-authored-by: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com>

---------

Co-authored-by: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com>
This commit is contained in:
Denys Vuika
2023-10-27 16:56:53 +01:00
committed by GitHub
parent 1f94c592da
commit 620911cf70
70 changed files with 102 additions and 3343 deletions

View File

@@ -1,9 +1,4 @@
<div class="app-container">
<div *ngIf="showSitePicker" class="app-site-container-style" id="site-container">
<adf-sites-dropdown (change)="onSiteChange($event)" [hideMyFiles]="false" [relations]="'members'">
</adf-sites-dropdown>
</div>
<div
id="document-list-container"
class="app-document-list-container">
@@ -14,7 +9,6 @@
[versioning]="versioning"
[adf-check-allowable-operation]="'create'"
[adf-nodes]="disableDragArea ? getCurrentDocumentListNode() : []"
(beginUpload)="onBeginUpload($event)"
(updateFileVersion)="onUploadNewVersion($event)">
<div *ngIf="errorMessage" class="app-error-message">
<button (click)="resetError()" mat-icon-button>
@@ -30,16 +24,7 @@
</adf-dropdown-breadcrumb>
</adf-toolbar-title>
<adf-toolbar-divider></adf-toolbar-divider>
<div class="app-document-action-buttons">
<button
mat-icon-button
data-automation-id="document-list-grid-view"
title="Toggle display mode"
(click)="toggleGalleryView()">
<mat-icon>list</mat-icon>
</button>
<button
data-automation-id="create-new-folder"
mat-icon-button
@@ -79,11 +64,6 @@
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item (click)="toggleGalleryView()">
<mat-icon *ngIf="displayMode === 'list'">view_comfy</mat-icon>
<mat-icon *ngIf="displayMode === 'gallery'">list</mat-icon>
<span>Card view mode</span>
</button>
<button mat-menu-item
(error)="openSnackMessageError($event)"
[adf-create-folder]="currentFolderId">
@@ -125,7 +105,6 @@
[sorting]="sorting"
[sortingMode]="sortingMode"
[showHeader]="showHeader"
[thumbnails]="thumbnails"
[stickyHeader]="stickyHeader"
[headerFilters]="headerFilters"
[filterValue]="paramValues"
@@ -147,41 +126,26 @@
<data-column
key="$thumbnail"
type="image"
[sortable]="false"
class="app-image-table-cell"
[class.adf-cell-thumbnail]="thumbnails">
[sortable]="false">
</data-column>
<data-column
*ngIf="showNameColumn && hyperlinkNavigation"
key="name"
sortingKey="name"
class="app-ellipsis-cell"
title="Display name"
[formatTooltip]="getNodeNameTooltip">
<ng-template let-context>
<adf-name-column key="name" [context]="context"></adf-name-column>
</ng-template>
</data-column>
<data-column
*ngIf="showNameColumn && !hyperlinkNavigation"
key="name"
sortingKey="name"
title="Display name"
[formatTooltip]="getNodeNameTooltip"
class="app-ellipsis-cell adf-expand-cell-5">
class="adf-expand-cell-5">
</data-column>
<data-column
key="content.sizeInBytes"
title="Size"
type="fileSize"
sortingKey="sizeInBytes"
class="app-desktop-only adf-ellipsis-cell">
class="adf-ellipsis-cell">
</data-column>
<data-column
*ngIf="searchTerm"
key="search"
title="Search"
class="app-desktop-only adf-expand-cell-3">
class="adf-expand-cell-3">
<ng-template let-entry="$implicit">
<div [innerHTML]="searchResultsHighlight(entry.row.node.entry.search) | highlight:searchTerm">
</div>
@@ -200,7 +164,7 @@
key="lock"
[focus]="false"
[sortable]="false"
class="app-desktop-only adf-ellipsis-cell">
class="adf-ellipsis-cell">
<ng-template let-entry="$implicit">
<button mat-icon-button [adf-node-lock]="entry.row.node.entry" class="app-lock-button">
<mat-icon *ngIf="entry.row.getValue('isLocked')">lock</mat-icon>
@@ -212,7 +176,7 @@
title="Created by"
key="createdByUser.displayName"
sortingKey="createdByUser"
class="app-desktop-only adf-ellipsis-cell">
class="adf-ellipsis-cell">
</data-column>
<data-column
title="Created"
@@ -220,7 +184,7 @@
sortingKey="createdAt"
type="date"
[format]="enableMediumTimeFormat ? 'medium' : 'timeAgo'"
class="app-desktop-only adf-ellipsis-cell">
class="adf-ellipsis-cell">
</data-column>
</data-columns>
@@ -240,11 +204,6 @@
(success)="onDeleteActionSuccess($event)"
handler="delete">
</content-action>
<content-action
icon="info"
title="Info"
(execute)="onManageMetadata($event)">
</content-action>
<content-action
icon="supervisor_account"
title="Permission"
@@ -269,21 +228,12 @@
</adf-document-list>
</div>
<adf-pagination
#standardPagination
*ngIf="!infiniteScrolling"
class="app-documentlist-pagination"
[target]="documentList"
(changePageSize)="onChangePageSize($event)"
(changePageNumber)="onChangePageNumber($event)"
(nextPage)="onNextPage($event)"
(prevPage)="onPrevPage($event)">
</adf-pagination>
<adf-infinite-pagination
[hidden]="!infiniteScrolling"
[target]="documentList"
[loading]="documentList.loading">
{{ 'ADF-DOCUMENT-LIST.LAYOUT.LOAD_MORE' | translate }}
</adf-infinite-pagination>
</adf-upload-drag-area>
<adf-info-drawer-layout *ngIf="showVersions" class="app-manage-versions-sidebar">
@@ -301,7 +251,7 @@
<ng-container *ngIf="userHasPermissionToManageVersions(); else no_permission_to_versions">
<adf-version-manager
[node]="documentList.selection[0].entry"
[showComments]="showVersionComments"
[showComments]="true"
[allowDownload]="allowVersionDownload">
</adf-version-manager>
</ng-container>
@@ -338,18 +288,6 @@
</div>
<div class="app-container">
<section>
<mat-slide-toggle [(ngModel)]="showNameColumn">
Show Name Column
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle [(ngModel)]="hyperlinkNavigation">
Hyperlink navigation
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle data-automation-id="multiSelectToggle" [(ngModel)]="multiselect">
Multiselect (with checkboxes)
@@ -380,42 +318,18 @@
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle id="adf-thumbnails-upload-switch" (click)="toggleThumbnails()">
Enable Thumbnails
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle id="adf-version-upload-switch" [(ngModel)]="versioning">
Enable versioning
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle (click)="onInfiniteScrolling()">
Enable Infinite Scrolling
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle [(ngModel)]="showVersionComments">
Show comments on versions
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle [(ngModel)]="allowVersionDownload">
Enable version download
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle [(ngModel)]="warnOnMultipleUploads">
Display warning for multiple uploads
</mat-slide-toggle>
</section>
<section>
<mat-slide-toggle [(ngModel)]="enableMediumTimeFormat" id="enableMediumTimeFormat">
Enable medium time format for document list
@@ -461,8 +375,7 @@
[versioning]="versioning"
[adf-check-allowable-operation]="'create'"
[adf-nodes]="enableUpload ? getCurrentDocumentListNode() : []"
(permissionEvent)="handlePermissionError($event)"
(beginUpload)="onBeginUpload($event)">
(permissionEvent)="handlePermissionError($event)">
</adf-upload-button>
</div>
<div *ngIf="acceptedFilesTypeShow">

View File

@@ -2,16 +2,6 @@
margin: 10px !important;
}
@media screen and (max-width: 599px) {
.app-container {
margin: 0;
}
.app-show-versions-button.mat-icon-button {
display: none;
}
}
.app-error-message {
text-align: left;
}
@@ -37,18 +27,6 @@
.app-document-action-buttons {
flex: 0 0 auto;
}
@media screen and (max-width: 600px) {
adf-breadcrumb, .app-document-action-buttons {
display: none;
}
}
@media screen and (min-width: 600px) {
adf-dropdown-breadcrumb, .app-toolbar-divider-before-more-menu, .app-toolbar-more-menu-button {
display: none;
}
}
}
&:not(.app-document-list-container-in-upload-drag-area) {
@@ -64,13 +42,6 @@
position: absolute;
}
.app-site-container-style {
margin-top: 10px;
margin-bottom: 10px;
width: 100%;
min-width: 200px;
}
.app-content-service-settings {
padding: 16px;
}

View File

@@ -28,29 +28,23 @@ import {
Output,
ViewEncapsulation
} from '@angular/core';
import { Location } from '@angular/common';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { NodeEntry, NodePaging, Pagination, Node, SiteEntry, SearchEntry } from '@alfresco/js-api';
import { NodeEntry, NodePaging, Pagination, Node, SearchEntry } from '@alfresco/js-api';
import {
NotificationService,
DataRow,
UserPreferencesService,
PaginationComponent,
DisplayMode,
ShowHeaderMode,
InfinitePaginationComponent,
FormRenderingService
} from '@alfresco/adf-core';
import {
ContentService,
FolderCreatedEvent,
UploadService,
DocumentListComponent,
PermissionStyleModel,
UploadFilesEvent,
ConfirmDialogComponent,
ContentMetadataService,
FilterSearch,
DialogAspectListService,
@@ -59,7 +53,6 @@ import {
} from '@alfresco/adf-content-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';
@@ -100,12 +93,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@Input()
sortingMode: 'server' | 'client' = 'server';
@Input()
showRecentFiles = true;
@Input()
showSitePicker = true;
@Input()
showSettingsPanel = true;
@@ -130,9 +117,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@Input()
maxSizeShow = false;
@Input()
showVersionComments = true;
@Input()
versioning = false;
@@ -157,9 +141,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@Input()
disableDragArea = false;
@Input()
showNameColumn = true;
@Input()
searchTerm = '';
@@ -202,24 +183,16 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@ViewChild('standardPagination')
standardPagination: PaginationComponent;
@ViewChild(InfinitePaginationComponent, { static: true })
infinitePaginationComponent: InfinitePaginationComponent;
permissionsStyle: PermissionStyleModel[] = [];
infiniteScrolling: boolean;
stickyHeader: boolean;
warnOnMultipleUploads = false;
thumbnails = false;
enableMediumTimeFormat = false;
displayEmptyMetadata = false;
hyperlinkNavigation = false;
constructor(
private notificationService: NotificationService,
private uploadService: UploadService,
private contentService: ContentService,
private dialog: MatDialog,
private location: Location,
private router: Router,
private preference: UserPreferencesService,
private preview: PreviewService,
@@ -236,11 +209,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
}
toggleThumbnails() {
this.thumbnails = !this.thumbnails;
this.documentList.reload();
}
ngOnInit() {
if (!this.pagination) {
this.pagination = {
@@ -399,7 +367,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
onManageVersions(event: any) {
const contentEntry = event.value.entry;
const showComments = this.showVersionComments;
const showComments = true;
const allowDownload = this.allowVersionDownload;
if (this.contentService.hasAllowableOperations(contentEntry, 'update')) {
@@ -421,28 +389,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
});
}
onManageMetadata(event: any) {
const contentEntry = event.value.entry;
const displayEmptyMetadata = this.displayEmptyMetadata;
if (this.contentService.hasAllowableOperations(contentEntry, 'update')) {
this.dialog.open(MetadataDialogAdapterComponent, {
data: {
contentEntry,
displayEmptyMetadata
},
panelClass: 'adf-metadata-manager-dialog',
width: '630px'
});
} else {
this.openSnackMessageError('OPERATION.ERROR.PERMISSION');
}
}
onSiteChange(site: SiteEntry) {
this.currentFolderId = site.entry.guid;
}
hasSelection(selection: Array<any>): boolean {
return selection && selection.length > 0;
}
@@ -457,13 +403,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
return this.contentService.hasAllowableOperations(selection[0].entry, 'update');
}
getNodeNameTooltip(row: DataRow): string {
if (row) {
return row.getValue('name');
}
return null;
}
canEditFolder(selection: Array<NodeEntry>): boolean {
if (selection && selection.length === 1) {
const entry = selection[0].entry;
@@ -507,44 +446,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.turnedPreviousPage.emit(event);
}
toggleGalleryView(): void {
this.displayMode = this.displayMode === DisplayMode.List ? DisplayMode.Gallery : DisplayMode.List;
const url = this.router.createUrlTree(['/files', this.currentFolderId, 'display', this.displayMode]).toString();
this.location.go(url);
}
onInfiniteScrolling(): void {
this.infiniteScrolling = !this.infiniteScrolling;
this.infinitePaginationComponent.reset();
}
onBeginUpload(event: UploadFilesEvent) {
if (this.warnOnMultipleUploads && event) {
const files = event.files || [];
if (files.length > 1) {
event.pauseUpload();
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
data: {
title: 'Upload',
message: `Are you sure you want to upload ${files.length} file(s)?`
},
minWidth: '250px'
});
dialogRef.afterClosed().subscribe((result) => {
if (result === true) {
event.resumeUpload();
}
});
}
}
}
onUploadNewVersion(ev) {
const contentEntry = ev.detail.data.node.entry;
const showComments = this.showVersionComments;
const showComments = true;
const allowDownload = this.allowVersionDownload;
const newFileVersion = ev.detail.files[0].file;

View File

@@ -1,10 +0,0 @@
<header mat-dialog-title>Metadata</header>
<section mat-dialog-content>
<adf-content-metadata-card
[node]="contentEntry"
[displayEmpty]="displayEmptyMetadata">
</adf-content-metadata-card>
</section>
<footer mat-dialog-actions>
<button mat-button (click)="close()">Close</button>
</footer>

View File

@@ -1,38 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Node } from '@alfresco/js-api';
@Component({
templateUrl: './metadata-dialog-adapter.component.html',
encapsulation: ViewEncapsulation.None
})
export class MetadataDialogAdapterComponent {
contentEntry: Node;
displayEmptyMetadata = false;
constructor(@Inject(MAT_DIALOG_DATA) data: any, private containingDialog?: MatDialogRef<MetadataDialogAdapterComponent>) {
this.contentEntry = data.contentEntry;
this.displayEmptyMetadata = data.displayEmptyMetadata;
}
close() {
this.containingDialog.close();
}
}