mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
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:
@@ -1,71 +1,24 @@
|
||||
<ng-container *ngIf="nodeId">
|
||||
|
||||
<adf-alfresco-viewer
|
||||
(showViewerChange)="onViewerClosed()"
|
||||
[nodeId]="nodeId"
|
||||
[versionId]="versionId"
|
||||
[showRightSidebar]="showRightSidebar"
|
||||
[showLeftSidebar]="showLeftSidebar"
|
||||
[allowGoBack]="allowGoBack"
|
||||
[showToolbar]="showToolbar"
|
||||
[allowPrint]="allowPrint"
|
||||
[allowDownload]="allowDownload"
|
||||
[allowRightSidebar]="allowRightSidebar"
|
||||
[allowLeftSidebar]="allowLeftSidebar"
|
||||
[sidebarLeftTemplate]="sidebarLeftTemplate"
|
||||
[showToolbar]="true"
|
||||
[allowRightSidebar]="true"
|
||||
[sidebarRightTemplate]="sidebarRightTemplate">
|
||||
|
||||
<adf-viewer-toolbar *ngIf="customToolbar" data-automation-id="adf-viewer-custom-toolbar">
|
||||
<h1>My custom toolbar</h1>
|
||||
</adf-viewer-toolbar>
|
||||
|
||||
<adf-viewer-toolbar-actions *ngIf="moreActions">
|
||||
<button mat-icon-button id="adf-viewer-time">
|
||||
<mat-icon>alarm</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button id="adf-viewer-upload">
|
||||
<mat-icon>backup</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button id="adf-viewer-bug">
|
||||
<mat-icon>bug_report</mat-icon>
|
||||
</button>
|
||||
</adf-viewer-toolbar-actions>
|
||||
|
||||
<adf-viewer-more-actions *ngIf="moreActionsMenu">
|
||||
<button mat-menu-item id="adf-viewer-more-menu-alarm">
|
||||
<mat-icon>alarm</mat-icon>
|
||||
<span>Alarm</span>
|
||||
</button>
|
||||
<button mat-menu-item id="adf-viewer-more-menu-backup">
|
||||
<mat-icon>backup</mat-icon>
|
||||
<span>Backup</span>
|
||||
</button>
|
||||
<button mat-menu-item id="adf-viewer-more-menu-bug">
|
||||
<mat-icon>bug_report</mat-icon>
|
||||
<span>Bug report</span>
|
||||
</button>
|
||||
</adf-viewer-more-actions>
|
||||
|
||||
<ng-container *ngIf="openWith">
|
||||
<adf-viewer-open-with>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>dialpad</mat-icon>
|
||||
<span>Option 1</span>
|
||||
</button>
|
||||
<button mat-menu-item disabled>
|
||||
<mat-icon>voicemail</mat-icon>
|
||||
<span>Option 2</span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>notifications_off</mat-icon>
|
||||
<span>Option 3</span>
|
||||
</button>
|
||||
</adf-viewer-open-with>
|
||||
</ng-container>
|
||||
</adf-alfresco-viewer>
|
||||
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="blobFile">
|
||||
<adf-viewer
|
||||
[blobFile]="blobFile"
|
||||
[fileName]="fileName"
|
||||
[showToolbar]="true"
|
||||
[allowRightSidebar]="true"
|
||||
(showViewerChange)="onViewerClosed()"
|
||||
[sidebarRightTemplate]="sidebarRightTemplate">
|
||||
</adf-viewer>
|
||||
</ng-container>
|
||||
|
||||
<ng-template let-node="node" #sidebarRightTemplate>
|
||||
<adf-info-drawer title="Details">
|
||||
@@ -168,231 +121,3 @@
|
||||
</adf-info-drawer-tab>
|
||||
</adf-info-drawer>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #sidebarLeftTemplate>
|
||||
<adf-info-drawer [title]="'Viewer Options'">
|
||||
|
||||
<adf-info-drawer-tab label="Settings">
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-fileurl"
|
||||
(change)="toggleFileUrl()"
|
||||
[checked]="fileUrlSwitch">
|
||||
Url File
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<ng-container *ngIf="fileUrlSwitch">
|
||||
<mat-form-field floatPlaceholder="float">
|
||||
<input matInput
|
||||
placeholder="Url File"
|
||||
[(ngModel)]="urlFile"
|
||||
data-automation-id="adf-text-file-url">
|
||||
</mat-form-field>
|
||||
</ng-container>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-toolbar"
|
||||
(change)="toggleShowToolbar()"
|
||||
[checked]="showToolbar">
|
||||
Show Toolbar
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-goback"
|
||||
(change)="toggleAllowGoBack()"
|
||||
[checked]="allowGoBack">
|
||||
Allow GoBack
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-openwith"
|
||||
(change)="toggleOpenWith()"
|
||||
[checked]="openWith">
|
||||
Open With
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-moreactions"
|
||||
(change)="toggleOpenMoreActions()"
|
||||
[checked]="moreActions">
|
||||
More Actions
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-moreactionsmenu"
|
||||
(change)="toggleMoreActionsMenu()"
|
||||
[checked]="moreActionsMenu">
|
||||
More Actions Menu
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-download"
|
||||
(change)="toggleAllowDownload()"
|
||||
[checked]="allowDownload">
|
||||
Allow Download
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-print"
|
||||
(change)="toggleAllowPrint()"
|
||||
[checked]="allowPrint">
|
||||
Allow Print
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-allowsidebar"
|
||||
(change)="toggleAllowRightSidebar()"
|
||||
[checked]="allowRightSidebar">
|
||||
Allow Right Sidebar
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-switch-allowLeftSidebar"
|
||||
(change)="toggleAllowLeftSidebar()"
|
||||
[checked]="allowLeftSidebar">
|
||||
Allow Left Sidebar
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-toggle-custom-toolbar"
|
||||
(change)="toggleToolbar()"
|
||||
[checked]="customToolbar">
|
||||
Custom Toolbar
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-tab-with-icon"
|
||||
(change)="toggleShowTabWithIcon()"
|
||||
[checked]="showTabWithIcon">
|
||||
Show tab with icon
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-icon-and-label-tab"
|
||||
(change)="toggleShowTabWithIconAndLabel()"
|
||||
[checked]="showTabWithIconAndLabel">
|
||||
Show tab with icon and label
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<button mat-raised-button id="adf-switch-showrightsidebar" (click)="toggleShowRightSidebar()">
|
||||
Toggle Right Sidebar
|
||||
</button>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<button mat-raised-button id="adf-switch-showleftsidebar" (click)="hideLeftSidebar()">
|
||||
Hide Left Sidebar
|
||||
</button>
|
||||
</p>
|
||||
|
||||
</adf-info-drawer-tab>
|
||||
|
||||
<adf-info-drawer-tab
|
||||
*ngIf="showTabWithIcon"
|
||||
[label]=""
|
||||
[icon]="'face'"
|
||||
data-automation-id="adf-settings-tab">
|
||||
</adf-info-drawer-tab>
|
||||
|
||||
<adf-info-drawer-tab
|
||||
*ngIf="showTabWithIconAndLabel"
|
||||
[label]="'Comments'"
|
||||
[icon]="'comment'"
|
||||
data-automation-id="adf-settings-tab">
|
||||
</adf-info-drawer-tab>
|
||||
</adf-info-drawer>
|
||||
</ng-template>
|
||||
|
||||
<ng-container *ngIf="blobFile">
|
||||
<adf-viewer
|
||||
[blobFile]="blobFile"
|
||||
[fileName]="fileName"
|
||||
[showRightSidebar]="showRightSidebar"
|
||||
[showLeftSidebar]="showLeftSidebar"
|
||||
[allowGoBack]="allowGoBack"
|
||||
[showToolbar]="showToolbar"
|
||||
[allowRightSidebar]="allowRightSidebar"
|
||||
[allowLeftSidebar]="allowLeftSidebar"
|
||||
(showViewerChange)="onViewerClosed()"
|
||||
[sidebarLeftTemplate]="sidebarLeftTemplate"
|
||||
[sidebarRightTemplate]="sidebarRightTemplate">
|
||||
|
||||
<adf-viewer-toolbar *ngIf="customToolbar" data-automation-id="adf-viewer-custom-toolbar">
|
||||
<h1>My custom toolbar</h1>
|
||||
</adf-viewer-toolbar>
|
||||
|
||||
<adf-viewer-toolbar-actions *ngIf="moreActions">
|
||||
<button mat-icon-button id="adf-viewer-time">
|
||||
<mat-icon>alarm</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button id="adf-viewer-upload">
|
||||
<mat-icon>backup</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button id="adf-viewer-bug">
|
||||
<mat-icon>bug_report</mat-icon>
|
||||
</button>
|
||||
</adf-viewer-toolbar-actions>
|
||||
|
||||
<adf-viewer-more-actions *ngIf="moreActionsMenu">
|
||||
<button mat-menu-item id="adf-viewer-more-menu-alarm">
|
||||
<mat-icon>alarm</mat-icon>
|
||||
<span>Alarm</span>
|
||||
</button>
|
||||
<button mat-menu-item id="adf-viewer-more-menu-backup">
|
||||
<mat-icon>backup</mat-icon>
|
||||
<span>Backup</span>
|
||||
</button>
|
||||
<button mat-menu-item id="adf-viewer-more-menu-bug">
|
||||
<mat-icon>bug_report</mat-icon>
|
||||
<span>Bug report</span>
|
||||
</button>
|
||||
</adf-viewer-more-actions>
|
||||
|
||||
<ng-container *ngIf="openWith">
|
||||
<adf-viewer-open-with>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>dialpad</mat-icon>
|
||||
<span>Option 1</span>
|
||||
</button>
|
||||
<button mat-menu-item disabled>
|
||||
<mat-icon>voicemail</mat-icon>
|
||||
<span>Option 2</span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>notifications_off</mat-icon>
|
||||
<span>Option 3</span>
|
||||
</button>
|
||||
</adf-viewer-open-with>
|
||||
</ng-container>
|
||||
|
||||
</adf-viewer>
|
||||
</ng-container>
|
||||
|
@@ -1,12 +0,0 @@
|
||||
.app-viewer__sidebar {
|
||||
width: 380px !important;
|
||||
}
|
||||
|
||||
/* stylelint-disable */
|
||||
.monaco-scrollable-element {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
app-preview-extension {
|
||||
width: 600px;
|
||||
}
|
@@ -17,26 +17,16 @@
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ActivatedRoute, Router, PRIMARY_OUTLET } from '@angular/router';
|
||||
import {
|
||||
NotificationService
|
||||
} from '@alfresco/adf-core';
|
||||
import {
|
||||
ContentService,
|
||||
AllowableOperationsEnum,
|
||||
PermissionsEnum,
|
||||
NodesApiService,
|
||||
FileUploadErrorEvent
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { ContentService, AllowableOperationsEnum, PermissionsEnum, NodesApiService, FileUploadErrorEvent } from '@alfresco/adf-content-services';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-file-view',
|
||||
templateUrl: './file-view.component.html',
|
||||
styleUrls: ['./file-view.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FileViewComponent implements OnInit {
|
||||
|
||||
nodeId: string = null;
|
||||
versionId: string = null;
|
||||
displayEmptyMetadata = false;
|
||||
@@ -46,36 +36,21 @@ export class FileViewComponent implements OnInit {
|
||||
isPreset = false;
|
||||
customPreset: string = null;
|
||||
displayDefaultProperties = true;
|
||||
showToolbar = true;
|
||||
urlFile = null;
|
||||
allowGoBack = true;
|
||||
openWith = false;
|
||||
allowDownload = true;
|
||||
allowPrint = true;
|
||||
allowRightSidebar = true;
|
||||
allowLeftSidebar = true;
|
||||
moreActions = true;
|
||||
moreActionsMenu = false;
|
||||
fileUrlSwitch = false;
|
||||
showLeftSidebar = null;
|
||||
showRightSidebar = false;
|
||||
customToolbar = false;
|
||||
isCommentEnabled = false;
|
||||
showTabWithIcon = false;
|
||||
showTabWithIconAndLabel = false;
|
||||
desiredAspect: string = null;
|
||||
showAspect: string = null;
|
||||
name: string;
|
||||
fileName: string;
|
||||
blobFile: Blob;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private nodeApiService: NodesApiService,
|
||||
private contentServices: ContentService,
|
||||
private preview: PreviewService,
|
||||
private notificationService: NotificationService) {
|
||||
}
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private nodeApiService: NodesApiService,
|
||||
private contentServices: ContentService,
|
||||
private preview: PreviewService,
|
||||
private notificationService: NotificationService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params.subscribe((params) => {
|
||||
@@ -85,7 +60,8 @@ export class FileViewComponent implements OnInit {
|
||||
this.nodeApiService.getNode(id).subscribe(
|
||||
(node) => {
|
||||
if (node?.isFile) {
|
||||
this.isCommentEnabled = this.contentServices.hasPermissions(node, PermissionsEnum.NOT_CONSUMER) ||
|
||||
this.isCommentEnabled =
|
||||
this.contentServices.hasPermissions(node, PermissionsEnum.NOT_CONSUMER) ||
|
||||
this.contentServices.hasAllowableOperations(node, AllowableOperationsEnum.UPDATE);
|
||||
this.nodeId = id;
|
||||
return;
|
||||
@@ -131,66 +107,6 @@ export class FileViewComponent implements OnInit {
|
||||
this.displayDefaultProperties = !this.displayDefaultProperties;
|
||||
}
|
||||
|
||||
toggleShowToolbar() {
|
||||
this.showToolbar = !this.showToolbar;
|
||||
}
|
||||
|
||||
toggleAllowGoBack() {
|
||||
this.allowGoBack = !this.allowGoBack;
|
||||
}
|
||||
|
||||
toggleOpenWith() {
|
||||
this.openWith = !this.openWith;
|
||||
}
|
||||
|
||||
toggleAllowDownload() {
|
||||
this.allowDownload = !this.allowDownload;
|
||||
}
|
||||
|
||||
toggleAllowPrint() {
|
||||
this.allowPrint = !this.allowPrint;
|
||||
}
|
||||
|
||||
toggleOpenMoreActions() {
|
||||
this.moreActions = !this.moreActions;
|
||||
}
|
||||
|
||||
toggleMoreActionsMenu() {
|
||||
this.moreActionsMenu = !this.moreActionsMenu;
|
||||
}
|
||||
|
||||
toggleShowRightSidebar() {
|
||||
this.showRightSidebar = !this.showRightSidebar;
|
||||
}
|
||||
|
||||
hideLeftSidebar() {
|
||||
this.showLeftSidebar = false;
|
||||
}
|
||||
|
||||
toggleAllowRightSidebar() {
|
||||
this.allowRightSidebar = !this.allowRightSidebar;
|
||||
}
|
||||
|
||||
toggleAllowLeftSidebar() {
|
||||
this.allowLeftSidebar = !this.allowLeftSidebar;
|
||||
}
|
||||
|
||||
toggleShowTabWithIcon() {
|
||||
this.showTabWithIcon = !this.showTabWithIcon;
|
||||
}
|
||||
|
||||
toggleShowTabWithIconAndLabel() {
|
||||
this.showTabWithIconAndLabel = !this.showTabWithIconAndLabel;
|
||||
}
|
||||
|
||||
toggleFileUrl() {
|
||||
this.fileUrlSwitch = !this.fileUrlSwitch;
|
||||
|
||||
if (!this.fileUrlSwitch) {
|
||||
this.urlFile = null;
|
||||
}
|
||||
}
|
||||
|
||||
togglePreset() {
|
||||
this.isPreset = !this.isPreset;
|
||||
if (!this.isPreset) {
|
||||
@@ -198,10 +114,6 @@ export class FileViewComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
toggleToolbar() {
|
||||
this.customToolbar = !this.customToolbar;
|
||||
}
|
||||
|
||||
applyCustomPreset() {
|
||||
this.isPreset = false;
|
||||
setTimeout(() => {
|
||||
|
Reference in New Issue
Block a user