Skip to content

Commit

Permalink
[ACS-5743] Cleanup Content tests (Demo Shell) (#8799)
Browse files Browse the repository at this point in the history
* 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 fb3ae0b.

* [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
  • Loading branch information
DenysVuika committed Aug 1, 2023
1 parent 3f3e830 commit 9497abc
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 814 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "none",
"printWidth": 150
}
16 changes: 3 additions & 13 deletions demo-shell/resources/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
},
"PERSONAL-FILES": "Personal Files",
"WARN-MULTIPLE-UPLOADS": "Display warning for multiple uploads.",
"CUSTOM-PERMISSION-MESSAGE": "Enable custom permission message",
"MEDIUM-TIME-FORMAT": "Enable medium time format for document list",
"SEARCH": {
"RADIO": {
Expand Down Expand Up @@ -160,12 +159,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",
Expand All @@ -179,6 +172,8 @@
"DELETED_BY": "Deleted by"
},
"TOOLBAR": {
"TOGGLE_DISPLAY_MODE": "Toggle display mode",
"TOGGLE_METADATA": "Toggle metadata",
"CARDVIEW": "Card view mode",
"SHARE_EDIT": "Edit settings",
"NEW_FOLDER": "New folder",
Expand All @@ -187,10 +182,6 @@
"DELETE": "Delete",
"FAVORITES": "Add to favorites",
"SHARE": "Share",
"THEME": "Select a theme",
"SHOW_VERSION": "Show version",
"HIDE_VERSION": "Hide version",
"LISTVIEW": "List view mode",
"CREATE_LIBRARY": "Create Library"
},
"ACTIONS": {
Expand All @@ -208,8 +199,7 @@
"DOCUMENT": {
"COPY": "Copy",
"MOVE": "Move",
"DELETE": "Delete",
"PROCESS_ACTION": "Start Process"
"DELETE": "Delete"
}
}
},
Expand Down
170 changes: 17 additions & 153 deletions demo-shell/src/app/components/files/files.component.html
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -51,7 +22,7 @@
</button>
<span class="app-error-message--text">{{errorMessage}}</span>
</div>
<adf-toolbar *ngIf="!disableDragArea" [color]="toolbarColor" class="app-files-toolbar">
<adf-toolbar *ngIf="!disableDragArea" class="app-files-toolbar">
<adf-toolbar-title>
<adf-breadcrumb
class="app-files-breadcrumb"
Expand All @@ -70,14 +41,9 @@
<button
mat-icon-button
data-automation-id="document-list-grid-view"
title="{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}"
title="{{ 'DOCUMENT_LIST.TOOLBAR.TOGGLE_DISPLAY_MODE' | translate }}"
(click)="toggleGalleryView()">
<mat-icon *ngIf="displayMode === 'list'"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}">view_comfy
</mat-icon>
<mat-icon *ngIf="displayMode === 'gallery'"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.LISTVIEW' | translate }}">list
</mat-icon>
<mat-icon>list</mat-icon>
</button>
<button
data-automation-id="create-new-folder"
Expand All @@ -86,13 +52,12 @@
title="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}"
(error)="openSnackMessageError($event)"
(success)="documentList.reload()"
[adf-create-folder]="currentFolderId"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}">
[adf-create-folder]="currentFolderId">
<mat-icon>create_new_folder</mat-icon>
</button>
<button
mat-icon-button
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.CREATE_LIBRARY' | translate }}"
title="{{ 'DOCUMENT_LIST.TOOLBAR.CREATE_LIBRARY' | translate }}"
data-automation-id="create-new-library"
(click)="createLibrary()">
<mat-icon>library_add</mat-icon>
Expand All @@ -104,15 +69,13 @@
title="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}"
(error)="openSnackMessageError($event)"
[adf-edit-folder]="documentList.selection[0]?.entry"
(success)="documentList.reload()"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}">
(success)="documentList.reload()">
<mat-icon>create</mat-icon>
</button>
<button mat-icon-button
[disabled]="!hasSelection(documentList.selection)"
title="{{ 'DOCUMENT_LIST.TOOLBAR.DOWNLOAD' | translate }}"
[adfNodeDownload]="documentList.selection"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.DOWNLOAD' | translate }}">
[adfNodeDownload]="documentList.selection">
<mat-icon>get_app</mat-icon>
</button>
<button mat-icon-button
Expand All @@ -122,8 +85,7 @@
[adf-nodes]="documentList.selection"
title="{{ 'DOCUMENT_LIST.TOOLBAR.DELETE' | translate }}"
(delete)="onDeleteActionSuccess($event)"
[adf-delete]="documentList.selection"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.DELETE' | translate }}">
[adf-delete]="documentList.selection">
<mat-icon>delete</mat-icon>
</button>
<button
Expand All @@ -132,17 +94,15 @@
[disabled]="!documentList.selection.length"
#favorite="adfFavorite"
[adf-node-favorite]="documentList.selection"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.FAVORITES' | translate }}">
<mat-icon>
{{ favorite.hasFavorites() ? 'star' :'star_border' }}
</mat-icon>
title="{{ 'DOCUMENT_LIST.TOOLBAR.FAVORITES' | translate }}">
<mat-icon>{{ favorite.hasFavorites() ? 'star' :'star_border' }}</mat-icon>
</button>
<button mat-icon-button
[disabled]="documentList.selection.length && !shareRef.isFile"
[baseShareUrl]="baseShareUrl"
#shareRef="adfShare"
[adf-share]="documentList.selection[0]"
[matTooltip]="(shareRef.isShared
[title]="(shareRef.isShared
? 'DOCUMENT_LIST.TOOLBAR.SHARE_EDIT'
: 'DOCUMENT_LIST.TOOLBAR.SHARE') | translate">
<mat-icon>
Expand All @@ -151,25 +111,9 @@
</button>
</div>

<button mat-icon-button [matMenuTriggerFor]="themePicker"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.THEME' | translate }}">
<mat-icon>format_color_fill</mat-icon>
</button>

<mat-menu #themePicker="matMenu">
<button mat-menu-item (click)="toolbarColor = null">Default</button>
<button mat-menu-item (click)="toolbarColor = 'primary'">Primary</button>
<button mat-menu-item (click)="toolbarColor = 'accent'">Accent</button>
<button mat-menu-item (click)="toolbarColor = 'warn'">Warn</button>
</mat-menu>

<button mat-icon-button (click)="showVersions = !showVersions" class="app-show-versions-button">
<mat-icon *ngIf="!showVersions" matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.SHOW_VERSION' | translate }}">
chevron_left
</mat-icon>
<mat-icon *ngIf="showVersions" matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.HIDE_VERSION' | translate }}">
chevron_right
</mat-icon>
<button mat-icon-button (click)="showVersions = !showVersions" class="app-show-versions-button"
title="{{ 'DOCUMENT_LIST.TOOLBAR.TOGGLE_METADATA' | translate }}">
<mat-icon>{{ showVersions ? 'chevron_right' : 'chevron_left' }}</mat-icon>
</button>

<adf-toolbar-divider class="app-toolbar-divider-before-more-menu"></adf-toolbar-divider>
Expand All @@ -178,8 +122,7 @@
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item
(click)="toggleGalleryView()">
<button mat-menu-item (click)="toggleGalleryView()">
<mat-icon *ngIf="displayMode === 'list'">view_comfy</mat-icon>
<mat-icon *ngIf="displayMode === 'gallery'">list</mat-icon>
<span>{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}</span>
Expand Down Expand Up @@ -243,9 +186,6 @@
(name-click)="documentList.onNodeDblClick($any($event).detail?.node)"
(filterSelection)="onFilterSelected($event)">

<adf-custom-no-permission-template *ngIf="enableCustomPermissionMessage">
<h1>You don't have permissions</h1>
</adf-custom-no-permission-template>
<adf-custom-empty-content-template *ngIf="disableDragArea">
<div class="app-empty_template">
<div class="app-no-result-message">{{ 'SEARCH.NO_RESULT' | translate }}</div>
Expand Down Expand Up @@ -278,15 +218,6 @@ <h1>You don't have permissions</h1>
[formatTooltip]="getNodeNameTooltip"
class="app-ellipsis-cell adf-expand-cell-5">
</data-column>
<!-- Location column demo -->
<!--
<data-column
key="path"
type="location"
format="/files"
title="Location">
</data-column>
-->
<data-column
key="content.sizeInBytes"
title="{{'DOCUMENT_LIST.COLUMNS.SIZE' | translate}}"
Expand All @@ -304,17 +235,7 @@ <h1>You don't have permissions</h1>
</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}}"
Expand Down Expand Up @@ -353,26 +274,6 @@ <h1>You don't have permissions</h1>
</data-columns>

<content-actions>
<!-- Conditional actions demo -->
<content-action
target="all"
title="Action for 'custom' node"
[disabled]="isCustomActionDisabled"
(execute)="runCustomAction($event)">
</content-action>
<content-action
icon="get_app"
title="Download this file now!"
handler="download"
[visible]="canDownloadNode">
</content-action>
<content-action
icon="get_app"
title="Never see this action again"
handler="download"
[visible]="false">
</content-action>
<!-- common actions -->
<content-action
icon="get_app"
title="DOCUMENT_LIST.ACTIONS.DOWNLOAD"
Expand Down Expand Up @@ -424,13 +325,6 @@ <h1>You don't have permissions</h1>
title="DOCUMENT_LIST.ACTIONS.VERSIONS"
(execute)="onManageVersions($event)">
</content-action>
<content-action
target="document"
*ngIf="authenticationService.isBpmLoggedIn()"
icon="play_arrow"
title="DOCUMENT_LIST.ACTIONS.DOCUMENT.PROCESS_ACTION"
(execute)="startProcessAction($event)">
</content-action>
<content-action
target="document"
icon="lock"
Expand Down Expand Up @@ -504,15 +398,6 @@ <h1>You don't have permissions</h1>
</div>
</div>

<div *ngIf="processId">
<adf-start-process
[values]="formValues"
[appId]="processId"
(start)="closeStartProcess()"
(cancel)="closeStartProcess()">
</adf-start-process>
</div>

<div *ngIf="showSettingsPanel" class="app-content-service-settings">

<p>Current folder ID: {{ documentList.currentFolderId }}</p>
Expand Down Expand Up @@ -546,7 +431,7 @@ <h1>You don't have permissions</h1>
</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>
Expand Down Expand Up @@ -613,12 +498,6 @@ <h1>You don't have permissions</h1>
</mat-slide-toggle>
</section>

<section>
<mat-slide-toggle color="primary" [(ngModel)]="enableCustomPermissionMessage">
{{'APP.CUSTOM-PERMISSION-MESSAGE' | translate}}
</mat-slide-toggle>
</section>

<section>
<mat-slide-toggle color="primary" [(ngModel)]="enableMediumTimeFormat" id="enableMediumTimeFormat">
{{'APP.MEDIUM-TIME-FORMAT' | translate}}
Expand All @@ -639,21 +518,6 @@ <h1>You don't have permissions</h1>
</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()">
Expand Down
19 changes: 0 additions & 19 deletions demo-shell/src/app/components/files/files.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}

0 comments on commit 9497abc

Please sign in to comment.