mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-10777] Move services from Core in Content the right place (#8242)
Clean core services and directive
This commit is contained in:
@@ -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;
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentService, TranslationService } from '@alfresco/adf-core';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { Observable, Subject, throwError, of } from 'rxjs';
|
||||
|
@@ -15,12 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
AlfrescoApiService, ContentService, LogService, PaginationModel
|
||||
} from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, LogService, PaginationModel } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodeEntry, NodePaging, NodesApi } from '@alfresco/js-api';
|
||||
import { MinimalNode, NodeEntry, NodePaging, NodesApi } from '@alfresco/js-api';
|
||||
import { DocumentLoaderNode } from '../models/document-folder.model';
|
||||
import { Observable, from, throwError, forkJoin } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
@@ -40,7 +39,7 @@ export class DocumentListService implements DocumentListLoader {
|
||||
return this._nodesApi;
|
||||
}
|
||||
|
||||
constructor(private contentService: ContentService,
|
||||
constructor(private nodesApiService: NodesApiService,
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private customResourcesService: CustomResourcesService) {
|
||||
@@ -135,7 +134,7 @@ export class DocumentListService implements DocumentListLoader {
|
||||
* @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association")
|
||||
* @returns Details of the folder
|
||||
*/
|
||||
getNode(nodeId: string, includeFields: string[] = []): Observable<NodeEntry> {
|
||||
getNode(nodeId: string, includeFields: string[] = []): Observable<MinimalNode> {
|
||||
const includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', 'definition', ...includeFields]
|
||||
.filter((element, index, array) => index === array.indexOf(element));
|
||||
|
||||
@@ -144,7 +143,7 @@ export class DocumentListService implements DocumentListLoader {
|
||||
include: includeFieldsRequest
|
||||
};
|
||||
|
||||
return this.contentService.getNode(nodeId, opts);
|
||||
return this.nodesApiService.getNode(nodeId, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentService, TranslationService } from '@alfresco/adf-core';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { Observable, Subject, throwError, of } from 'rxjs';
|
||||
|
@@ -18,8 +18,10 @@
|
||||
import { Injectable, Output, EventEmitter } from '@angular/core';
|
||||
import { Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AlfrescoApiService, ContentService, NodeDownloadDirective, DownloadService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, DownloadService } from '@alfresco/adf-core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
import { NodeDownloadDirective } from '../../directives/node-download.directive';
|
||||
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { ContentNodeDialogService } from '../../content-node-selector/content-node-dialog.service';
|
||||
|
@@ -21,11 +21,12 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject, of } from 'rxjs';
|
||||
|
||||
import { ContentService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FolderCreateDirective } from './folder-create.directive';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
|
@@ -21,7 +21,7 @@ import { Directive, HostListener, Input, Output, EventEmitter } from '@angular/c
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { FolderDialogComponent } from '../dialogs/folder.dialog';
|
||||
import { ContentService } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
|
||||
const DEFAULT_FOLDER_PARENT_ID = '-my-';
|
||||
const DIALOG_WIDTH: number = 400;
|
||||
|
@@ -21,11 +21,12 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject, of } from 'rxjs';
|
||||
|
||||
import { ContentService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FolderEditDirective } from './folder-edit.directive';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
|
||||
@Component({
|
||||
template: '<div [adf-edit-folder]="folder" (success)="success($event)" title="edit-title"></div>'
|
||||
|
@@ -21,7 +21,7 @@ import { Directive, ElementRef, HostListener, Input, Output, EventEmitter } from
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { FolderDialogComponent } from '../dialogs/folder.dialog';
|
||||
import { ContentService } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
|
||||
const DIALOG_WIDTH: number = 400;
|
||||
|
||||
|
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentService } from '@alfresco/adf-core';
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, of, Subject } from 'rxjs';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { mockFile, mockNewVersionUploaderData, mockNode } from '../mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import {
|
||||
|
@@ -17,7 +17,8 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
||||
import { AlfrescoApiService, ContentService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
|
||||
import { NewVersionUploaderDialogComponent } from './new-version-uploader.dialog';
|
||||
import { VersionPaging, VersionsApi } from '@alfresco/js-api';
|
||||
|
@@ -15,7 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommentModel, EcmCompanyModel, EcmUserModel } from '@alfresco/adf-core';
|
||||
import { CommentModel } from '@alfresco/adf-core';
|
||||
import { EcmCompanyModel } from '../../common/models/ecm-company.model';
|
||||
import { EcmUserModel } from '../../common/models/ecm-user.model';
|
||||
|
||||
export const fakeUser1 = {
|
||||
enabled: true,
|
||||
|
@@ -15,11 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, LogService, CommentModel, CommentsService, PeopleContentService } from '@alfresco/adf-core';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
LogService,
|
||||
CommentModel,
|
||||
CommentsService
|
||||
} from '@alfresco/adf-core';
|
||||
import { CommentEntry, CommentsApi, Comment } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -35,7 +41,7 @@ export class NodeCommentsService implements CommentsService {
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
private peopleContentService: PeopleContentService
|
||||
private contentService: ContentService
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -101,7 +107,7 @@ export class NodeCommentsService implements CommentsService {
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
|
||||
getUserImage(user: string): string {
|
||||
return this.peopleContentService.getUserProfileImage(user);
|
||||
getUserImage(avatarId: string): string {
|
||||
return this.contentService.getContentUrl(avatarId);
|
||||
}
|
||||
}
|
||||
|
@@ -15,11 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AllowableOperationsEnum, ContentService } from '@alfresco/adf-core';
|
||||
import { Node, NodeEntry, PermissionElement } from '@alfresco/js-api';
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
import { RoleModel } from '../../models/role.model';
|
||||
import { ContentService } from '../../../common/services/content.service';
|
||||
import { AllowableOperationsEnum } from '../../../common/models/allowable-operations.enum';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-add-permission',
|
||||
|
@@ -17,10 +17,11 @@
|
||||
|
||||
import { SimpleInheritedPermissionTestComponent } from '../../mock/inherited-permission.component.mock';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
const fakeNodeWithInherit: any = { id: 'fake-id', permissions : {isInheritanceEnabled : true}, allowableOperations: ['updatePermissions']};
|
||||
const fakeNodeNoInherit: any = { id: 'fake-id', permissions : {isInheritanceEnabled : false}, allowableOperations: ['updatePermissions']};
|
||||
|
@@ -17,8 +17,10 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
import { Directive, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { NodesApiService, ContentService, AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { AllowableOperationsEnum } from '../../common/models/allowable-operations.enum';
|
||||
|
||||
@Directive({
|
||||
selector: 'button[adf-inherit-permission], mat-button-toggle[adf-inherit-permission]',
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
} from '../../../mock/permission-list.component.mock';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { MinimalNode } from '@alfresco/js-api';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
|
||||
describe('PermissionListComponent', () => {
|
||||
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NodesApiService, NotificationService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { NotificationService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AllowableOperationsEnum, ContentService, NodesApiService, NotificationService } from '@alfresco/adf-core';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { Node, PermissionElement } from '@alfresco/js-api';
|
||||
import { EventEmitter, Injectable } from '@angular/core';
|
||||
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||
@@ -26,6 +26,9 @@ import { PermissionDisplayModel } from '../../models/permission.model';
|
||||
import { NodePermissionsModel } from '../../models/member.model';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
import { NodePermissionDialogService } from '../../services/node-permission-dialog.service';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { ContentService } from '../../../common/services/content.service';
|
||||
import { AllowableOperationsEnum } from '../../../common/models/allowable-operations.enum';
|
||||
|
||||
const SITE_MANAGER_ROLE = 'SiteManager';
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { Group, NodeEntry } from '@alfresco/js-api';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
import { EcmUserModel } from '@alfresco/adf-core';
|
||||
import { EcmUserModel } from '../../../common/models/ecm-user.model';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-user-name-column',
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Group, Node, NodeEntry, PermissionElement } from '@alfresco/js-api';
|
||||
import { PermissionDisplayModel } from './permission.model';
|
||||
import { RoleModel } from './role.model';
|
||||
import { EcmUserModel } from '@alfresco/adf-core';
|
||||
import { EcmUserModel } from '../../common/models/ecm-user.model';
|
||||
|
||||
export interface NodePermissionsModel {
|
||||
node: Node;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AllowableOperationsEnum, ContentService } from '@alfresco/adf-core';
|
||||
import { Node, PermissionElement } from '@alfresco/js-api';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Injectable } from '@angular/core';
|
||||
@@ -25,6 +24,8 @@ import { NodePermissionService } from './node-permission.service';
|
||||
import { AddPermissionDialogComponent } from '../components/add-permission/add-permission-dialog.component';
|
||||
import { AddPermissionDialogData } from '../components/add-permission/add-permission-dialog-data.interface';
|
||||
import { RoleModel } from '../models/role.model';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
import { AllowableOperationsEnum } from '../../common/models/allowable-operations.enum';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { NodePermissionService } from './node-permission.service';
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { SearchService } from '../../search/services/search.service';
|
||||
import { Node, PermissionElement } from '@alfresco/js-api';
|
||||
import { of, throwError } from 'rxjs';
|
||||
@@ -26,6 +26,7 @@ import { fakeEmptyResponse, fakeNodeWithOnlyLocally, fakeSiteRoles, fakeSiteNode
|
||||
import { fakeAuthorityResults } from '../../mock/add-permission.component.mock';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
describe('NodePermissionService', () => {
|
||||
|
||||
|
@@ -17,10 +17,10 @@
|
||||
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
NodesApiService,
|
||||
TranslationService,
|
||||
EcmUserModel
|
||||
TranslationService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { EcmUserModel } from '../../common/models/ecm-user.model';
|
||||
import {
|
||||
Group,
|
||||
GroupMemberEntry,
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApiService, AppConfigService, NodesApiService, DataSorting } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AppConfigService, DataSorting } from '@alfresco/adf-core';
|
||||
import { SearchConfiguration } from '../models/search-configuration.interface';
|
||||
import { BaseQueryBuilderService } from './base-query-builder.service';
|
||||
import { SearchCategory } from '../models/search-category.interface';
|
||||
@@ -25,6 +25,7 @@ import { filter } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { SearchSortingDefinition } from '../models/search-sorting-definition.interface';
|
||||
import { FilterSearch } from '../models/filter-search.interface';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed, NodesApiService } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { TreeViewService } from './tree-view.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TreeBaseNode } from '../models/tree-view.model';
|
||||
|
@@ -17,12 +17,15 @@
|
||||
|
||||
import { Component, NgZone } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { TranslationService, UploadService, setupTestBed, FileModel, FileUploadErrorEvent } from '@alfresco/adf-core';
|
||||
import { TranslationService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { UploadBase } from './upload-base';
|
||||
import { UploadFilesEvent } from '../upload-files.event';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { mockUploadSuccessPromise } from '../../../mock/upload.service.mock';
|
||||
import { UploadService } from '../../../common/services/upload.service';
|
||||
import { FileModel } from '../../../common/models/file.model';
|
||||
import { FileUploadErrorEvent } from '../../../common/events/file.event';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-upload-button-test',
|
||||
|
@@ -15,7 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FileModel, FileInfo, UploadService, TranslationService, FileUploadErrorEvent } from '@alfresco/adf-core';
|
||||
import { FileInfo, TranslationService } from '@alfresco/adf-core';
|
||||
import { FileUploadErrorEvent } from '../../../common/events/file.event';
|
||||
import { FileModel } from '../../../common/models/file.model';
|
||||
import { UploadService } from '../../../common/services/upload.service';
|
||||
import { EventEmitter, Input, Output, OnInit, OnDestroy, NgZone, Directive } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { UploadFilesEvent } from '../upload-files.event';
|
||||
|
@@ -18,12 +18,15 @@
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import {
|
||||
FileModel, FileUploadCompleteEvent, FileUploadErrorEvent, UploadService, setupTestBed, UserPreferencesService
|
||||
setupTestBed, UserPreferencesService
|
||||
} from '@alfresco/adf-core';
|
||||
import { UploadModule } from '../upload.module';
|
||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { UploadService } from '../../common/services/upload.service';
|
||||
import { FileModel } from '../../common/models/file.model';
|
||||
import { FileUploadCompleteEvent, FileUploadErrorEvent } from '../../common/events/file.event';
|
||||
|
||||
describe('FileUploadingDialogComponent', () => {
|
||||
let fixture: ComponentFixture<FileUploadingDialogComponent>;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user