mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
@@ -1,24 +0,0 @@
|
||||
<adf-toolbar>
|
||||
<adf-toolbar-title>
|
||||
<mat-form-field>
|
||||
<mat-select [(ngModel)]="selectedSource" data-automation-id="custom-sources-select">
|
||||
<mat-option *ngFor="let source of sources" [value]="source.value">
|
||||
{{ source.title }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</adf-toolbar-title>
|
||||
<adf-toolbar-divider></adf-toolbar-divider>
|
||||
<button mat-icon-button
|
||||
[disabled]="!hasSelection(customSourcesDocumentList.selection)"
|
||||
title="Download"
|
||||
[adfNodeDownload]="customSourcesDocumentList.selection">
|
||||
<mat-icon>get_app</mat-icon>
|
||||
</button>
|
||||
</adf-toolbar>
|
||||
<adf-document-list
|
||||
#customSourcesDocumentList
|
||||
[currentFolderId]="selectedSource"
|
||||
locationFormat="/files"
|
||||
selectionMode="multiple">
|
||||
</adf-document-list>
|
@@ -1,49 +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, Input, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { DocumentListComponent } from '@alfresco/adf-content-services';
|
||||
|
||||
@Component({
|
||||
selector: 'app-custom-sources',
|
||||
templateUrl: './custom-sources.component.html',
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class CustomSourcesComponent {
|
||||
|
||||
@Input()
|
||||
selectedSource = '-recent-';
|
||||
|
||||
@ViewChild('customSourcesDocumentList', { static: true })
|
||||
documentList: DocumentListComponent;
|
||||
|
||||
sources = [
|
||||
{ title: 'Favorites', value: '-favorites-' },
|
||||
{ title: 'Recent', value: '-recent-' },
|
||||
{ title: 'Shared Links', value: '-sharedlinks-' },
|
||||
{ title: 'Sites', value: '-sites-' },
|
||||
{ title: 'My Sites', value: '-mysites-' },
|
||||
{ title: 'Trashcan', value: '-trashcan-' },
|
||||
{ title: 'Root', value: '-root-' },
|
||||
{ title: 'My', value: '-my-' },
|
||||
{ title: 'Shared', value: '-shared-' }
|
||||
];
|
||||
|
||||
hasSelection(selection: any[]): boolean {
|
||||
return selection && selection.length > 0;
|
||||
}
|
||||
}
|
@@ -1,41 +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 { NgModule } from '@angular/core';
|
||||
import { CustomSourcesComponent } from './custom-sources.component';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { ContentModule } from '@alfresco/adf-content-services';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: CustomSourcesComponent
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(routes),
|
||||
CoreModule,
|
||||
ContentModule.forChild()
|
||||
],
|
||||
declarations: [CustomSourcesComponent]
|
||||
})
|
||||
export class AppCustomSourcesModule {}
|
@@ -50,23 +50,6 @@
|
||||
[adf-create-folder]="currentFolderId">
|
||||
<mat-icon>create_new_folder</mat-icon>
|
||||
</button>
|
||||
<button
|
||||
mat-icon-button
|
||||
title="Create Library}"
|
||||
data-automation-id="create-new-library"
|
||||
(click)="createLibrary()">
|
||||
<mat-icon>library_add</mat-icon>
|
||||
</button>
|
||||
<button
|
||||
data-automation-id="edit-folder"
|
||||
mat-icon-button
|
||||
[disabled]="!canEditFolder(documentList.selection)"
|
||||
title="Edit folder"
|
||||
(error)="openSnackMessageError($event)"
|
||||
[adf-edit-folder]="documentList.selection[0]?.entry"
|
||||
(success)="documentList.reload()">
|
||||
<mat-icon>create</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button
|
||||
[disabled]="!hasSelection(documentList.selection)"
|
||||
title="Download"
|
||||
@@ -83,23 +66,6 @@
|
||||
[adf-delete]="documentList.selection">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
<button
|
||||
data-automation-id="favorite"
|
||||
mat-icon-button
|
||||
[disabled]="!documentList.selection.length"
|
||||
#favorite="adfFavorite"
|
||||
[adf-node-favorite]="documentList.selection"
|
||||
title="Add to favorites">
|
||||
<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]"
|
||||
[title]="(shareRef.isShared ? 'Edit settings' : 'Share')">
|
||||
<mat-icon>share</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button mat-icon-button (click)="showVersions = !showVersions" class="app-show-versions-button"
|
||||
@@ -124,11 +90,6 @@
|
||||
<mat-icon>create_new_folder</mat-icon>
|
||||
<span>New folder</span>
|
||||
</button>
|
||||
<button mat-menu-item
|
||||
(click)="createLibrary()">
|
||||
<mat-icon>library_add</mat-icon>
|
||||
<span>Create Library</span>
|
||||
</button>
|
||||
<button mat-menu-item
|
||||
[disabled]="!canEditFolder(documentList.selection)"
|
||||
(error)="openSnackMessageError($event)"
|
||||
@@ -270,24 +231,6 @@
|
||||
title="Download"
|
||||
handler="download">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="content_copy"
|
||||
title="Copy"
|
||||
permission="copy"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="copy">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="redo"
|
||||
title="Move"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="move">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="delete"
|
||||
permission="delete"
|
||||
@@ -316,13 +259,6 @@
|
||||
title="Manage versions"
|
||||
(execute)="onManageVersions($event)">
|
||||
</content-action>
|
||||
<content-action
|
||||
target="document"
|
||||
icon="lock"
|
||||
permission="lock"
|
||||
handler="lock"
|
||||
title="Lock">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="beach_access"
|
||||
target="document"
|
||||
@@ -450,12 +386,6 @@
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle id="adf-document-list-enable-drop-files" [checked]="allowDropFiles" (change)="toggleAllowDropFiles()">
|
||||
Enable Drop Files in a folder or a file
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle id="adf-version-upload-switch" [(ngModel)]="versioning">
|
||||
Enable versioning
|
||||
@@ -504,39 +434,6 @@
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [(ngModel)]="enableDownloadPrompt" id="enableDownloadPrompt" (change)="onEnableDownloadPrompt()">
|
||||
Enable Download Prompt
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
<section *ngIf="enableDownloadPrompt">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" [(ngModel)]="downloadPromptDelay" (change)="onDownloadPromptDelayChange()">
|
||||
</mat-form-field>
|
||||
</section>
|
||||
|
||||
<section *ngIf="enableDownloadPrompt">
|
||||
<mat-slide-toggle [(ngModel)]="enableDownloadPromptReminder" id="enableDownloadPromptReminders" (change)="onEnableDownloadPromptReminderChange()">
|
||||
Enable Download Prompt Reminders
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
<section *ngIf="enableDownloadPrompt && enableDownloadPromptReminder">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" [(ngModel)]="downloadPromptReminderDelay" (change)="onDownloadPromptReminderChange()">
|
||||
</mat-form-field>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [(ngModel)]="enableFileAutoDownload" id="enableFileAutoDownload" (change)="onEnableFileAutoDownloadChange()">
|
||||
Enable FileAutoDownload
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
<section *ngIf="enableFileAutoDownload">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" [(ngModel)]="fileAutoDownloadSizeThresholdInMB" (change)="onFileAutoDownloadSizeThresholdChange()">
|
||||
</mat-form-field>
|
||||
</section>
|
||||
|
||||
<h5>Upload</h5>
|
||||
<section *ngIf="acceptedFilesTypeShow">
|
||||
<mat-form-field floatPlaceholder="float">
|
||||
@@ -555,7 +452,6 @@
|
||||
<div *ngIf="!acceptedFilesTypeShow">
|
||||
<adf-upload-button
|
||||
#uploadButton
|
||||
tooltip="Custom tooltip"
|
||||
[disabled]="!enableUpload"
|
||||
[rootFolderId]="documentList.currentFolderId"
|
||||
[multipleFiles]="multipleFileUpload"
|
||||
@@ -572,7 +468,6 @@
|
||||
<div *ngIf="acceptedFilesTypeShow">
|
||||
<adf-upload-button
|
||||
#uploadButton
|
||||
tooltip="Custom tooltip"
|
||||
[disabled]="!enableUpload"
|
||||
[rootFolderId]="documentList.currentFolderId"
|
||||
[acceptedFilesType]="acceptedFilesType"
|
||||
|
@@ -31,17 +31,8 @@ import {
|
||||
import { Location } from '@angular/common';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, SiteEntry, SearchEntry } from '@alfresco/js-api';
|
||||
import {
|
||||
MinimalNodeEntity,
|
||||
NodePaging,
|
||||
Pagination,
|
||||
MinimalNodeEntryEntity,
|
||||
SiteEntry,
|
||||
SearchEntry
|
||||
} from '@alfresco/js-api';
|
||||
import {
|
||||
AppConfigService,
|
||||
AppConfigValues,
|
||||
NotificationService,
|
||||
DataRow,
|
||||
UserPreferencesService,
|
||||
@@ -60,13 +51,11 @@ import {
|
||||
PermissionStyleModel,
|
||||
UploadFilesEvent,
|
||||
ConfirmDialogComponent,
|
||||
LibraryDialogComponent,
|
||||
ContentMetadataService,
|
||||
FilterSearch,
|
||||
DialogAspectListService,
|
||||
FileUploadEvent,
|
||||
NodesApiService,
|
||||
SharedLinksApiService
|
||||
NodesApiService
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { ProcessFormRenderingService } from '@alfresco/adf-process-services';
|
||||
import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component';
|
||||
@@ -98,10 +87,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
displayMode = DisplayMode.List;
|
||||
includeFields = ['isFavorite', 'isLocked', 'aspectNames', 'definition'];
|
||||
|
||||
baseShareUrl = (
|
||||
this.appConfig.get<string>(AppConfigValues.BASESHAREURL) ||
|
||||
this.appConfig.get<string>(AppConfigValues.ECMHOST)) + '/preview/s/';
|
||||
|
||||
selectionModes = [
|
||||
{value: 'none', viewValue: 'None'},
|
||||
{value: 'single', viewValue: 'Single'},
|
||||
@@ -232,25 +217,16 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
displayEmptyMetadata = false;
|
||||
hyperlinkNavigation = 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);
|
||||
enableFileAutoDownload: boolean = this.appConfig.get('viewer.enableFileAutoDownload', true);
|
||||
fileAutoDownloadSizeThresholdInMB: number = this.appConfig.get('viewer.fileAutoDownloadSizeThresholdInMB', 15);
|
||||
|
||||
constructor(private notificationService: NotificationService,
|
||||
private uploadService: UploadService,
|
||||
private contentService: ContentService,
|
||||
private dialog: MatDialog,
|
||||
private location: Location,
|
||||
private router: Router,
|
||||
private appConfig: AppConfigService,
|
||||
private preference: UserPreferencesService,
|
||||
private preview: PreviewService,
|
||||
@Optional() private route: ActivatedRoute,
|
||||
private contentMetadataService: ContentMetadataService,
|
||||
private sharedLinksApiService: SharedLinksApiService,
|
||||
private dialogAspectListService: DialogAspectListService,
|
||||
private nodeService: NodesApiService) {
|
||||
}
|
||||
@@ -267,11 +243,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
toggleAllowDropFiles() {
|
||||
this.allowDropFiles = !this.allowDropFiles;
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.pagination) {
|
||||
this.pagination = {
|
||||
@@ -323,12 +294,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
.subscribe((err: { message: string }) => {
|
||||
this.notificationService.showError(err.message);
|
||||
});
|
||||
|
||||
this.sharedLinksApiService.error
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((err: { message: string }) => {
|
||||
this.notificationService.showError(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
onFileUploadEvent(event: FileUploadEvent) {
|
||||
@@ -433,11 +398,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.openSnackMessageError(message);
|
||||
}
|
||||
|
||||
onContentActionSuccess(message: string) {
|
||||
this.openSnackMessageInfo(message);
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
onDeleteActionSuccess(message: string) {
|
||||
this.uploadService.fileDeleted.next(message);
|
||||
this.deleteElementSuccess.emit();
|
||||
@@ -624,16 +584,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
return this.acceptedFilesTypeShow ? this.acceptedFilesType : '*';
|
||||
}
|
||||
|
||||
createLibrary(): void {
|
||||
const dialogInstance: any = this.dialog.open(LibraryDialogComponent, {
|
||||
width: '400px'
|
||||
});
|
||||
|
||||
dialogInstance.componentInstance.error.subscribe((message: string) => {
|
||||
this.notificationService.openSnackMessage(message);
|
||||
});
|
||||
}
|
||||
|
||||
searchResultsHighlight(search: SearchEntry): string {
|
||||
if (search && search.highlight) {
|
||||
return search.highlight.map((currentHighlight) => currentHighlight.snippets).join(', ');
|
||||
@@ -673,34 +623,4 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
onEnableDownloadPrompt() {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['enableDownloadPrompt'] = this.enableDownloadPrompt;
|
||||
}
|
||||
|
||||
onDownloadPromptDelayChange() {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['downloadPromptDelay'] = this.downloadPromptDelay;
|
||||
}
|
||||
|
||||
onEnableDownloadPromptReminderChange() {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['enableDownloadPromptReminder'] = this.enableDownloadPromptReminder;
|
||||
}
|
||||
|
||||
onDownloadPromptReminderChange() {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['downloadPromptReminderDelay'] = this.downloadPromptReminderDelay;
|
||||
}
|
||||
|
||||
onEnableFileAutoDownloadChange() {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['enableFileAutoDownload'] = this.enableFileAutoDownload;
|
||||
}
|
||||
|
||||
onFileAutoDownloadSizeThresholdChange() {
|
||||
const previewConfig = this.appConfig?.config['viewer'];
|
||||
previewConfig['fileAutoDownloadSizeThresholdInMB'] = this.fileAutoDownloadSizeThresholdInMB;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user