mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[AAE-10777] Move services from Core in Content the right place (#8242)
Clean core services and directive
This commit is contained in:
parent
112e272ce7
commit
2590e7d0a9
@ -17,7 +17,8 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { AuthenticationService, BpmProductVersionModel, DiscoveryApiService, RepositoryInfo } from '@alfresco/adf-core';
|
||||
import { AuthenticationService, BpmProductVersionModel, RepositoryInfo } from '@alfresco/adf-core';
|
||||
import { DiscoveryApiService } from '@alfresco/adf-content-services';
|
||||
import pkg from '../../../../../package.json';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@ -34,32 +35,32 @@ export class AboutComponent implements OnInit {
|
||||
bpmVersion: BpmProductVersionModel = null;
|
||||
|
||||
constructor(
|
||||
private authService: AuthenticationService,
|
||||
private appExtensions: AppExtensionService,
|
||||
private discovery: DiscoveryApiService
|
||||
private authenticationService: AuthenticationService,
|
||||
private appExtensionService: AppExtensionService,
|
||||
private discoveryApiService: DiscoveryApiService
|
||||
) {
|
||||
this.pkg = pkg;
|
||||
this.extensions$ = this.appExtensions.references$;
|
||||
this.extensions$ = this.appExtensionService.references$;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.authService.isEcmLoggedIn()) {
|
||||
if (this.authenticationService.isEcmLoggedIn()) {
|
||||
this.setECMInfo();
|
||||
}
|
||||
|
||||
if (this.authService.isBpmLoggedIn()) {
|
||||
if (this.authenticationService.isBpmLoggedIn()) {
|
||||
this.setBPMInfo();
|
||||
}
|
||||
}
|
||||
|
||||
setECMInfo() {
|
||||
this.discovery.getEcmProductInfo().subscribe((repository) => {
|
||||
this.discoveryApiService.getEcmProductInfo().subscribe((repository) => {
|
||||
this.repository = repository as RepositoryInfo;
|
||||
});
|
||||
}
|
||||
|
||||
setBPMInfo() {
|
||||
this.discovery.getBpmProductInfo().subscribe((bpmVersion) => {
|
||||
this.discoveryApiService.getBpmProductInfo().subscribe((bpmVersion) => {
|
||||
this.bpmVersion = bpmVersion;
|
||||
});
|
||||
}
|
||||
|
@ -15,7 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AuthenticationService, BpmUserModel, BpmUserService, EcmUserModel, IdentityUserModel, IdentityUserService, PeopleContentService, UserInfoMode } from '@alfresco/adf-core';
|
||||
import { EcmUserModel, PeopleContentService } from '@alfresco/adf-content-services';
|
||||
import { BpmUserModel, PeopleProcessService } from '@alfresco/adf-process-services';
|
||||
import { AuthenticationService, IdentityUserModel, IdentityUserService, UserInfoMode } from '@alfresco/adf-core';
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
||||
import { Observable, of } from 'rxjs';
|
||||
@ -42,7 +44,7 @@ export class UserInfoComponent implements OnInit {
|
||||
userInfoMode = UserInfoMode;
|
||||
|
||||
constructor(private peopleContentService: PeopleContentService,
|
||||
private bpmUserService: BpmUserService,
|
||||
private peopleProcessService: PeopleProcessService,
|
||||
private identityUserService: IdentityUserService,
|
||||
private authService: AuthenticationService) {
|
||||
}
|
||||
@ -86,7 +88,7 @@ export class UserInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
private loadBpmUserInfo() {
|
||||
this.bpmUser$ = this.bpmUserService.getCurrentUserInfo();
|
||||
this.bpmUser$ = this.peopleProcessService.getCurrentUserInfo();
|
||||
}
|
||||
|
||||
private loadIdentityUserInfo() {
|
||||
|
@ -26,7 +26,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { NodeEntry, Node } from '@alfresco/js-api';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '@alfresco/adf-content-services';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
|
@ -17,14 +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,
|
||||
NotificationService
|
||||
} from '@alfresco/adf-core';
|
||||
FileUploadErrorEvent
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
|
||||
@Component({
|
||||
|
@ -45,11 +45,8 @@ import {
|
||||
AuthenticationService,
|
||||
AppConfigService,
|
||||
AppConfigValues,
|
||||
ContentService,
|
||||
FolderCreatedEvent,
|
||||
LogService,
|
||||
NotificationService,
|
||||
UploadService,
|
||||
DataRow,
|
||||
UserPreferencesService,
|
||||
PaginationComponent,
|
||||
@ -57,12 +54,13 @@ import {
|
||||
DisplayMode,
|
||||
ShowHeaderMode,
|
||||
InfinitePaginationComponent,
|
||||
FormRenderingService,
|
||||
FileUploadEvent,
|
||||
NodesApiService
|
||||
FormRenderingService
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import {
|
||||
ContentService,
|
||||
FolderCreatedEvent,
|
||||
UploadService,
|
||||
DocumentListComponent,
|
||||
PermissionStyleModel,
|
||||
UploadFilesEvent,
|
||||
@ -71,6 +69,8 @@ import {
|
||||
ContentMetadataService,
|
||||
FilterSearch,
|
||||
DialogAspectListService,
|
||||
FileUploadEvent,
|
||||
NodesApiService,
|
||||
SharedLinksApiService
|
||||
} from '@alfresco/adf-content-services';
|
||||
|
||||
|
@ -19,7 +19,8 @@ import { Component, Inject, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
import { FileUploadErrorEvent, NotificationService } from '@alfresco/adf-core';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { FileUploadErrorEvent } from '@alfresco/adf-content-services';
|
||||
|
||||
@Component({
|
||||
templateUrl: './version-manager-dialog-adapter.component.html',
|
||||
|
@ -18,7 +18,8 @@
|
||||
import { Component, Input, OnChanges, OnInit, ViewChild, OnDestroy } from '@angular/core';
|
||||
import { ProcessInstance, ProcessService ,
|
||||
ProcessAttachmentListComponent, ProcessUploadService } from '@alfresco/adf-process-services';
|
||||
import { UploadService, AlfrescoApiService, AppConfigService, DiscoveryApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { UploadService, DiscoveryApiService } from '@alfresco/adf-content-services';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
@ -22,7 +22,8 @@ import {
|
||||
TaskUploadService,
|
||||
TaskDetailsModel
|
||||
} from '@alfresco/adf-process-services';
|
||||
import { UploadService, AlfrescoApiService, AppConfigService, DiscoveryApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { UploadService, DiscoveryApiService } from '@alfresco/adf-content-services';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
@ -135,7 +135,7 @@ for more information about installing and using the source code.
|
||||
| [Highlight directive](core/directives/highlight.directive.md) | Adds highlighting to selected sections of an HTML element's content. | [Source](../lib/core/src/lib/directives/highlight.directive.ts) |
|
||||
| [Infinite Select Scroll directive](core/directives/infinite-select-scroll.directive.md) | Load more options to select component if API returns more items | [Source](../lib/core/src/lib/directives/infinite-select-scroll.directive.ts) |
|
||||
| [Logout directive](core/directives/logout.directive.md) | Logs the user out when the decorated element is clicked. | [Source](../lib/core/src/lib/directives/logout.directive.ts) |
|
||||
| [Node Download directive](core/directives/node-download.directive.md) | Allows folders and/or files to be downloaded, with multiple nodes packed as a '.ZIP' archive. | [Source](../lib/core/src/lib/directives/node-download.directive.ts) |
|
||||
| [Node Download directive](core/directives/node-download.directive.md) | Allows folders and/or files to be downloaded, with multiple nodes packed as a '.ZIP' archive. | [Source](lib/content-services/src/lib/directives/node-download.directive.ts) |
|
||||
| [Upload Directive](core/directives/upload.directive.md) | Uploads content in response to file drag and drop. | [Source](../lib/core/src/lib/directives/upload.directive.ts) |
|
||||
|
||||
### Dialogs
|
||||
@ -160,11 +160,11 @@ for more information about installing and using the source code.
|
||||
|
||||
| Name | Description | Source link |
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Bpm User model](core/models/bpm-user.model.md) | Contains information about a Process Services user. | [Source](../lib/core/src/lib/models/bpm-user.model.ts) |
|
||||
| [Ecm User model](core/models/ecm-user.model.md) | Contains information about a Content Services user. | [Source](../lib/core/src/lib/models/ecm-user.model.ts) |
|
||||
| [Bpm User model](core/models/bpm-user.model.md) | Contains information about a Process Services user. | [Source](lib/process-services/src/lib/common/models/bpm-user.model.ts) |
|
||||
| [Ecm User model](core/models/ecm-user.model.md) | Contains information about a Content Services user. | [Source](lib/content-services/src/lib/common/models/ecm-user.model.ts) |
|
||||
| [Form Field model](core/models/form-field.model.md) | Contains the value and metadata for a field of a Form component. | [Source](../lib/core/src/lib/form/components/widgets/core/form-field.model.ts) |
|
||||
| [Product Version model](core/models/product-version.model.md) | Contains version and license information classes for Alfresco products. | [Source](../lib/core/src/lib/models/product-version.model.ts) |
|
||||
| [User Process model](core/models/user-process.model.md) | Represents a Process Services user. | [Source](../lib/core/src/lib/models/user-process.model.ts) |
|
||||
| [User Process model](core/models/user-process.model.md) | Represents a Process Services user. | [Source](lib/process-services/src/lib/common/models/user-process.model.ts) |
|
||||
|
||||
### Pipes
|
||||
|
||||
@ -203,12 +203,12 @@ for more information about installing and using the source code.
|
||||
| [Clipboard service](core/services/clipboard.service.md) | Copies text to the clipboard. | [Source](../lib/core/src/lib/clipboard/clipboard.service.ts) |
|
||||
| [Comment Content service](core/services/comment-content.service.md) | Adds and retrieves comments for nodes in Content Services. | [Source](../lib/core/src/lib/services/comment-content.service.ts) |
|
||||
| [Comment Process service](core/services/comment-process.service.md) | Adds and retrieves comments for task and process instances in Process Services. | [Source](../lib/core/src/lib/services/comment-process.service.ts) |
|
||||
| [Content service](core/services/content.service.md) | Accesses app-generated data objects via URLs and file downloads. | [Source](../lib/core/src/lib/services/content.service.ts) |
|
||||
| [Content service](core/services/content.service.md) | Accesses app-generated data objects via URLs and file downloads. | [Source](lib/content-services/src/lib/common/services/content.service.ts) |
|
||||
| [Cookie service](core/services/cookie.service.md) | Stores key-value data items as browser cookies. | [Source](../lib/core/src/lib/common/services/cookie.service.ts) |
|
||||
| [DataTable service](core/services/datatable.service.md) | | [Source](<>) |
|
||||
| [Deleted Nodes Api service](core/services/deleted-nodes-api.service.md) | Gets a list of Content Services nodes currently in the trash. | [Source](../lib/core/src/lib/services/deleted-nodes-api.service.ts) |
|
||||
| [Discovery Api service](core/services/discovery-api.service.md) | Gets version and license information for Process Services and Content Services. | [Source](../lib/core/src/lib/services/discovery-api.service.ts) |
|
||||
| [Download zip service](core/services/download-zip.service.md) | Creates and manages downloads. | [Source](../lib/core/src/lib/services/download-zip.service.ts) |
|
||||
| [Discovery Api service](core/services/discovery-api.service.md) | Gets version and license information for Process Services and Content Services. | [Source](lib/content-services/src/lib/common/services/discovery-api.service.ts) |
|
||||
| [Download zip service](core/services/download-zip.service.md) | Creates and manages downloads. | [Source](lib/content-services/src/lib/dialogs/download-zip/services/download-zip.service.ts) |
|
||||
| [Ecm User service](core/services/ecm-user.service.md) | Gets information about a Content Services user. | [Source](../lib/core/src/lib/services/ecm-user.service.ts) |
|
||||
| [Favorites Api service](core/services/favorites-api.service.md) | Gets a list of items a user has marked as their favorites. | [Source](lib/content-services/src/lib/common/services/favorites-api.service.ts) |
|
||||
| [Form Rendering service](core/services/form-rendering.service.md) | Maps a form field type string onto the corresponding form widget component type. | [Source](../lib/core/form/services/form-rendering.service.ts) |
|
||||
@ -220,11 +220,11 @@ for more information about installing and using the source code.
|
||||
| [JWT helper service](core/services/jwt-helper.service.md) | Decodes a JSON Web Token (JWT) to a JavaScript object. | [Source](../lib/core/src/lib/auth/services/jwt-helper.service.ts) |
|
||||
| [Log Service](core/services/log.service.md) | Provides log functionality. | [Source](../lib/core/src/lib/common/services/log.service.ts) |
|
||||
| [Login Dialog service](core/services/login-dialog.service.md) | Manages login dialogs. | [Source](../lib/core/src/lib/services/login-dialog.service.ts) |
|
||||
| [Nodes Api service](core/services/nodes-api.service.md) | Accesses and manipulates ACS document nodes using their node IDs. | [Source](../lib/core/src/lib/services/nodes-api.service.ts) |
|
||||
| [Nodes Api service](core/services/nodes-api.service.md) | Accesses and manipulates ACS document nodes using their node IDs. | [Source](lib/content-services/src/lib/common/services/nodes-api.service.ts) |
|
||||
| [Notification Service](core/services/notification.service.md) | Shows a notification message with optional feedback. | [Source](../lib/core/src/lib/notifications/services/notification.service.ts) |
|
||||
| [Page Title service](core/services/page-title.service.md) | Sets the page title. | [Source](lib/core/src/lib/common/services/page-title.service.ts) |
|
||||
| [People Content service](core/services/people-content.service.md) | Gets information about a Content Services user. | [Source](../lib/core/src/lib/services/people-content.service.ts) |
|
||||
| [People Process service](core/services/people-process.service.md) | Gets information about Process Services users. | [Source](../lib/core/src/lib/services/people-process.service.ts) |
|
||||
| [People Content service](core/services/people-content.service.md) | Gets information about a Content Services user. | [Source](lib/content-services/src/lib/common/services/people-content.service.ts) |
|
||||
| [People Process service](core/services/people-process.service.md) | Gets information about Process Services users. | [Source](lib/process-services/src/lib/common/services/people-process.service.ts) |
|
||||
| [Process Content Service](core/services/process-content.service.md) | Manipulates content related to a Process Instance or Task Instance in APS. | [Source](../lib/process-services/src/lib/form/services/process-content.service.ts) |
|
||||
| [Renditions service](core/services/renditions.service.md) | Manages prearranged conversions of content to different formats. | [Source](../lib/core/src/lib/services/renditions.service.ts) |
|
||||
| [Search Configuration service](core/services/search-configuration.service.md) | Provides fine control of parameters to a search. | [Source](../lib/core/src/lib/services/search-configuration.service.ts) |
|
||||
@ -233,8 +233,8 @@ for more information about installing and using the source code.
|
||||
| [Storage service](core/services/storage.service.md) | Stores items in the form of key-value pairs. | [Source](../lib/core/src/lib/services/storage.service.ts) |
|
||||
| [Thumbnail service](core/services/thumbnail.service.md) | Retrieves an SVG thumbnail image to represent a document type. | [Source](lib/core/src/lib/common/services/thumbnail.service.ts) |
|
||||
| [Translation service](core/services/translation.service.md) | Supports localisation. | [Source](lib/core/src/lib/translation/translation.service.ts) |
|
||||
| [Upload Service](core/services/upload.service.md) | Provides access to various APIs related to file upload features. | [Source](../lib/core/src/lib/services/upload.service.ts) |
|
||||
| [User access service](core/services/user-access.service.md) | Checks the global and application access of a user | [Source](../lib/core/src/lib/services/user-access.service.ts) |
|
||||
| [Upload Service](core/services/upload.service.md) | Provides access to various APIs related to file upload features. | [Source](lib/content-services/src/lib/common/services/upload.service.ts) |
|
||||
| [User access service](core/services/user-access.service.md) | Checks the global and application access of a user | [Source](lib/core/src/lib/auth/services/user-access.service.ts) |
|
||||
| [User Preferences Service](core/services/user-preferences.service.md) | Stores preferences for the app and for individual components. | [Source](../lib/core/src/lib/common/services/user-preferences.service.ts) |
|
||||
|
||||
### Widgets
|
||||
|
@ -25,7 +25,7 @@ This document lists all the deprecated ADF v2.x components that were removed for
|
||||
classes without the **adf-** prefix, you will now need to update them. For example, `.card-view`
|
||||
is now `.adf-card-view`.
|
||||
|
||||
- [PR ADF-1443](https://github.com/Alfresco/alfresco-ng2-components/pull/4028): [`DownloadZipDialogComponent`](../../lib/core/src/lib/dialogs/download-zip/download-zip.dialog.ts)
|
||||
- [PR ADF-1443](https://github.com/Alfresco/alfresco-ng2-components/pull/4028): [`DownloadZipDialogComponent`](lib/content-services/src/lib/dialogs/download-zip/download-zip.dialog.ts)
|
||||
and [`NodeDownloadDirective`](../core/directives/node-download.directive.md) have been moved from the Content Services module to the Core module.
|
||||
This modification has enabled us to remove some code duplication between the two modules.
|
||||
|
||||
|
@ -48,7 +48,7 @@ Activates a file upload.
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](../../../lib/content-services/src/lib/upload/components/upload-files.event.ts)`>` | Emitted when the upload begins. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](../../../lib/core/src/lib/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](lib/content-services/src/lib/common/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| permissionEvent | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`PermissionModel`](../../../lib/content-services/src/lib/document-list/models/permissions.model.ts)`>` | Emitted when create permission is missing. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the file is uploaded successfully. |
|
||||
| updateFileVersion | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<CustomEvent<any>>` | Emitted when dropping a file over another file to update the version. |
|
||||
|
@ -75,7 +75,7 @@ as the drag/drop target:
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](../../../lib/content-services/src/lib/upload/components/upload-files.event.ts)`>` | Emitted when the upload begins. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](../../../lib/core/src/lib/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](lib/content-services/src/lib/common/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the file is uploaded successfully. |
|
||||
| updateFileVersion | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<CustomEvent<any>>` | Emitted when dropping a file over another file to update the version. |
|
||||
|
||||
|
@ -51,7 +51,7 @@ to enrich the features and decrease the restrictions currently applied to node v
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](../../../lib/content-services/src/lib/upload/components/upload-files.event.ts)`>` | Emitted when the upload begins. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](../../../lib/core/src/lib/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](lib/content-services/src/lib/common/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| permissionEvent | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`PermissionModel`](../../../lib/content-services/src/lib/document-list/models/permissions.model.ts)`>` | Emitted when create permission is missing. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the file is uploaded successfully. |
|
||||
| updateFileVersion | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<CustomEvent<any>>` | Emitted when dropping a file over another file to update the version. |
|
||||
|
@ -40,7 +40,7 @@ Displays the version history of a node with the ability to upload a new version.
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| uploadCancel | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted when an cancelling during upload. |
|
||||
| uploadError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](../../../lib/core/src/lib/events/file.event.ts)`>` | Emitted when an error occurs during upload. |
|
||||
| uploadError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](lib/content-services/src/lib/common/events/file.event.ts)`>` | Emitted when an error occurs during upload. |
|
||||
| uploadSuccess | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Node>` | Emitted when a file is uploaded successfully. |
|
||||
| viewVersion | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string>` | Emitted when viewing a version. |
|
||||
|
||||
|
@ -33,9 +33,9 @@ Displays the new version's minor/major changes and the optional comment of a nod
|
||||
| ---- | ---- | ----------- |
|
||||
| cancel | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an cancelling during upload. |
|
||||
| commentChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string>` | Emitted when the comment is changed. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](../../../lib/core/src/lib/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadErrorEvent`](lib/content-services/src/lib/common/events/file.event.ts)`>` | Emitted when an error occurs. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the file is uploaded successfully. |
|
||||
| uploadStarted | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadEvent`](../../../lib/core/src/lib/events/file.event.ts)`>` | Emitted when the upload starts |
|
||||
| uploadStarted | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FileUploadEvent`](lib/content-services/src/lib/common/events/file.event.ts)`>` | Emitted when the upload starts |
|
||||
| versionChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted when the version is changed. |
|
||||
|
||||
## Details
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2018-11-20
|
||||
---
|
||||
|
||||
# [Node Download directive](../../../lib/core/src/lib/directives/node-download.directive.ts "Defined in node-download.directive.ts")
|
||||
# [Node Download directive](lib/content-services/src/lib/directives/node-download.directive.ts "Defined in node-download.directive.ts")
|
||||
|
||||
Allows folders and/or files to be downloaded, with multiple nodes packed as a '.ZIP' archive.
|
||||
|
||||
|
@ -4,7 +4,7 @@ Added: v2.0.0
|
||||
Status: Active
|
||||
---
|
||||
|
||||
# [Bpm User model](../../../lib/core/src/lib/models/bpm-user.model.ts "Defined in bpm-user.model.ts")
|
||||
# [Bpm User model](lib/process-services/src/lib/common/models/bpm-user.model.ts "Defined in bpm-user.model.ts")
|
||||
|
||||
Contains information about a Process Services user.
|
||||
|
||||
|
@ -4,7 +4,7 @@ Added: v2.0.0
|
||||
Status: Active
|
||||
---
|
||||
|
||||
# [Ecm User model](../../../lib/core/src/lib/models/ecm-user.model.ts "Defined in ecm-user.model.ts")
|
||||
# [Ecm User model](lib/content-services/src/lib/common/models/ecm-user.model.ts "Defined in ecm-user.model.ts")
|
||||
|
||||
Contains information about a Content Services user.
|
||||
|
||||
|
@ -4,7 +4,7 @@ Added: v2.0.0
|
||||
Status: Active
|
||||
---
|
||||
|
||||
# [User Process model](../../../lib/core/src/lib/models/user-process.model.ts "Defined in user-process.model.ts")
|
||||
# [User Process model](lib/process-services/src/lib/common/models/user-process.model.ts "Defined in user-process.model.ts")
|
||||
|
||||
Represents a Process Services user.
|
||||
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2019-03-13
|
||||
---
|
||||
|
||||
# [Content service](../../../lib/core/src/lib/services/content.service.ts "Defined in content.service.ts")
|
||||
# [Content service](lib/content-services/src/lib/common/services/content.service.ts "Defined in content.service.ts")
|
||||
|
||||
Accesses app-generated data objects via URLs and file downloads.
|
||||
|
||||
@ -18,7 +18,7 @@ Accesses app-generated data objects via URLs and file downloads.
|
||||
- _blob:_ [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) - Data to wrap into object URL
|
||||
- **Returns** `string` - URL string
|
||||
- **downloadBlob**(blob: [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob), fileName: `string`)<br/>
|
||||
(**Deprecated:** in 3.2.0, use [DownloadService](../../../lib/core/src/lib/services/download.service.ts) instead. Invokes content download for a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) with a file name.)
|
||||
(**Deprecated:** in 3.2.0, use [DownloadService](lib/core/src/lib/common/services/download.service.ts) instead. Invokes content download for a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) with a file name.)
|
||||
- _blob:_ [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) - Content to download.
|
||||
- _fileName:_ `string` - Name of the resulting file.
|
||||
- **getContentUrl**(node: [`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`|string`, attachment?: `boolean`, ticket?: `string`): `string`<br/>
|
||||
@ -42,15 +42,15 @@ Accesses app-generated data objects via URLs and file downloads.
|
||||
Gets content for the given node.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Content data
|
||||
- **hasAllowableOperations**(node: `Node`, allowableOperation: [`AllowableOperationsEnum`](../../../lib/core/src/lib/models/allowable-operations.enum.ts)`|string`): `boolean`<br/>
|
||||
- **hasAllowableOperations**(node: `Node`, allowableOperation: [`AllowableOperationsEnum`](lib/content-services/src/lib/common/models/allowable-operations.enum.ts)`|string`): `boolean`<br/>
|
||||
Checks if the user has permissions on that node
|
||||
- _node:_ `Node` - Node to check allowableOperations
|
||||
- _allowableOperation:_ [`AllowableOperationsEnum`](../../../lib/core/src/lib/models/allowable-operations.enum.ts)`|string` - Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
|
||||
- _allowableOperation:_ [`AllowableOperationsEnum`](lib/content-services/src/lib/common/models/allowable-operations.enum.ts)`|string` - Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
|
||||
- **Returns** `boolean` - True if the user has the required permissions, false otherwise
|
||||
- **hasPermissions**(node: `Node`, permission: [`PermissionsEnum`](../../../lib/core/src/lib/models/permissions.enum.ts)`|string`, userId?: `string`): `boolean`<br/>
|
||||
- **hasPermissions**(node: `Node`, permission: [`PermissionsEnum`](lib/content-services/src/lib/common/models/permissions.enum.ts)`|string`, userId?: `string`): `boolean`<br/>
|
||||
Checks if the user has permission on that node
|
||||
- _node:_ `Node` - Node to check permissions
|
||||
- _permission:_ [`PermissionsEnum`](../../../lib/core/src/lib/models/permissions.enum.ts)`|string` - Required permission type
|
||||
- _permission:_ [`PermissionsEnum`](lib/content-services/src/lib/common/models/permissions.enum.ts)`|string` - Required permission type
|
||||
- _userId:_ `string` - (Optional) Optional current user id will be taken by default
|
||||
- **Returns** `boolean` - True if the user has the required permissions, false otherwise
|
||||
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2018-11-19
|
||||
---
|
||||
|
||||
# [Discovery Api service](../../../lib/core/src/lib/services/discovery-api.service.ts "Defined in discovery-api.service.ts")
|
||||
# [Discovery Api service](lib/content-services/src/lib/common/services/discovery-api.service.ts "Defined in discovery-api.service.ts")
|
||||
|
||||
Gets version and license information for Process Services and Content Services.
|
||||
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2019-01-08
|
||||
---
|
||||
|
||||
# [Download zip service](../../../lib/core/src/lib/services/download-zip.service.ts "Defined in download-zip.service.ts")
|
||||
# [Download zip service](lib/content-services/src/lib/dialogs/download-zip/services/download-zip.service.ts "Defined in download-zip.service.ts")
|
||||
|
||||
Creates and manages downloads.
|
||||
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
---
|
||||
|
||||
# [Nodes Api service](../../../lib/core/src/lib/services/nodes-api.service.ts "Defined in nodes-api.service.ts")
|
||||
# [Nodes Api service](lib/content-services/src/lib/common/services/nodes-api.service.ts "Defined in nodes-api.service.ts")
|
||||
|
||||
Accesses and manipulates ACS document nodes using their node IDs.
|
||||
|
||||
@ -66,10 +66,10 @@ Accesses and manipulates ACS document nodes using their node IDs.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- _options:_ `any` - Optional parameters supported by JS-API
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)`>` - List of child items from the folder
|
||||
- **getNodeMetadata**(nodeId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeMetadata`](../../../lib/core/src/lib/models/node-metadata.model.ts)`>`<br/>
|
||||
- **getNodeMetadata**(nodeId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeMetadata`](lib/content-services/src/lib/common/models/node-metadata.model.ts)`>`<br/>
|
||||
Get the metadata and the nodeType for a nodeId cleaned by the prefix.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeMetadata`](../../../lib/core/src/lib/models/node-metadata.model.ts)`>` - Node metadata
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeMetadata`](lib/content-services/src/lib/common/models/node-metadata.model.ts)`>` - Node metadata
|
||||
- **restoreNode**(nodeId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNode`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeMinimalEntry.md)`>`<br/>
|
||||
Restores a node previously moved to the trashcan.
|
||||
- _nodeId:_ `string` - ID of the node to restore
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2018-04-06
|
||||
---
|
||||
|
||||
# [People Content service](../../../lib/core/src/lib/services/people-content.service.ts "Defined in people-content.service.ts")
|
||||
# [People Content service](lib/content-services/src/lib/common/services/people-content.service.ts "Defined in people-content.service.ts")
|
||||
|
||||
Gets information about a Content Services user.
|
||||
|
||||
@ -36,10 +36,10 @@ Gets information about a Content Services user.
|
||||
- **isCurrentUserAdmin**(): `boolean`<br/>
|
||||
Used to know if the current user has the admin capability
|
||||
- **Returns** `boolean` - true or false
|
||||
- **listPeople**(requestQuery?: [`PeopleContentQueryRequestModel`](../../../lib/core/src/lib/services/people-content.service.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`PeopleContentQueryResponse`](../../../lib/core/src/lib/services/people-content.service.ts)`>`<br/>
|
||||
- **listPeople**(requestQuery?: [`PeopleContentQueryRequestModel`](lib/content-services/src/lib/common/services/people-content.service.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`PeopleContentQueryResponse`](lib/content-services/src/lib/common/services/people-content.service.ts)`>`<br/>
|
||||
Gets a list of people.
|
||||
- _requestQuery:_ [`PeopleContentQueryRequestModel`](../../../lib/core/src/lib/services/people-content.service.ts) - (Optional) maxItems and skipCount parameters supported by JS-API
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`PeopleContentQueryResponse`](../../../lib/core/src/lib/services/people-content.service.ts)`>` - Response containing pagination and list of entries
|
||||
- _requestQuery:_ [`PeopleContentQueryRequestModel`](lib/content-services/src/lib/common/services/people-content.service.ts) - (Optional) maxItems and skipCount parameters supported by JS-API
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`PeopleContentQueryResponse`](lib/content-services/src/lib/common/services/people-content.service.ts)`>` - Response containing pagination and list of entries
|
||||
- **resetLocalCurrentUser**()<br/>
|
||||
Reset the local current user object
|
||||
- **updatePerson**(personId: `string`, details: `PersonBodyUpdate`, opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`EcmUserModel`](../../core/models/ecm-user.model.md)`>`<br/>
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2018-04-05
|
||||
---
|
||||
|
||||
# [People Process service](../../../lib/core/src/lib/services/people-process.service.ts "Defined in people-process.service.ts")
|
||||
# [People Process service](lib/process-services/src/lib/common/services/people-process.service.ts "Defined in people-process.service.ts")
|
||||
|
||||
Gets information about Process Services users.
|
||||
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
---
|
||||
|
||||
# [Upload Service](../../../lib/core/src/lib/services/upload.service.ts "Defined in upload.service.ts")
|
||||
# [Upload Service](lib/content-services/src/lib/common/services/upload.service.ts "Defined in upload.service.ts")
|
||||
|
||||
Provides access to various APIs related to file upload features.
|
||||
|
||||
@ -13,26 +13,26 @@ Provides access to various APIs related to file upload features.
|
||||
|
||||
### Methods
|
||||
|
||||
- **addToQueue**(files: [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]`): [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]`<br/>
|
||||
- **addToQueue**(files: [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]`): [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]`<br/>
|
||||
Adds files to the uploading queue to be uploaded
|
||||
- _files:_ [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]` - One or more separate parameters or an array of files to queue
|
||||
- **Returns** [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]` - Array of files that were not blocked from upload by the ignore list
|
||||
- **cancelUpload**(files: [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]`)<br/>
|
||||
- _files:_ [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]` - One or more separate parameters or an array of files to queue
|
||||
- **Returns** [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]` - Array of files that were not blocked from upload by the ignore list
|
||||
- **cancelUpload**(files: [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]`)<br/>
|
||||
Cancels uploading of files. If the file is smaller than 1 MB the file will be uploaded and then the node deleted to prevent having files that were aborted but still uploaded.
|
||||
- _files:_ [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]` - One or more separate parameters or an array of files specifying uploads to cancel
|
||||
- _files:_ [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]` - One or more separate parameters or an array of files specifying uploads to cancel
|
||||
- **clearCache**()<br/>
|
||||
|
||||
- **clearQueue**()<br/>
|
||||
Clears the upload queue
|
||||
- **getQueue**(): [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]`<br/>
|
||||
- **getQueue**(): [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]`<br/>
|
||||
Gets the file Queue
|
||||
- **Returns** [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)`[]` - Array of files that form the queue
|
||||
- **Returns** [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)`[]` - Array of files that form the queue
|
||||
- **getThreadsCount**(): `number`<br/>
|
||||
Returns the number of concurrent threads for uploading.
|
||||
- **Returns** `number` - Number of concurrent threads (default 1)
|
||||
- **getUploadPromise**(file: [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)): `any`<br/>
|
||||
- **getUploadPromise**(file: [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)): `any`<br/>
|
||||
Gets an upload promise for a file.
|
||||
- _file:_ [`FileModel`](../../../lib/core/src/lib/models/file.model.ts) - The target file
|
||||
- _file:_ [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts) - The target file
|
||||
- **Returns** `any` - [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) that is resolved if the upload is successful or error otherwise
|
||||
- **isUploading**(): `boolean`<br/>
|
||||
Checks whether the service still has files uploading or awaiting upload.
|
||||
@ -46,15 +46,15 @@ Provides access to various APIs related to file upload features.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| queueChanged | [`FileModel`](../../../lib/core/src/lib/models/file.model.ts)\[] | Emitted when the file queue changes. |
|
||||
| fileUpload | [`FileUploadEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted when a [File model](lib/core/src/lib/models/file.model.ts) changes its state. |
|
||||
| fileUploadStarting | [`FileUploadEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted when an upload starts. |
|
||||
| fileUploadCancelled | [`FileUploadEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted when an upload gets cancelled by the user. |
|
||||
| fileUploadProgress | [`FileUploadEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted during the file upload process and contains the current progress for a particular [File model](lib/core/src/lib/models/file.model.ts). |
|
||||
| fileUploadAborted | [`FileUploadEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted when a file upload gets aborted by the server. |
|
||||
| fileUploadError | [`FileUploadEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted when an error occurs during a file upload. |
|
||||
| fileUploadComplete | [`FileUploadCompleteEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted when a file upload is complete. |
|
||||
| fileUploadDelete | [`FileUploadDeleteEvent`](../../../lib/core/src/lib/events/file.event.ts) | Emitted when an uploaded file is removed from server. |
|
||||
| queueChanged | [`FileModel`](lib/content-services/src/lib/common/models/file.model.ts)\[] | Emitted when the file queue changes. |
|
||||
| fileUpload | [`FileUploadEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted when a [File model](lib/content-services/src/lib/common/models/file.model.ts) changes its state. |
|
||||
| fileUploadStarting | [`FileUploadEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted when an upload starts. |
|
||||
| fileUploadCancelled | [`FileUploadEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted when an upload gets cancelled by the user. |
|
||||
| fileUploadProgress | [`FileUploadEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted during the file upload process and contains the current progress for a particular [File model](lib/content-services/src/lib/common/models/file.model.ts). |
|
||||
| fileUploadAborted | [`FileUploadEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted when a file upload gets aborted by the server. |
|
||||
| fileUploadError | [`FileUploadEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted when an error occurs during a file upload. |
|
||||
| fileUploadComplete | [`FileUploadCompleteEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted when a file upload is complete. |
|
||||
| fileUploadDelete | [`FileUploadDeleteEvent`](lib/content-services/src/lib/common/events/file.event.ts) | Emitted when an uploaded file is removed from server. |
|
||||
| fileDeleted | string | This can be invoked when a file is deleted from an external source to upload the file dialog status. |
|
||||
|
||||
## Details
|
||||
@ -120,7 +120,7 @@ In this way all the files present in the .git folder won't be uploaded.
|
||||
|
||||
### Toggling Versioning Support
|
||||
|
||||
It is also possible to provide the `versioningEnabled` value as part of the [`FileUploadOptions`](../../../lib/core/src/lib/models/file.model.ts) when using [upload service](../../core/services/upload.service.md) from the code.
|
||||
It is also possible to provide the `versioningEnabled` value as part of the [`FileUploadOptions`](lib/content-services/src/lib/common/models/file.model.ts) when using [upload service](../../core/services/upload.service.md) from the code.
|
||||
|
||||
> Note: When creating a new node using multipart/form-data by default versioning is enabled and set to MAJOR Version.
|
||||
> Since Alfresco 6.2.3 versioningEnabled flag was introduced offering better control over the new node Versioning.
|
||||
|
@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2022-06-05
|
||||
---
|
||||
|
||||
# [User access service](../../../lib/core/src/lib/services/user-access.service.ts "Defined in user-access.service.ts")
|
||||
# [User access service](lib/core/src/lib/auth/services/user-access.service.ts "Defined in user-access.service.ts")
|
||||
|
||||
Checks the global and application access of a user
|
||||
|
||||
|
@ -259,7 +259,7 @@ The following classes have been moved from their original libraries to the Core
|
||||
library. You should modify your code to import these classes from
|
||||
`@alfresco/adf-core`.
|
||||
|
||||
- [`DownloadZipDialogComponent`](../../lib/core/src/lib/dialogs/download-zip/download-zip.dialog.ts) (formerly Content Services)
|
||||
- [`DownloadZipDialogComponent`](lib/content-services/src/lib/dialogs/download-zip/download-zip.dialog.ts) (formerly Content Services)
|
||||
- [`NodeDownloadDirective`](../core/directives/node-download.directive.md) (formerly Content Services)
|
||||
- [`CommentsModule`](../../lib/core/src/lib/comments/comments.module.ts) (formerly Process Services)
|
||||
- [`CommentListComponent`](../core/components/comment-list.component.md) (formerly Process Services)
|
||||
|
@ -90,10 +90,13 @@ How to fix it:
|
||||
|
||||
## Deprecated items
|
||||
|
||||
| Class | Before | After |
|
||||
| Class | Before | Description |
|
||||
| --- | -- | --- |
|
||||
| `LoginDialogService` | `@alfresco/adf-core`|
|
||||
| `UserInfoComponent` | `@alfresco/adf-core`|
|
||||
| `LoginDialogService` | `@alfresco/adf-core`||
|
||||
| `DeletedNodesApiService` | `@alfresco/adf-core`||
|
||||
| `BpmUserService` | `@alfresco/adf-core`| you can use instead the PeopleProcessService|
|
||||
| `UserContentAccessService` | `@alfresco/adf-core`| you can use instead the PeopleContentService|
|
||||
| `EcmUserService` | `@alfresco/adf-core`| you can use instead the PeopleContentService|
|
||||
|
||||
### DataColumnModule
|
||||
|
||||
@ -137,13 +140,35 @@ v6.0.0 and after:
|
||||
| [`NodeDeleteDirective`](../content-services/directives/node-delete.directive.md)| `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| [`NodeFavoriteDirective`](../content-services/directives/node-favorite.directive.md)| `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| [`NodeRestoreDirective`](../content-services/directives/node-restore.directive.md)| `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `NodeDownloadDirective` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| [`AppsProcessService`] | `@alfresco/adf-core` | `@alfresco/adf-process-services` |
|
||||
| `SharedLinksApiService` | `@alfresco/adf-core` | `@alfresco/adf-process-services` |
|
||||
| `LockService` | `@alfresco/adf-core` | `@alfresco/adf-process-services` |
|
||||
| `FavoritesApiService` | `@alfresco/adf-core` | `@alfresco/adf-process-services` |
|
||||
| `SearchConfigurationInterface` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `NodeDownloadDirective` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `DownloadZipDialogComponent` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `RenditionService` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `UploadService` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `NodesApiService` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `ContentService` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `ContentService` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `PeopleContentService` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `PeopleProcessService` | `@alfresco/adf-core` | `@alfresco/adf-process-services` |
|
||||
| `PermissionsEnum` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `AllowableOperationsEnum` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileModel` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileUploadStatus` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileUploadProgress` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileUploadOptions` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileUploadEvent` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileUploadCompleteEvent` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileUploadDeleteEvent` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `FileUploadErrorEvent` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `NodeMetadata` | `@alfresco/adf-core` | `@alfresco/adf-content-services` |
|
||||
| `RichTextEditorComponent` | `@alfresco/adf-core` | `@alfresco/adf-process-services-cloud` |
|
||||
|
||||
|
||||
|
||||
### Update Data-table a data change
|
||||
|
||||
v6.0.0 and after You will need to provide a ```DataTableService``` to update a row of your table.
|
||||
|
@ -25,7 +25,7 @@ import { AspectListDialogComponentData } from './aspect-list-dialog-data.interfa
|
||||
import { AspectListService } from './services/aspect-list.service';
|
||||
import { delay } from 'rxjs/operators';
|
||||
import { AspectEntry, MinimalNode } from '@alfresco/js-api';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
|
||||
const aspectListMock: AspectEntry[] = [{
|
||||
entry: {
|
||||
|
@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AspectListComponent } from './aspect-list.component';
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { Observable, Subject, zip } from 'rxjs';
|
||||
import { concatMap, map, takeUntil, tap } from 'rxjs/operators';
|
||||
import { AspectListService } from './services/aspect-list.service';
|
||||
|
@ -18,7 +18,8 @@
|
||||
import { MinimalNode } from '@alfresco/js-api';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { NodeAspectService } from './node-aspect.service';
|
||||
|
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { DialogAspectListService } from './dialog-aspect-list.service';
|
||||
import { CardViewContentUpdateService } from '../../common/services/card-view-content-update.service';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@ -33,8 +33,7 @@ export class CategoryTreeDatasourceService extends TreeService<CategoryNode> {
|
||||
public getSubNodes(parentNodeId: string, skipCount?: number, maxItems?: number, name?: string): Observable<TreeResponse<CategoryNode>> {
|
||||
return !name ? this.categoryService.getSubcategories(parentNodeId, skipCount, maxItems).pipe(map((response: CategoryPaging) => {
|
||||
const parentNode: CategoryNode = this.getParentNode(parentNodeId);
|
||||
const nodesList: CategoryNode[] = response.list.entries.map((entry: CategoryEntry) => {
|
||||
return {
|
||||
const nodesList: CategoryNode[] = response.list.entries.map((entry: CategoryEntry) => ({
|
||||
id: entry.entry.id,
|
||||
nodeName: entry.entry.name,
|
||||
parentId: entry.entry.parentId,
|
||||
@ -42,8 +41,7 @@ export class CategoryTreeDatasourceService extends TreeService<CategoryNode> {
|
||||
level: parentNode ? parentNode.level + 1 : 0,
|
||||
isLoading: false,
|
||||
nodeType: TreeNodeType.RegularNode
|
||||
};
|
||||
});
|
||||
}));
|
||||
if (response.list.pagination.hasMoreItems && parentNode) {
|
||||
const loadMoreNode: CategoryNode = {
|
||||
id: 'loadMore',
|
||||
|
@ -15,20 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EcmCompanyModel } from '../models/ecm-company.model';
|
||||
import { PersonEntry, Person, PersonPaging } from '@alfresco/js-api';
|
||||
|
||||
export const fakeEcmCompany: EcmCompanyModel = {
|
||||
organization: 'company-fake-name',
|
||||
address1: 'fake-address-1',
|
||||
address2: 'fake-address-2',
|
||||
address3: 'fake-address-3',
|
||||
postcode: 'fAk1',
|
||||
telephone: '00000000',
|
||||
fax: '11111111',
|
||||
email: 'fakeCompany@fake.com'
|
||||
};
|
||||
|
||||
export const fakeEcmUser = {
|
||||
id: 'fake-id',
|
||||
firstName: 'fake-ecm-first-name',
|
@ -18,5 +18,22 @@
|
||||
export * from './services/favorites-api.service';
|
||||
export * from './services/card-view-content-update.service';
|
||||
export * from './services/sites.service';
|
||||
export * from './services/rendition.service';
|
||||
export * from './services/upload.service';
|
||||
export * from './services/nodes-api.service';
|
||||
export * from './services/discovery-api.service';
|
||||
export * from './services/people-content.service';
|
||||
export * from './services/content.service';
|
||||
|
||||
export * from './events/file.event';
|
||||
|
||||
export * from './models/ecm-user.model';
|
||||
export * from './models/ecm-company.model';
|
||||
export * from './models/file.model';
|
||||
export * from './models/node-metadata.model';
|
||||
|
||||
export * from './models/permissions.enum';
|
||||
export * from './models/allowable-operations.enum';
|
||||
|
||||
export * from './interfaces/search-configuration.interface';
|
||||
export * from './mocks/ecm-user.service.mock';
|
||||
|
@ -17,12 +17,8 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentService } from './content.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AuthenticationService } from '../auth/services/authentication.service';
|
||||
import { StorageService } from '../common/services/storage.service';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { AppConfigService, AuthenticationService, StorageService, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { CoreTestingModule } from '../testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
declare let jasmine: any;
|
||||
@ -82,21 +78,6 @@ describe('ContentService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should return a valid thumbnail URL', (done) => {
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
expect(contentService.getDocumentThumbnailUrl(node))
|
||||
.toContain('/ecm/alfresco/api/-default-/public/alfresco' +
|
||||
'/versions/1/nodes/fake-node-id/renditions/doclib/content?attachment=false&alf_ticket=fake-post-ticket');
|
||||
done();
|
||||
});
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 201,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify({ entry: { id: 'fake-post-ticket', userId: 'admin' } })
|
||||
});
|
||||
});
|
||||
|
||||
describe('AllowableOperations', () => {
|
||||
|
||||
it('should hasAllowableOperations be false if allowableOperation is not present in the node', () => {
|
@ -16,17 +16,11 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { ContentApi, MinimalNode, Node, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||
import { Observable, Subject, from, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AuthenticationService } from '../auth/services/authentication.service';
|
||||
import { LogService } from '../common/services/log.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { ContentApi, MinimalNode, Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AlfrescoApiService, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { PermissionsEnum } from '../models/permissions.enum';
|
||||
import { AllowableOperationsEnum } from '../models/allowable-operations.enum';
|
||||
import { DownloadService } from './download.service';
|
||||
import { ThumbnailService } from '../common/services/thumbnail.service';
|
||||
|
||||
export interface FolderCreatedEvent {
|
||||
name: string;
|
||||
@ -50,53 +44,10 @@ export class ContentService {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
private _nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
}
|
||||
|
||||
constructor(public authService: AuthenticationService,
|
||||
public apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private sanitizer: DomSanitizer,
|
||||
private downloadService: DownloadService,
|
||||
private thumbnailService: ThumbnailService) {
|
||||
public apiService: AlfrescoApiService) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated in 3.2.0, use DownloadService instead.
|
||||
* Invokes content download for a Blob with a file name.
|
||||
* @param blob Content to download.
|
||||
* @param fileName Name of the resulting file.
|
||||
*/
|
||||
downloadBlob(blob: Blob, fileName: string): void {
|
||||
this.downloadService.downloadBlob(blob, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a trusted object URL from the Blob.
|
||||
* WARNING: calling this method with untrusted user data exposes your application to XSS security risks!
|
||||
*
|
||||
* @param blob Data to wrap into object URL
|
||||
* @returns URL string
|
||||
*/
|
||||
createTrustedUrl(blob: Blob): string {
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
return this.sanitizer.bypassSecurityTrustUrl(url) as string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated in 3.2.0, use ThumbnailService instead.
|
||||
* Gets a thumbnail URL for the given document node.
|
||||
* @param node Node or Node ID to get URL for.
|
||||
* @param attachment Toggles whether to retrieve content as an attachment for download
|
||||
* @param ticket Custom ticket to use for authentication
|
||||
* @returns URL string
|
||||
*/
|
||||
getDocumentThumbnailUrl(node: NodeEntry | string, attachment?: boolean, ticket?: string): string {
|
||||
return this.thumbnailService.getDocumentThumbnailUrl(node, attachment, ticket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a content URL for the given node.
|
||||
@ -122,28 +73,8 @@ export class ContentService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets content for the given node.
|
||||
*
|
||||
* @param nodeId ID of the target node
|
||||
* @returns Content data
|
||||
*/
|
||||
getNodeContent(nodeId: string): Observable<any> {
|
||||
return from(this.nodesApi.getNodeContent(nodeId))
|
||||
.pipe(
|
||||
catchError((err: any) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Node via its node ID.
|
||||
*
|
||||
* @param nodeId ID of the target node
|
||||
* @param opts Options supported by JS-API
|
||||
* @returns Details of the folder
|
||||
*/
|
||||
getNode(nodeId: string, opts?: any): Observable<NodeEntry> {
|
||||
return from(this.nodesApi.getNode(nodeId, opts));
|
||||
getDocumentThumbnailUrl(nodeId: string, attachment?: boolean, ticket?: string): string {
|
||||
return this.contentApi.getDocumentThumbnailUrl(nodeId, attachment, ticket);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -219,8 +150,4 @@ export class ContentService {
|
||||
return hasAllowableOperations;
|
||||
}
|
||||
|
||||
private handleError(error: any) {
|
||||
this.logService.error(error);
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
}
|
@ -20,9 +20,7 @@ import { from, Observable, throwError, Subject } from 'rxjs';
|
||||
import { catchError, map, switchMap, filter, take } from 'rxjs/operators';
|
||||
import { RepositoryInfo, SystemPropertiesRepresentation } from '@alfresco/js-api';
|
||||
|
||||
import { BpmProductVersionModel } from '../models/product-version.model';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AuthenticationService } from '../auth/services/authentication.service';
|
||||
import { BpmProductVersionModel, AlfrescoApiService, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { ApiClientsService } from '@alfresco/adf-core/api';
|
||||
|
||||
@Injectable({
|
@ -18,8 +18,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MinimalNode, NodeEntry, NodePaging, NodesApi, TrashcanApi, Node } from '@alfresco/js-api';
|
||||
import { Subject, from, Observable, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from '../common/services/user-preferences.service';
|
||||
import { AlfrescoApiService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { NodeMetadata } from '../models/node-metadata.model';
|
||||
|
||||
@ -198,6 +197,19 @@ export class NodesApiService {
|
||||
return this.createNodeInsideRoot(name || this.generateUuid(), nodeType, properties, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets content for the given node.
|
||||
*
|
||||
* @param nodeId ID of the target node
|
||||
* @returns Content data
|
||||
*/
|
||||
getNodeContent(nodeId: string): Observable<any> {
|
||||
return from(this.nodesApi.getNodeContent(nodeId))
|
||||
.pipe(
|
||||
catchError((err) => throwError(err))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Node inside `-root-` folder
|
||||
*
|
@ -15,15 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { fakeEcmUserList, createNewPersonMock, fakeEcmUser, fakeEcmAdminUser } from '../mock/ecm-user.service.mock';
|
||||
import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { fakeEcmUserList, createNewPersonMock, fakeEcmUser, fakeEcmAdminUser } from '../mocks/ecm-user.service.mock';
|
||||
import { AuthenticationService, AlfrescoApiService, AlfrescoApiServiceMock, CoreTestingModule, LogService } from '@alfresco/adf-core';
|
||||
import { PeopleContentService, PeopleContentQueryRequestModel } from './people-content.service';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { LogService } from '../common/services/log.service';
|
||||
import { AuthenticationService } from '../auth/services/authentication.service';
|
||||
|
||||
describe('PeopleContentService', () => {
|
||||
|
@ -17,12 +17,10 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError, of } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AuthenticationService, AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { catchError, map, tap } from 'rxjs/operators';
|
||||
import { PeopleApi, PersonBodyCreate, Pagination, PersonBodyUpdate } from '@alfresco/js-api';
|
||||
import { EcmUserModel } from '../models/ecm-user.model';
|
||||
import { LogService } from '../common/services/log.service';
|
||||
import { AuthenticationService } from '../auth/services/authentication.service';
|
||||
import { ContentService } from './content.service';
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
@ -77,10 +75,10 @@ export class PeopleContentService {
|
||||
*/
|
||||
getPerson(personId: string): Observable<EcmUserModel> {
|
||||
return from(this.peopleApi.getPerson(personId))
|
||||
.pipe(
|
||||
map((personEntry) => new EcmUserModel(personEntry.entry)),
|
||||
tap( user => this.currentUser = user),
|
||||
catchError((error) => this.handleError(error)));
|
||||
.pipe(
|
||||
map((personEntry) => new EcmUserModel(personEntry.entry)),
|
||||
tap(user => this.currentUser = user),
|
||||
catchError((error) => this.handleError(error)));
|
||||
}
|
||||
|
||||
getCurrentPerson(): Observable<EcmUserModel> {
|
||||
@ -99,11 +97,11 @@ export class PeopleContentService {
|
||||
return this.getPerson('-me-');
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to know if the current user has the admin capability
|
||||
*
|
||||
* @returns true or false
|
||||
*/
|
||||
/**
|
||||
* Used to know if the current user has the admin capability
|
||||
*
|
||||
* @returns true or false
|
||||
*/
|
||||
isCurrentUserAdmin(): boolean {
|
||||
return this.currentUser?.isAdmin() ?? false;
|
||||
}
|
||||
@ -122,7 +120,7 @@ export class PeopleContentService {
|
||||
* @returns Response containing pagination and list of entries
|
||||
*/
|
||||
listPeople(requestQuery?: PeopleContentQueryRequestModel): Observable<PeopleContentQueryResponse> {
|
||||
const requestQueryParams = { skipCount: requestQuery?.skipCount, maxItems: requestQuery?.maxItems };
|
||||
const requestQueryParams = {skipCount: requestQuery?.skipCount, maxItems: requestQuery?.maxItems};
|
||||
const orderBy = this.buildOrderArray(requestQuery?.sorting);
|
||||
if (orderBy.length) {
|
||||
requestQueryParams['orderBy'] = orderBy;
|
||||
@ -173,7 +171,7 @@ export class PeopleContentService {
|
||||
* @param avatarId Target avatar
|
||||
* @returns Image URL
|
||||
*/
|
||||
getUserProfileImage(avatarId: string): string {
|
||||
getUserProfileImage(avatarId: string): string {
|
||||
return this.contentService.getContentUrl(avatarId);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import { AlfrescoApiService , LogService, Track,TranslationService, ViewUtilServ
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RenditionViewerService {
|
||||
export class RenditionService {
|
||||
|
||||
static TARGET = '_new';
|
||||
|
||||
@ -82,8 +82,8 @@ export class RenditionViewerService {
|
||||
|
||||
|
||||
getRenditionUrl(nodeId: string, type: string, renditionExists: boolean): string {
|
||||
return (renditionExists && type !== RenditionViewerService.ContentGroup.IMAGE) ?
|
||||
this.contentApi.getRenditionUrl(nodeId, RenditionViewerService.ContentGroup.PDF) :
|
||||
return (renditionExists && type !== RenditionService.ContentGroup.IMAGE) ?
|
||||
this.contentApi.getRenditionUrl(nodeId, RenditionService.ContentGroup.PDF) :
|
||||
this.contentApi.getContentUrl(nodeId, false);
|
||||
}
|
||||
|
||||
@ -230,20 +230,20 @@ export class RenditionViewerService {
|
||||
}
|
||||
|
||||
async generateMediaTracksRendition(nodeId: string): Promise<Track[]> {
|
||||
return this.isRenditionAvailable(nodeId, RenditionViewerService.SUBTITLES_RENDITION_NAME)
|
||||
return this.isRenditionAvailable(nodeId, RenditionService.SUBTITLES_RENDITION_NAME)
|
||||
.then((value) => {
|
||||
const tracks = [];
|
||||
if (value) {
|
||||
tracks.push({
|
||||
kind: 'subtitles',
|
||||
src: this.contentApi.getRenditionUrl(nodeId, RenditionViewerService.SUBTITLES_RENDITION_NAME),
|
||||
src: this.contentApi.getRenditionUrl(nodeId, RenditionService.SUBTITLES_RENDITION_NAME),
|
||||
label: this.translateService.instant('ADF_VIEWER.SUBTITLES')
|
||||
});
|
||||
}
|
||||
return tracks;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.logService.error('Error while retrieving ' + RenditionViewerService.SUBTITLES_RENDITION_NAME + ' rendition');
|
||||
this.logService.error('Error while retrieving ' + RenditionService.SUBTITLES_RENDITION_NAME + ' rendition');
|
||||
this.logService.error(err);
|
||||
return [];
|
||||
});
|
||||
@ -262,10 +262,10 @@ export class RenditionViewerService {
|
||||
* This URL should be one that can be rendered in the browser, for example PDF, Image, or Text
|
||||
*/
|
||||
printFile(url: string, type: string): void {
|
||||
const pwa = window.open(url, RenditionViewerService.TARGET);
|
||||
const pwa = window.open(url, RenditionService.TARGET);
|
||||
if (pwa) {
|
||||
// Because of the way chrome focus and close image window vs. pdf preview window
|
||||
if (type === RenditionViewerService.ContentGroup.IMAGE) {
|
||||
if (type === RenditionService.ContentGroup.IMAGE) {
|
||||
pwa.onfocus = () => {
|
||||
setTimeout(() => {
|
||||
pwa.close();
|
||||
@ -290,12 +290,12 @@ export class RenditionViewerService {
|
||||
const nodeId = objectId;
|
||||
const type: string = this.viewUtilsService.getViewerTypeByMimeType(mimeType);
|
||||
|
||||
this.getRendition(nodeId, RenditionViewerService.ContentGroup.PDF)
|
||||
this.getRendition(nodeId, RenditionService.ContentGroup.PDF)
|
||||
.then((value) => {
|
||||
const url: string = this.getRenditionUrl(nodeId, type, (!!value));
|
||||
const printType = (type === RenditionViewerService.ContentGroup.PDF
|
||||
|| type === RenditionViewerService.ContentGroup.TEXT)
|
||||
? RenditionViewerService.ContentGroup.PDF : type;
|
||||
const printType = (type === RenditionService.ContentGroup.PDF
|
||||
|| type === RenditionService.ContentGroup.TEXT)
|
||||
? RenditionService.ContentGroup.PDF : type;
|
||||
this.printFile(url, printType);
|
||||
})
|
||||
.catch((err) => {
|
@ -17,17 +17,13 @@
|
||||
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { FileModel, FileUploadStatus } from '../models/file.model';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AppConfigModule, AppConfigService, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { UploadService } from './upload.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { RepositoryInfo } from '@alfresco/js-api';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { DiscoveryApiService } from './discovery-api.service';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { DiscoveryApiService } from '../../common/services/discovery-api.service';
|
||||
import { FileModel, FileUploadStatus } from '../../common/models/file.model';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
@ -18,7 +18,6 @@
|
||||
import { EventEmitter, Injectable } from '@angular/core';
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import {
|
||||
FileUploadCompleteEvent,
|
||||
FileUploadDeleteEvent,
|
||||
@ -26,9 +25,9 @@ import {
|
||||
FileUploadEvent
|
||||
} from '../events/file.event';
|
||||
import { FileModel, FileUploadProgress, FileUploadStatus } from '../models/file.model';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { DiscoveryApiService } from './discovery-api.service';
|
||||
import { AppConfigService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { DiscoveryApiService } from '../../common/services/discovery-api.service';
|
||||
import { NodesApi, UploadApi, VersionsApi } from '@alfresco/js-api';
|
||||
|
||||
const MIN_CANCELLABLE_FILE_SIZE = 1000000;
|
||||
@ -85,7 +84,7 @@ export class UploadService {
|
||||
private discoveryApiService: DiscoveryApiService) {
|
||||
|
||||
this.discoveryApiService.ecmProductInfo$.pipe(filter(info => !!info))
|
||||
.subscribe(({ status }) => {
|
||||
.subscribe(({status}) => {
|
||||
this.isThumbnailGenerationEnabled = status.isThumbnailGenerationEnabled;
|
||||
});
|
||||
}
|
||||
@ -238,7 +237,7 @@ export class UploadService {
|
||||
if (file.id) {
|
||||
return this.nodesApi.updateNodeContent(file.id, file.file as any, opts);
|
||||
} else {
|
||||
const nodeBody = { ... file.options };
|
||||
const nodeBody = {...file.options};
|
||||
delete nodeBody['versioningEnabled'];
|
||||
|
||||
return this.uploadApi.uploadFile(
|
||||
@ -275,13 +274,13 @@ export class UploadService {
|
||||
.on('abort', () => {
|
||||
this.onUploadAborted(file);
|
||||
if (successEmitter) {
|
||||
successEmitter.emit({ value: 'File aborted' });
|
||||
successEmitter.emit({value: 'File aborted'});
|
||||
}
|
||||
})
|
||||
.on('error', (err) => {
|
||||
this.onUploadError(file, err);
|
||||
if (errorEmitter) {
|
||||
errorEmitter.emit({ value: 'Error file uploaded' });
|
||||
errorEmitter.emit({value: 'Error file uploaded'});
|
||||
}
|
||||
})
|
||||
.on('success', (data) => {
|
||||
@ -293,12 +292,12 @@ export class UploadService {
|
||||
this.deleteAbortedNodeVersion(data.entry.id, data.entry.properties['cm:versionLabel']);
|
||||
}
|
||||
if (successEmitter) {
|
||||
successEmitter.emit({ value: 'File deleted' });
|
||||
successEmitter.emit({value: 'File deleted'});
|
||||
}
|
||||
} else {
|
||||
this.onUploadComplete(file, data);
|
||||
if (successEmitter) {
|
||||
successEmitter.emit({ value: data });
|
||||
successEmitter.emit({value: data});
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -416,7 +415,7 @@ export class UploadService {
|
||||
}
|
||||
|
||||
private deleteAbortedNode(nodeId: string) {
|
||||
this.nodesApi.deleteNode(nodeId, { permanent: true })
|
||||
this.nodesApi.deleteNode(nodeId, {permanent: true})
|
||||
.then(() => (this.abortedFile = undefined));
|
||||
}
|
||||
|
@ -20,12 +20,13 @@ import { By } from '@angular/platform-browser';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentMetadataCardComponent } from './content-metadata-card.component';
|
||||
import { ContentMetadataComponent } from '../content-metadata/content-metadata.component';
|
||||
import { setupTestBed, AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodeAspectService } from '../../../aspect-list/services/node-aspect.service';
|
||||
import { ContentMetadataService } from '../../services/content-metadata.service';
|
||||
import { AllowableOperationsEnum } from '../../../common/models/allowable-operations.enum';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
describe('ContentMetadataCardComponent', () => {
|
||||
|
@ -17,10 +17,12 @@
|
||||
|
||||
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentService, AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { NodeAspectService } from '../../../aspect-list/services/node-aspect.service';
|
||||
import { PresetConfig } from '../../interfaces/content-metadata.interfaces';
|
||||
import { VersionCompatibilityService } from '../../../version-compatibility/version-compatibility.service';
|
||||
import { ContentService } from '../../../common/services/content.service';
|
||||
import { AllowableOperationsEnum } from '../../../common/models/allowable-operations.enum';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-content-metadata-card',
|
||||
templateUrl: './content-metadata-card.component.html',
|
||||
|
@ -22,9 +22,10 @@ import { ClassesApi, MinimalNode, Node } from '@alfresco/js-api';
|
||||
import { ContentMetadataComponent } from './content-metadata.component';
|
||||
import { ContentMetadataService } from '../../services/content-metadata.service';
|
||||
import {
|
||||
CardViewBaseItemModel, CardViewComponent, NodesApiService,
|
||||
CardViewBaseItemModel, CardViewComponent,
|
||||
LogService, setupTestBed, AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { throwError, of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { mockGroupProperties } from './mock-data';
|
||||
|
@ -20,7 +20,6 @@ import { Node } from '@alfresco/js-api';
|
||||
import { Observable, Subject, of, zip } from 'rxjs';
|
||||
import {
|
||||
CardViewItem,
|
||||
NodesApiService,
|
||||
LogService,
|
||||
TranslationService,
|
||||
AppConfigService,
|
||||
@ -31,6 +30,7 @@ import { ContentMetadataService } from '../../services/content-metadata.service'
|
||||
import { CardViewGroup, PresetConfig } from '../../interfaces/content-metadata.interfaces';
|
||||
import { takeUntil, debounceTime, catchError, map } from 'rxjs/operators';
|
||||
import { CardViewContentUpdateService } from '../../../common/services/card-view-content-update.service';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
|
||||
const DEFAULT_SEPARATOR = ', ';
|
||||
|
||||
|
@ -17,9 +17,11 @@
|
||||
|
||||
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { EventEmitter, Injectable, Output } from '@angular/core';
|
||||
import { ContentService, ThumbnailService, TranslationService, AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { ThumbnailService, TranslationService } from '@alfresco/adf-core';
|
||||
import { Subject, Observable, throwError } from 'rxjs';
|
||||
import { ShareDataRow } from '../document-list/data/share-data-row.model';
|
||||
import { AllowableOperationsEnum } from '../common/models/allowable-operations.enum';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { Node, NodeEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||
|
@ -28,7 +28,7 @@ import {
|
||||
SiteEntry,
|
||||
SitePaging
|
||||
} from '@alfresco/js-api';
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
@ -40,6 +40,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { SearchQueryBuilderService } from '../search';
|
||||
import { mockQueryBody } from '../mock/search-query.mock';
|
||||
import { SitesService } from '../common/services/sites.service';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
|
||||
const fakeResultSetPaging: ResultSetPaging = {
|
||||
list: {
|
||||
|
@ -30,17 +30,17 @@ import {
|
||||
} from '@alfresco/js-api';
|
||||
import {
|
||||
AppConfigService,
|
||||
FileModel,
|
||||
FileUploadStatus,
|
||||
NodesApiService,
|
||||
setupTestBed,
|
||||
UploadService,
|
||||
FileUploadCompleteEvent,
|
||||
DataRow,
|
||||
ThumbnailService,
|
||||
ContentService,
|
||||
DataColumn
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { UploadService } from '../common/services/upload.service';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { FileModel, FileUploadStatus } from '../common/models/file.model';
|
||||
import { FileUploadCompleteEvent } from '../common/events/file.event';
|
||||
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { DropdownBreadcrumbComponent } from '../breadcrumb';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
|
@ -31,14 +31,13 @@ import {
|
||||
UserPreferencesService,
|
||||
UserPreferenceValues,
|
||||
InfinitePaginationComponent, PaginatedComponent,
|
||||
NodesApiService,
|
||||
UploadService,
|
||||
FileUploadCompleteEvent,
|
||||
FileUploadDeleteEvent,
|
||||
AppConfigService,
|
||||
DataSorting,
|
||||
ShowHeaderMode
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { UploadService } from '../common/services/upload.service';
|
||||
import { FileUploadCompleteEvent, FileUploadDeleteEvent } from '../common/events/file.event';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { Node, NodePaging, Pagination, SiteEntry, SitePaging, NodeEntry, QueryBody, RequestScope } from '@alfresco/js-api';
|
||||
import { DocumentListComponent } from '../document-list/components/document-list.component';
|
||||
|
@ -21,7 +21,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||
import { Node, NodeEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentService, UploadService, FileModel, FileUploadEvent } from '@alfresco/adf-core';
|
||||
import { FileModel } from '../common/models/file.model';
|
||||
import { FileUploadEvent } from '../common/events/file.event';
|
||||
import { UploadService } from '../common/services/upload.service';
|
||||
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
@ -31,6 +34,8 @@ import { UploadModule } from '../upload';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { NodeAction } from '../document-list/models/node-action.enum';
|
||||
import { SitesService } from '../common/services/sites.service';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
|
||||
describe('ContentNodeSelectorComponent', () => {
|
||||
let component: ContentNodeSelectorComponent;
|
||||
@ -103,7 +108,8 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
}
|
||||
});
|
||||
|
||||
spyOn(contentService, 'getNode').and.returnValue(of(fakeFolderNodeWithPermission));
|
||||
const nodesApiService = TestBed.inject(NodesApiService);
|
||||
spyOn(nodesApiService, 'getNode').and.returnValue(of(fakeFolderNodeWithPermission.entry));
|
||||
|
||||
component.data.showLocalUploadButton = true;
|
||||
component.hasAllowableOperations = true;
|
||||
|
@ -17,9 +17,11 @@
|
||||
|
||||
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { TranslationService, NotificationService, AllowableOperationsEnum, ContentService, UploadService } from '@alfresco/adf-core';
|
||||
import { TranslationService, NotificationService} from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
|
||||
import { AllowableOperationsEnum } from '../common/models/allowable-operations.enum';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { UploadService } from '../common/services/upload.service';
|
||||
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
||||
import { NodeEntryEvent } from '../document-list/components/node.event';
|
||||
import { NodeAction } from '../document-list/models/node-action.enum';
|
||||
|
@ -17,14 +17,15 @@
|
||||
|
||||
import { TestBed, fakeAsync, ComponentFixture, tick } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
|
||||
import { of, empty } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
import {
|
||||
setupTestBed,
|
||||
NodesApiService,
|
||||
NotificationService,
|
||||
RenditionsService,
|
||||
AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { RenditionService } from '../common/services/rendition.service';
|
||||
|
||||
import { SharedLinksApiService } from './services/shared-links-api.service';
|
||||
import { ShareDialogComponent } from './content-node-share.dialog';
|
||||
import moment from 'moment';
|
||||
@ -38,7 +39,7 @@ describe('ShareDialogComponent', () => {
|
||||
openSnackMessage: jasmine.createSpy('openSnackMessage')
|
||||
};
|
||||
let sharedLinksApiService: SharedLinksApiService;
|
||||
let renditionService: RenditionsService;
|
||||
let renditionService: RenditionService;
|
||||
let nodesApiService: NodesApiService;
|
||||
let fixture: ComponentFixture<ShareDialogComponent>;
|
||||
let component: ShareDialogComponent;
|
||||
@ -50,9 +51,14 @@ describe('ShareDialogComponent', () => {
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: NotificationService, useValue: notificationServiceMock },
|
||||
{ provide: MatDialogRef, useValue: { close: () => {}} },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: {} }
|
||||
{provide: NotificationService, useValue: notificationServiceMock},
|
||||
{
|
||||
provide: MatDialogRef, useValue: {
|
||||
close: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
{provide: MAT_DIALOG_DATA, useValue: {}}
|
||||
]
|
||||
});
|
||||
|
||||
@ -63,7 +69,7 @@ describe('ShareDialogComponent', () => {
|
||||
|
||||
matDialog = TestBed.inject(MatDialog);
|
||||
sharedLinksApiService = TestBed.inject(SharedLinksApiService);
|
||||
renditionService = TestBed.inject(RenditionsService);
|
||||
renditionService = TestBed.inject(RenditionService);
|
||||
nodesApiService = TestBed.inject(NodesApiService);
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
|
||||
@ -117,9 +123,9 @@ describe('ShareDialogComponent', () => {
|
||||
|
||||
it(`should toggle share action when property 'sharedId' does not exists`, () => {
|
||||
spyOn(sharedLinksApiService, 'createSharedLinks').and.returnValue(of({
|
||||
entry: { id: 'sharedId', sharedId: 'sharedId' }
|
||||
entry: {id: 'sharedId', sharedId: 'sharedId'}
|
||||
}));
|
||||
spyOn(renditionService, 'generateRenditionForNode').and.returnValue(empty());
|
||||
spyOn(renditionService, 'getNodeRendition').and.returnValue(Promise.resolve({url: '', mimeType: ''}));
|
||||
|
||||
component.data = {
|
||||
node,
|
||||
@ -129,16 +135,16 @@ describe('ShareDialogComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(sharedLinksApiService.createSharedLinks).toHaveBeenCalled();
|
||||
expect(renditionService.generateRenditionForNode).toHaveBeenCalled();
|
||||
expect(renditionService.getNodeRendition).toHaveBeenCalled();
|
||||
expect(fixture.nativeElement.querySelector('input[formcontrolname="sharedUrl"]').value).toBe('some-url/sharedId');
|
||||
expect(fixture.nativeElement.querySelector('.mat-slide-toggle').classList).toContain('mat-checked');
|
||||
});
|
||||
|
||||
it(`should not toggle share action when file has 'sharedId' property`, async () => {
|
||||
spyOn(sharedLinksApiService, 'createSharedLinks').and.returnValue(of({
|
||||
entry: { id: 'sharedId', sharedId: 'sharedId' }
|
||||
entry: {id: 'sharedId', sharedId: 'sharedId'}
|
||||
}));
|
||||
spyOn(renditionService, 'generateRenditionForNode').and.returnValue(empty());
|
||||
spyOn(renditionService, 'getNodeRendition').and.returnValue(Promise.resolve({url: '', mimeType: ''}));
|
||||
|
||||
node.entry.properties['qshare:sharedId'] = 'sharedId';
|
||||
|
||||
@ -158,7 +164,7 @@ describe('ShareDialogComponent', () => {
|
||||
});
|
||||
|
||||
it('should open a confirmation dialog when unshare button is triggered', () => {
|
||||
spyOn(matDialog, 'open').and.returnValue({ beforeClosed: () => of(false) } as any);
|
||||
spyOn(matDialog, 'open').and.returnValue({beforeClosed: () => of(false)} as any);
|
||||
spyOn(sharedLinksApiService, 'deleteSharedLink').and.callThrough();
|
||||
|
||||
node.entry.properties['qshare:sharedId'] = 'sharedId';
|
||||
@ -179,7 +185,7 @@ describe('ShareDialogComponent', () => {
|
||||
});
|
||||
|
||||
it('should unshare file when confirmation dialog returns true', fakeAsync(() => {
|
||||
spyOn(matDialog, 'open').and.returnValue({ beforeClosed: () => of(true) } as any);
|
||||
spyOn(matDialog, 'open').and.returnValue({beforeClosed: () => of(true)} as any);
|
||||
spyOn(sharedLinksApiService, 'deleteSharedLink').and.returnValue(of({}));
|
||||
node.entry.properties['qshare:sharedId'] = 'sharedId';
|
||||
|
||||
@ -199,7 +205,7 @@ describe('ShareDialogComponent', () => {
|
||||
}));
|
||||
|
||||
it('should not unshare file when confirmation dialog returns false', fakeAsync(() => {
|
||||
spyOn(matDialog, 'open').and.returnValue({ beforeClosed: () => of(false) } as any);
|
||||
spyOn(matDialog, 'open').and.returnValue({beforeClosed: () => of(false)} as any);
|
||||
spyOn(sharedLinksApiService, 'deleteSharedLink').and.callThrough();
|
||||
node.entry.properties['qshare:sharedId'] = 'sharedId';
|
||||
|
||||
@ -258,7 +264,7 @@ describe('ShareDialogComponent', () => {
|
||||
await fixture.whenStable();
|
||||
|
||||
expect(nodesApiService.updateNode).toHaveBeenCalledWith('nodeId', {
|
||||
properties: { 'qshare:expiryDate': null }
|
||||
properties: {'qshare:expiryDate': null}
|
||||
});
|
||||
|
||||
expect(
|
||||
@ -297,10 +303,10 @@ describe('ShareDialogComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.nativeElement
|
||||
.querySelector(
|
||||
'mat-slide-toggle[data-automation-id="adf-expire-toggle"] label'
|
||||
)
|
||||
.dispatchEvent(new MouseEvent('click'));
|
||||
.querySelector(
|
||||
'mat-slide-toggle[data-automation-id="adf-expire-toggle"] label'
|
||||
)
|
||||
.dispatchEvent(new MouseEvent('click'));
|
||||
|
||||
fixture.componentInstance.form.controls['time'].setValue(date);
|
||||
fixture.detectChanges();
|
||||
@ -308,7 +314,7 @@ describe('ShareDialogComponent', () => {
|
||||
tick(100);
|
||||
|
||||
expect(nodesApiService.updateNode).toHaveBeenCalledWith('nodeId', {
|
||||
properties: { 'qshare:expiryDate': date.utc().format() }
|
||||
properties: {'qshare:expiryDate': date.utc().format()}
|
||||
});
|
||||
}));
|
||||
|
||||
@ -336,7 +342,7 @@ describe('ShareDialogComponent', () => {
|
||||
tick(500);
|
||||
|
||||
expect(nodesApiService.updateNode).toHaveBeenCalledWith('nodeId', {
|
||||
properties: { 'qshare:expiryDate': date.endOf('day').utc().format() }
|
||||
properties: {'qshare:expiryDate': date.endOf('day').utc().format()}
|
||||
});
|
||||
}));
|
||||
|
||||
@ -354,7 +360,7 @@ describe('ShareDialogComponent', () => {
|
||||
tick(100);
|
||||
|
||||
expect(nodesApiService.updateNode).toHaveBeenCalledWith('nodeId', {
|
||||
properties: { 'qshare:expiryDate': date.utc().format() }
|
||||
properties: {'qshare:expiryDate': date.utc().format()}
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
@ -28,17 +28,18 @@ import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||
import { UntypedFormGroup, UntypedFormControl, AbstractControl } from '@angular/forms';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import {
|
||||
NodesApiService,
|
||||
ContentService,
|
||||
RenditionsService,
|
||||
AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
|
||||
import { SharedLinksApiService } from './services/shared-links-api.service';
|
||||
import { SharedLinkEntry, Node } from '@alfresco/js-api';
|
||||
import { ConfirmDialogComponent } from '../dialogs/confirm.dialog';
|
||||
import moment from 'moment';
|
||||
import { ContentNodeShareSettings } from './content-node-share.settings';
|
||||
import { takeUntil, debounceTime } from 'rxjs/operators';
|
||||
import { RenditionService } from '../common/services/rendition.service';
|
||||
|
||||
type DatePickerType = 'date' | 'time' | 'month' | 'datetime';
|
||||
|
||||
@ -46,7 +47,7 @@ type DatePickerType = 'date' | 'time' | 'month' | 'datetime';
|
||||
selector: 'adf-share-dialog',
|
||||
templateUrl: './content-node-share.dialog.html',
|
||||
styleUrls: ['./content-node-share.dialog.scss'],
|
||||
host: { class: 'adf-share-dialog' },
|
||||
host: {class: 'adf-share-dialog'},
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
@ -59,15 +60,15 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
isDisabled: boolean = false;
|
||||
form: UntypedFormGroup = new UntypedFormGroup({
|
||||
sharedUrl: new UntypedFormControl(''),
|
||||
time: new UntypedFormControl({ value: '', disabled: true })
|
||||
time: new UntypedFormControl({value: '', disabled: true})
|
||||
});
|
||||
type: DatePickerType = 'datetime';
|
||||
maxDebounceTime = 500;
|
||||
|
||||
@ViewChild('slideToggleExpirationDate', { static: true })
|
||||
@ViewChild('slideToggleExpirationDate', {static: true})
|
||||
slideToggleExpirationDate;
|
||||
|
||||
@ViewChild('dateTimePickerInput', { static: true })
|
||||
@ViewChild('dateTimePickerInput', {static: true})
|
||||
dateTimePickerInput;
|
||||
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
@ -79,9 +80,10 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
private dialog: MatDialog,
|
||||
private nodesApiService: NodesApiService,
|
||||
private contentService: ContentService,
|
||||
private renditionService: RenditionsService,
|
||||
private renditionService: RenditionService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: ContentNodeShareSettings
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.type = this.appConfigService.get<DatePickerType>('sharedLinkDateTimePickerType', 'datetime');
|
||||
@ -133,7 +135,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
get canUpdate() {
|
||||
const { entry } = this.data.node;
|
||||
const {entry} = this.data.node;
|
||||
|
||||
if (entry && entry.allowableOperations) {
|
||||
return this.contentService.hasAllowableOperations(entry, 'update');
|
||||
@ -199,9 +201,9 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
this.isDisabled = false;
|
||||
this.isFileShared = true;
|
||||
this.renditionService
|
||||
.generateRenditionForNode(this.data.node.entry.id)
|
||||
.subscribe(() => {});
|
||||
|
||||
// eslint-disable-next-line
|
||||
this.renditionService.getNodeRendition(this.data.node.entry.id);
|
||||
|
||||
this.updateForm();
|
||||
}
|
||||
@ -219,19 +221,19 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
this.sharedLinksApiService
|
||||
.deleteSharedLink(sharedId)
|
||||
.subscribe((response: any) => {
|
||||
if (response instanceof Error) {
|
||||
this.isDisabled = false;
|
||||
this.isFileShared = true;
|
||||
this.handleError(response);
|
||||
} else {
|
||||
if (this.data.node.entry.properties) {
|
||||
this.data.node.entry.properties['qshare:sharedId'] = null;
|
||||
this.data.node.entry.properties['qshare:expiryDate'] = null;
|
||||
if (response instanceof Error) {
|
||||
this.isDisabled = false;
|
||||
this.isFileShared = true;
|
||||
this.handleError(response);
|
||||
} else {
|
||||
if (this.data.node.entry.properties) {
|
||||
this.data.node.entry.properties['qshare:sharedId'] = null;
|
||||
this.data.node.entry.properties['qshare:expiryDate'] = null;
|
||||
}
|
||||
this.dialogRef.close(false);
|
||||
}
|
||||
this.dialogRef.close(false);
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
private handleError(error: Error) {
|
||||
@ -240,7 +242,8 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
|
||||
try {
|
||||
statusCode = JSON.parse(error.message).error.statusCode;
|
||||
} catch {}
|
||||
} catch {
|
||||
}
|
||||
|
||||
if (statusCode === 403) {
|
||||
message = 'SHARE.UNSHARE_PERMISSION_ERROR';
|
||||
@ -253,7 +256,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private updateForm() {
|
||||
const { entry } = this.data.node;
|
||||
const {entry} = this.data.node;
|
||||
let expiryDate = null;
|
||||
|
||||
if (entry && entry.properties) {
|
||||
@ -285,7 +288,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private updateEntryExpiryDate(date: moment.Moment) {
|
||||
const { properties } = this.data.node.entry;
|
||||
const {properties} = this.data.node.entry;
|
||||
|
||||
if (properties) {
|
||||
properties['qshare:expiryDate'] = date
|
||||
|
@ -17,9 +17,6 @@
|
||||
|
||||
import {
|
||||
CoreTestingModule,
|
||||
fakeEcmEditedUser,
|
||||
fakeEcmUser,
|
||||
fakeEcmUserNoImage,
|
||||
IdentityUserModel,
|
||||
InitialUsernamePipe,
|
||||
setupTestBed,
|
||||
@ -29,6 +26,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { By, DomSanitizer } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { fakeEcmEditedUser, fakeEcmUser, fakeEcmUserNoImage } from '../common/mocks/ecm-user.service.mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
import { ContentUserInfoComponent } from './content-user-info.component';
|
||||
@ -238,7 +236,6 @@ describe('ContentUserInfoComponent', () => {
|
||||
fixture.detectChanges();
|
||||
const pipe = new InitialUsernamePipe(new FakeSanitizer());
|
||||
const expected = pipe.transform({
|
||||
id: 13,
|
||||
firstName: 'Wilbur',
|
||||
lastName: 'Adams',
|
||||
email: 'wilbur@app.com'
|
||||
|
@ -15,10 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EcmUserModel, IdentityUserModel, PeopleContentService, UserInfoMode } from '@alfresco/adf-core';
|
||||
import { IdentityUserModel, UserInfoMode } from '@alfresco/adf-core';
|
||||
import { Component, Input, OnDestroy, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
||||
import { Subject } from 'rxjs';
|
||||
import { EcmUserModel } from '../common/models/ecm-user.model';
|
||||
import { PeopleContentService } from '../common/services/people-content.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-content-user-info',
|
||||
|
@ -28,6 +28,7 @@ import { MatDatetimepickerModule } from '@mat-datetimepicker/core';
|
||||
import { MatMomentDatetimeModule } from '@mat-datetimepicker/moment';
|
||||
import { LibraryDialogComponent } from './library/library.dialog';
|
||||
import { ContentDirectiveModule } from '../directives';
|
||||
import { DownloadZipDialogModule } from './download-zip/download-zip.dialog.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@ -38,7 +39,8 @@ import { ContentDirectiveModule } from '../directives';
|
||||
ReactiveFormsModule,
|
||||
MatMomentDatetimeModule,
|
||||
MatDatetimepickerModule,
|
||||
ContentDirectiveModule
|
||||
ContentDirectiveModule,
|
||||
DownloadZipDialogModule
|
||||
],
|
||||
declarations: [
|
||||
FolderDialogComponent,
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { PipeModule } from '../../pipes/pipe.module';
|
||||
import { PipeModule } from '@alfresco/adf-core';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
@ -18,9 +18,8 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { setupTestBed } from '../../testing/setup-test-bed';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { DownloadZipService } from '../../services/download-zip.service';
|
||||
import { CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { DownloadZipService } from './services/download-zip.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { Component, Input, OnInit, OnChanges } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { zipNode, downloadEntry } from '../../mock/download-zip-data.mock';
|
||||
import { zipNode, downloadEntry } from './mock/download-zip-data.mock';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-download-zip-dialog-storybook',
|
@ -16,22 +16,19 @@
|
||||
*/
|
||||
|
||||
import { Meta, moduleMetadata, Story } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../../testing/core.story.module';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
ContentService,
|
||||
DownloadZipService,
|
||||
NodesApiService
|
||||
} from '../../services';
|
||||
import { DownloadZipDialogStorybookComponent } from './download-zip.dialog.stories.component';
|
||||
import {
|
||||
AlfrescoApiServiceMock,
|
||||
ContentApiMock,
|
||||
DownloadZipMockService,
|
||||
NodesApiMock
|
||||
} from '../../mock/download-zip-service.mock';
|
||||
} from './mock/download-zip-service.mock';
|
||||
import { DownloadZipDialogModule } from './download-zip.dialog.module';
|
||||
import { DownloadZipService } from './services/download-zip.service';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
export default {
|
||||
component: DownloadZipDialogStorybookComponent,
|
||||
@ -39,7 +36,6 @@ export default {
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [
|
||||
CoreStoryModule,
|
||||
DownloadZipDialogModule,
|
||||
MatButtonModule
|
||||
],
|
@ -18,10 +18,10 @@
|
||||
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { DownloadEntry, MinimalNode } from '@alfresco/js-api';
|
||||
import { LogService } from '../../common/services/log.service';
|
||||
import { DownloadZipService } from '../../services/download-zip.service';
|
||||
import { ContentService } from '../../services/content.service';
|
||||
import { NodesApiService } from '../../services/nodes-api.service';
|
||||
import { LogService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { DownloadZipService } from './services/download-zip.service';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-download-zip-dialog',
|
@ -18,8 +18,7 @@
|
||||
import { DownloadEntry, DownloadBodyCreate, DownloadsApi } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { LogService } from '../common/services/log.service';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
@ -17,7 +17,9 @@
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
|
||||
import { FolderDialogComponent } from './folder.dialog';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
@ -22,7 +22,8 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { NodesApiService, TranslationService } from '@alfresco/adf-core';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
|
||||
import { forbidEndingDot, forbidOnlySpaces, forbidSpecialCharacters } from './folder-name.validators';
|
||||
|
||||
|
@ -22,4 +22,8 @@ export * from './confirm.dialog';
|
||||
export * from './dialog.module';
|
||||
export * from './library/library.dialog';
|
||||
|
||||
export * from './download-zip/download-zip.dialog';
|
||||
export * from './download-zip/download-zip.dialog.module';
|
||||
|
||||
|
||||
export * from './folder-name.validators';
|
||||
|
@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import { ChangeDetectorRef, Component, ElementRef, SimpleChange } from '@angular/core';
|
||||
import { ContentService, CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { CheckAllowableOperationDirective } from './check-allowable-operation.directive';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
import { ChangeDetectorRef, Directive, ElementRef, Host, Inject, Input, OnChanges, Optional, Renderer2, SimpleChanges } from '@angular/core';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { ContentService, EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
||||
import { EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { NodeAllowableOperationSubject } from '../interfaces/node-allowable-operation-subject.interface';
|
||||
|
||||
@Directive({
|
||||
|
@ -29,6 +29,7 @@ import { LibraryMembershipDirective } from './library-membership.directive';
|
||||
import { NodeDeleteDirective } from './node-delete.directive';
|
||||
import { NodeFavoriteDirective } from './node-favorite.directive';
|
||||
import { NodeRestoreDirective } from './node-restore.directive';
|
||||
import { NodeDownloadDirective } from './node-download.directive';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@ -46,7 +47,8 @@ import { NodeRestoreDirective } from './node-restore.directive';
|
||||
LibraryMembershipDirective,
|
||||
NodeDeleteDirective,
|
||||
NodeFavoriteDirective,
|
||||
NodeRestoreDirective
|
||||
NodeRestoreDirective,
|
||||
NodeDownloadDirective
|
||||
],
|
||||
exports: [
|
||||
NodeLockDirective,
|
||||
@ -57,7 +59,8 @@ import { NodeRestoreDirective } from './node-restore.directive';
|
||||
LibraryMembershipDirective,
|
||||
NodeDeleteDirective,
|
||||
NodeFavoriteDirective,
|
||||
NodeRestoreDirective
|
||||
NodeRestoreDirective,
|
||||
NodeDownloadDirective
|
||||
]
|
||||
})
|
||||
export class ContentDirectiveModule {
|
||||
|
@ -19,11 +19,10 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { setupTestBed, AlfrescoApiService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { NodeDownloadDirective } from './node-download.directive';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentDirectiveModule } from '@alfresco/adf-content-services';
|
||||
|
||||
@Component({
|
||||
template: '<div [adfNodeDownload]="selection" [version]="version"></div>'
|
||||
@ -54,6 +53,7 @@ describe('NodeDownloadDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
ContentDirectiveModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
],
|
@ -17,10 +17,9 @@
|
||||
|
||||
import { Directive, Input, HostListener } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { AlfrescoApiService, DownloadService } from '@alfresco/adf-core';
|
||||
import { DownloadZipDialogComponent } from '../dialogs/download-zip/download-zip.dialog';
|
||||
import { ContentApi, NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { DownloadService } from '../services/download.service';
|
||||
|
||||
/**
|
||||
* Directive selectors without adf- prefix will be deprecated on 3.0.0
|
@ -19,7 +19,8 @@
|
||||
|
||||
import { Directive, ElementRef, Renderer2, HostListener, Input, AfterViewInit } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { AllowableOperationsEnum, ContentService } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { AllowableOperationsEnum } from '../common/models/allowable-operations.enum';
|
||||
import { ContentNodeDialogService } from '../content-node-selector/content-node-dialog.service';
|
||||
|
||||
@Directive({
|
||||
|
@ -25,3 +25,4 @@ export * from './library-membership.directive';
|
||||
export * from './node-delete.directive';
|
||||
export * from './node-favorite.directive';
|
||||
export * from './node-restore.directive';
|
||||
export * from './node-download.directive';
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange, EventEmitter } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FileNode } from '../../../mock';
|
||||
import { ContentActionModel } from './../../models/content-action.model';
|
||||
import { DocumentActionsService } from './../../services/document-actions.service';
|
||||
@ -28,6 +28,7 @@ import { ContentActionListComponent } from './content-action-list.component';
|
||||
import { ContentActionComponent } from './content-action.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentService } from '../../../common/services/content.service';
|
||||
|
||||
describe('ContentAction', () => {
|
||||
let documentList: DocumentListComponent;
|
||||
|
@ -27,9 +27,10 @@ import {
|
||||
DataTableModule,
|
||||
ObjectDataTableAdapter,
|
||||
ShowHeaderMode,
|
||||
ThumbnailService,
|
||||
ContentService
|
||||
ThumbnailService
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
|
||||
import { Subject, of, throwError } from 'rxjs';
|
||||
import {
|
||||
FileNode,
|
||||
|
@ -22,9 +22,9 @@ import {
|
||||
AfterContentInit, Component, ContentChild, ElementRef, EventEmitter, HostListener, Input,
|
||||
OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
|
||||
import {
|
||||
ContentService,
|
||||
DataCellEvent,
|
||||
DataColumn,
|
||||
DataRowActionEvent,
|
||||
@ -46,9 +46,9 @@ import {
|
||||
AlfrescoApiService,
|
||||
UserPreferenceValues,
|
||||
DataRow,
|
||||
DataTableService,
|
||||
NodesApiService
|
||||
DataTableService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
import { Node, NodeEntry, NodePaging, NodesApi, Pagination } from '@alfresco/js-api';
|
||||
import { Subject, BehaviorSubject, of } from 'rxjs';
|
||||
|
@ -26,7 +26,8 @@ import {
|
||||
} from '@angular/core';
|
||||
import { NodeEntry, Site } from '@alfresco/js-api';
|
||||
import { ShareDataRow } from '../../data/share-data-row.model';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
|
@ -24,10 +24,10 @@ import {
|
||||
OnDestroy
|
||||
} from '@angular/core';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { SiteEntry, Site } from '@alfresco/js-api';
|
||||
import { ShareDataRow } from '../../data/share-data-row.model';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-library-role-column',
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, OnDestroy } from '@angular/core';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { Site, SiteEntry } from '@alfresco/js-api';
|
||||
import { ShareDataRow } from '../../data/share-data-row.model';
|
||||
|
@ -26,7 +26,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { ShareDataRow } from '../../data/share-data-row.model';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
|
@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataRow, ObjectUtils, ThumbnailService, ContentService } from '@alfresco/adf-core';
|
||||
import { DataRow, ObjectUtils, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { MinimalNode, NodeEntry } from '@alfresco/js-api';
|
||||
import { PermissionStyleModel } from './../models/permissions-style.model';
|
||||
import { ContentService } from './../../common/services/content.service';
|
||||
|
||||
export const ERR_OBJECT_NOT_FOUND: string = 'Object source not found';
|
||||
|
||||
|
@ -15,13 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, DataSorting, ContentService, ThumbnailService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { DataColumn, DataRow, DataSorting, ThumbnailService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { FileNode, FolderNode, SmartFolderNode, RuleFolderNode, LinkFolderNode } from './../../mock';
|
||||
import { ERR_OBJECT_NOT_FOUND, ShareDataRow } from './share-data-row.model';
|
||||
import { ERR_COL_NOT_FOUND, ERR_ROW_NOT_FOUND, ShareDataTableAdapter } from './share-datatable-adapter';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
|
||||
describe('ShareDataTableAdapter', () => {
|
||||
|
||||
@ -41,7 +42,7 @@ describe('ShareDataTableAdapter', () => {
|
||||
contentService = TestBed.inject(ContentService);
|
||||
thumbnailService = TestBed.inject(ThumbnailService);
|
||||
|
||||
spyOn(thumbnailService, 'getDocumentThumbnailUrl').and.returnValue(imageUrl);
|
||||
spyOn(contentService, 'getDocumentThumbnailUrl').and.returnValue(imageUrl);
|
||||
});
|
||||
|
||||
it('should use client sorting by default', () => {
|
||||
@ -267,7 +268,6 @@ describe('ShareDataTableAdapter', () => {
|
||||
|
||||
const value = adapter.getValue(row, col);
|
||||
expect(value).toBe(imageUrl);
|
||||
expect(thumbnailService.getDocumentThumbnailUrl).toHaveBeenCalledWith(file);
|
||||
});
|
||||
|
||||
it('should resolve fallback file icon for unknown node', () => {
|
||||
|
@ -20,13 +20,13 @@ import {
|
||||
DataRow,
|
||||
DataSorting,
|
||||
DataTableAdapter,
|
||||
ThumbnailService,
|
||||
ContentService
|
||||
ThumbnailService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodePaging, NodeEntry } from '@alfresco/js-api';
|
||||
import { PermissionStyleModel } from './../models/permissions-style.model';
|
||||
import { ShareDataRow } from './share-data-row.model';
|
||||
import { RowFilter } from './row-filter.model';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
|
||||
export const ERR_ROW_NOT_FOUND: string = 'Row not found';
|
||||
export const ERR_COL_NOT_FOUND: string = 'Column not found';
|
||||
@ -122,7 +122,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
|
||||
|
||||
if (node.entry.isFile) {
|
||||
if (this.thumbnails) {
|
||||
return this.thumbnailService.getDocumentThumbnailUrl(node);
|
||||
return this.getDocumentThumbnailUrl(node);
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,6 +149,33 @@ export class ShareDataTableAdapter implements DataTableAdapter {
|
||||
return dataRow.cacheValue(col.key, value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets a thumbnail URL for the given document node.
|
||||
*
|
||||
* @param node Node or Node ID to get URL for.
|
||||
* @param attachment Toggles whether to retrieve content as an attachment for download
|
||||
* @param ticket Custom ticket to use for authentication
|
||||
* @returns URL string
|
||||
*/
|
||||
private getDocumentThumbnailUrl(node: NodeEntry, attachment?: boolean, ticket?: string): string {
|
||||
let resultUrl: string;
|
||||
|
||||
if (node) {
|
||||
let nodeId: string;
|
||||
|
||||
if (typeof node === 'string') {
|
||||
nodeId = node;
|
||||
} else if (node.entry) {
|
||||
nodeId = node.entry.id;
|
||||
}
|
||||
|
||||
resultUrl = this.contentService.getDocumentThumbnailUrl(nodeId, attachment, ticket);
|
||||
}
|
||||
|
||||
return resultUrl || this.thumbnailService.getMimeTypeIcon(node.entry.content.mimeType);
|
||||
}
|
||||
|
||||
getSorting(): DataSorting {
|
||||
return this.sorting;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { AllowableOperationsEnum } from '../../common/models/allowable-operations.enum';
|
||||
|
||||
export class PermissionStyleModel {
|
||||
css: string;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user