mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
Adjust ADF to latest JS-API version (#8882)
* Bump js-api version * Fix imports * Fix content-services unit tests * Fix process-services unit tests * [ci:force] Trigger CI * Fix code smells * Fix orderBy param * Fix code smells * Fix failing unit tests * Bump js-api version and align with new changes * Remove dangling coma * Fix delete return type * Add correct date format in task filters e2es * Fix typing in task filter sorting * Fix activiti content api import * Add null check for has avatar * Make User class instead of type * Fix user type in comment model * Fix sonar cloud issue * Type fixes * Update js-api version
This commit is contained in:
parent
876ca7a0a7
commit
76e2870c66
@ -31,7 +31,7 @@ Deletes multiple files and folders.
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| permanent | `boolean` | false | If true then the nodes are deleted immediately rather than being put in the trash |
|
||||
| selection | [`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`[] \| DeletedNodeEntity[]` | | Array of nodes to delete. |
|
||||
| selection | [`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`[] \| DeletedNodeEntry[]` | | Array of nodes to delete. |
|
||||
|
||||
### Events
|
||||
|
||||
@ -41,7 +41,7 @@ Deletes multiple files and folders.
|
||||
|
||||
## Details
|
||||
|
||||
Note that if a target item is already in the trashcan (and is therefore a `DeletedNodeEntity`) then
|
||||
Note that if a target item is already in the trashcan (and is therefore a `DeletedNodeEntry`) then
|
||||
this action will delete the file permanently.
|
||||
|
||||
## See also
|
||||
|
@ -38,7 +38,7 @@ Restores deleted nodes to their original location.
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
navigateLocation(path: PathInfoEntity) {
|
||||
navigateLocation(path: PathInfo) {
|
||||
const parent = path.elements[path.elements.length - 1];
|
||||
this.router.navigate(['files/', parent.id]);
|
||||
}
|
||||
|
@ -108,14 +108,14 @@ describe('Start Task - Custom App', () => {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
completedTasks[i] = await tasksApi.createNewTask(new TaskRepresentation({
|
||||
name: completedTasksName[i],
|
||||
dueDate: DateUtil.formatDate('YYYY-MM-DDTHH:mm:ss.SSSZ', new Date(), i + 2)
|
||||
dueDate: new Date(DateUtil.formatDate('YYYY-MM-DDTHH:mm:ss.SSSZ', new Date(), i + 2))
|
||||
}));
|
||||
await taskActionsApi.completeTask(completedTasks[i].id);
|
||||
}
|
||||
|
||||
taskWithDueDate = await tasksApi.createNewTask(new TaskRepresentation({
|
||||
name: paginationTasksName[0],
|
||||
dueDate: currentDateStandardFormat
|
||||
dueDate: new Date(currentDateStandardFormat)
|
||||
}));
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
@ -30,8 +30,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { Activiti, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import ContentApi = Activiti.ContentApi;
|
||||
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Attachment list action menu for tasks', () => {
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
@ -46,8 +45,7 @@ describe('Attachment list action menu for tasks', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const contentApi = new ContentApi();
|
||||
contentApi.init(apiService.getInstance());
|
||||
const contentApi = new ActivitiContentApi(apiService.getInstance());
|
||||
|
||||
const pngFile = new FileModel({
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
|
@ -91,7 +91,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Newest first',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
filter: { sort: 'created-desc', state: 'completed' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
@ -108,7 +108,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Newest last',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'completed', assignment: 'involved' }
|
||||
filter: { sort: 'created-asc', state: 'completed' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
@ -125,7 +125,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Due first',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'completed', assignment: 'involved' }
|
||||
filter: { sort: 'due-desc', state: 'completed' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
@ -142,7 +142,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Due last',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'completed', assignment: 'involved' }
|
||||
filter: { sort: 'due-asc', state: 'completed' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
@ -159,7 +159,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Newest first Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'open', assignment: 'involved' }
|
||||
filter: { sort: 'created-desc', state: 'open' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
@ -176,7 +176,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Newest last Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'open', assignment: 'involved' }
|
||||
filter: { sort: 'created-asc', state: 'open' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
@ -193,7 +193,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Due first Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'open', assignment: 'involved' }
|
||||
filter: { sort: 'due-desc', state: 'open' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
@ -210,7 +210,7 @@ describe('Task Filters Sorting', () => {
|
||||
appId,
|
||||
name: 'Due last Open',
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'open', assignment: 'involved' }
|
||||
filter: { sort: 'due-asc', state: 'open' }
|
||||
});
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
"dist": "rm -rf ../../dist/libs/cli && npm run build && cp -R ./bin ../../dist/libs/cli && cp -R ./resources ../../dist/libs/cli && cp -R ./templates ../../dist/libs/cli && cp ./package.json ../../dist/libs/cli"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alfresco/js-api": ">=6.3.0-1108",
|
||||
"@alfresco/js-api": ">=6.3.0-1271",
|
||||
"commander": "^6.2.1",
|
||||
"ejs": "^3.1.9",
|
||||
"license-checker": "^25.0.1",
|
||||
|
@ -21,7 +21,7 @@
|
||||
"@angular/platform-browser": ">=14.1.3",
|
||||
"@angular/platform-browser-dynamic": ">=14.1.3",
|
||||
"@angular/router": ">=14.1.3",
|
||||
"@alfresco/js-api": ">=6.3.0-1108",
|
||||
"@alfresco/js-api": ">=6.3.0-1271",
|
||||
"@ngx-translate/core": ">=14.0.0",
|
||||
"moment": ">=2.22.2",
|
||||
"@alfresco/adf-core": ">=6.2.0"
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { PersonEntry, Person, PersonPaging } from '@alfresco/js-api';
|
||||
|
||||
export const fakeEcmUser = {
|
||||
export const fakeEcmUser: Person = {
|
||||
id: 'fake-id',
|
||||
firstName: 'fake-ecm-first-name',
|
||||
lastName: 'fake-ecm-last-name',
|
||||
@ -32,7 +32,7 @@ export const fakeEcmUser = {
|
||||
location: 'fake location',
|
||||
mobile: '000000000',
|
||||
telephone: '11111111',
|
||||
statusUpdatedAt: 'fake-date',
|
||||
statusUpdatedAt: new Date(),
|
||||
userStatus: 'active',
|
||||
enabled: true,
|
||||
emailNotificationsEnabled: true
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentService } from './content.service';
|
||||
import { AppConfigService, AuthenticationService, StorageService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { Node, PermissionsInfo } from '@alfresco/js-api';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
declare let jasmine: any;
|
||||
@ -140,12 +140,12 @@ describe('ContentService', () => {
|
||||
});
|
||||
|
||||
it('should havePermission return true if the permissions is empty and the permission to check is Consumer', () => {
|
||||
const permissionNode = new Node({ permissions: [] });
|
||||
const permissionNode = new Node({ permissions: new PermissionsInfo() });
|
||||
expect(contentService.hasPermissions(permissionNode, 'Consumer', 'user1')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should havePermission return false if the permissions is empty and the permission to check is not Consumer', () => {
|
||||
const permissionNode = new Node({ permissions: [] });
|
||||
const permissionNode = new Node({ permissions: new PermissionsInfo() });
|
||||
expect(contentService.hasPermissions(permissionNode, '!Consumer', 'user1')).toBeFalsy();
|
||||
});
|
||||
|
||||
|
@ -321,7 +321,7 @@ describe('UploadService', () => {
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
{ newVersion: true },
|
||||
{ newVersion: true, name: 'fake-name', nodeType: undefined },
|
||||
{
|
||||
renditions: 'doclib',
|
||||
include: ['allowableOperations'],
|
||||
@ -376,7 +376,7 @@ describe('UploadService', () => {
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
{ newVersion: false },
|
||||
{ newVersion: false, name: 'file-name', nodeType: undefined },
|
||||
{
|
||||
include: [ 'allowableOperations' ],
|
||||
renditions: 'doclib',
|
||||
@ -402,7 +402,7 @@ describe('UploadService', () => {
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
{ newVersion: false },
|
||||
{ newVersion: false, name: 'file-name', nodeType: undefined },
|
||||
{
|
||||
include: [ 'allowableOperations' ],
|
||||
renditions: 'doclib',
|
||||
@ -434,6 +434,8 @@ describe('UploadService', () => {
|
||||
'123',
|
||||
{
|
||||
newVersion: false,
|
||||
name: 'fake-name',
|
||||
nodeType: undefined,
|
||||
parentId: '123',
|
||||
path: 'fake-dir',
|
||||
secondaryChildren: [ { assocType: 'assoc-1', childId: 'child-id' }],
|
||||
@ -547,7 +549,7 @@ describe('UploadService', () => {
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
{ newVersion: true },
|
||||
{ newVersion: true, name: 'fake-name', nodeType: undefined },
|
||||
{
|
||||
include: ['allowableOperations'],
|
||||
overwrite: true,
|
||||
|
@ -28,7 +28,7 @@ import { FileModel, FileUploadProgress, FileUploadStatus } from '../models/file.
|
||||
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';
|
||||
import { NodeBodyCreate, NodesApi, UploadApi, VersionsApi } from '@alfresco/js-api';
|
||||
|
||||
const MIN_CANCELLABLE_FILE_SIZE = 1000000;
|
||||
const MAX_CANCELLABLE_FILE_PERCENTAGE = 50;
|
||||
@ -237,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: NodeBodyCreate = { ...file.options, name: file.name, nodeType: file.options.nodeType };
|
||||
delete nodeBody['versioningEnabled'];
|
||||
|
||||
return this.uploadApi.uploadFile(
|
||||
|
@ -50,11 +50,11 @@ const fakeSiteList: SitePaging = new SitePaging({
|
||||
},
|
||||
entries: [
|
||||
{
|
||||
entry: {
|
||||
entry: new Site({
|
||||
id: 'FAKE',
|
||||
guid: 'FAKE-GUID',
|
||||
title: 'FAKE-SITE-TITLE'
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Node, NodeEntry, NodePaging, RequestScope, ResultSetPaging, SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { Node, NodeEntry, NodePaging, RequestScope, ResultSetPaging, SiteEntry, SitePaging, SitePagingList } from '@alfresco/js-api';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
@ -134,13 +134,13 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
list: {
|
||||
pagination: {},
|
||||
entries: [],
|
||||
source: {}
|
||||
source: new Node()
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: { entries: [] } })));
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: new SitePagingList({ entries: [] }) })));
|
||||
|
||||
customResourcesService = TestBed.inject(CustomResourcesService);
|
||||
getCorrespondingNodeIdsSpy = spyOn(customResourcesService, 'getCorrespondingNodeIds').and.callFake((id) => {
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Node, NodeEntry, NodePaging, ResultSetPaging, SiteEntry, SitePaging, UserInfo } from '@alfresco/js-api';
|
||||
import { Node, NodeEntry, NodePaging, PathElement, ResultSetPaging, Site, SiteEntry, SitePaging, SitePagingList, UserInfo } from '@alfresco/js-api';
|
||||
import { AppConfigService, DataRow, ThumbnailService, DataColumn } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { UploadService } from '../common/services/upload.service';
|
||||
@ -123,7 +123,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
|
||||
describe('Site selection', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: { entries: [] } })));
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: new SitePagingList({ entries: [] }) })));
|
||||
component.currentFolderId = 'fake-starting-folder';
|
||||
});
|
||||
|
||||
@ -138,7 +138,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
});
|
||||
|
||||
it('should trigger siteChange event when a site is selected in sites-dropdown', async () => {
|
||||
const fakeSiteEntry = new SiteEntry({ entry: { title: 'fake-new-site', guid: 'fake-new-site' } });
|
||||
const fakeSiteEntry = new SiteEntry({ entry: new Site({ title: 'fake-new-site', guid: 'fake-new-site' }) });
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
@ -162,9 +162,9 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
spyOn(sitesService, 'getSites').and.returnValue(
|
||||
of(
|
||||
new SitePaging({
|
||||
list: {
|
||||
entries: [{ entry: { guid: 'namek', id: 'namek' } }, { entry: { guid: 'blog', id: 'blog' } }]
|
||||
}
|
||||
list: new SitePagingList({
|
||||
entries: [{ entry: new Site({ guid: 'namek', id: 'namek' }) }, { entry: new Site({ guid: 'blog', id: 'blog' }) }]
|
||||
})
|
||||
})
|
||||
)
|
||||
);
|
||||
@ -262,7 +262,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
|
||||
spyOn(documentListService, 'getFolderNode').and.returnValue(of(new NodeEntry()));
|
||||
spyOn(documentListService, 'getFolder').and.returnValue(throwError('No results for test'));
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: { entries: [] } })));
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: new SitePagingList({ entries: [] }) })));
|
||||
|
||||
component.currentFolderId = 'cat-girl-nuku-nuku';
|
||||
fixture.detectChanges();
|
||||
@ -303,7 +303,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
searchQueryBuilderService.update();
|
||||
triggerSearchResults(fakeResultSetPaging);
|
||||
|
||||
const chosenNode = new Node({ path: { elements: ['one'] } });
|
||||
const chosenNode = new Node({ path: { elements: [new PathElement({ name: 'one' })] } });
|
||||
component.onCurrentSelection([{ entry: chosenNode }]);
|
||||
fixture.detectChanges();
|
||||
|
||||
@ -318,7 +318,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
searchQueryBuilderService.update();
|
||||
triggerSearchResults(fakeResultSetPaging);
|
||||
|
||||
const chosenNode = new Node({ path: { elements: ['fake-path'] }, isFile: false, isFolder: true });
|
||||
const chosenNode = new Node({ path: { elements: [new PathElement({ name: 'fake-path' })] }, isFile: false, isFolder: true });
|
||||
component.onCurrentSelection([{ entry: chosenNode }]);
|
||||
fixture.detectChanges();
|
||||
|
||||
@ -384,7 +384,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
const rows = [{}, {}] as DataRow[];
|
||||
component.documentList.data = new ShareDataTableAdapter(thumbnailService, contentService, schema);
|
||||
spyOn(component.documentList.data, 'getRows').and.returnValue(rows);
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: { entries: [] } })));
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: new SitePagingList({ entries: [] }) })));
|
||||
});
|
||||
|
||||
it('should the selection become the currently navigated folder when the folder loads (Acts as destination for cases like copy action)', () => {
|
||||
@ -655,7 +655,10 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
|
||||
it('should return only the last uploaded node to become preselected when the selection mode is single', () => {
|
||||
fixture.detectChanges();
|
||||
const fakeNodes = [new NodeEntry({ id: 'fakeNode1' }), new NodeEntry({ id: 'fakeNode2' })];
|
||||
const fakeNodes = [
|
||||
new NodeEntry({ entry: new Node({ id: 'fakeNode1' }) }),
|
||||
new NodeEntry({ entry: new Node({ id: 'fakeNode2' }) })
|
||||
];
|
||||
component.currentUploadBatch = fakeNodes;
|
||||
component.selectionMode = 'single';
|
||||
|
||||
@ -664,7 +667,10 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
|
||||
it('should return all the uploaded nodes to become preselected when the selection mode is multiple', () => {
|
||||
fixture.detectChanges();
|
||||
const fakeNodes = [new NodeEntry({ id: 'fakeNode1' }), new NodeEntry({ id: 'fakeNode2' })];
|
||||
const fakeNodes = [
|
||||
new NodeEntry({ entry: new Node({ id: 'fakeNode1' }) }),
|
||||
new NodeEntry({ entry: new Node({ id: 'fakeNode2' }) })
|
||||
];
|
||||
component.currentUploadBatch = fakeNodes;
|
||||
component.selectionMode = 'multiple';
|
||||
|
||||
|
@ -19,7 +19,7 @@ import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/materia
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, EventEmitter } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||
import { Node, NodeEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { Node, NodeEntry, SitePaging, SitePagingList } from '@alfresco/js-api';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { FileModel } from '../common/models/file.model';
|
||||
import { FileUploadEvent } from '../common/events/file.event';
|
||||
@ -88,7 +88,7 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
|
||||
spyOn(documentListService, 'getFolder');
|
||||
spyOn(documentListService, 'getFolderNode');
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: { entries: [] } })));
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(new SitePaging({ list: new SitePagingList({ entries: [] }) })));
|
||||
|
||||
fixture = TestBed.createComponent(ContentNodeSelectorComponent);
|
||||
component = fixture.componentInstance;
|
||||
@ -97,15 +97,12 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
spyOn(contentService, 'hasAllowableOperations').and.returnValue(true);
|
||||
|
||||
const fakeFolderNodeWithPermission = new NodeEntry({
|
||||
entry: {
|
||||
allowableOperations: [
|
||||
'create',
|
||||
'update'
|
||||
],
|
||||
entry: new Node({
|
||||
allowableOperations: ['create', 'update'],
|
||||
isFolder: true,
|
||||
name: 'Folder Fake Name',
|
||||
nodeType: 'cm:folder'
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
const nodesApiService = TestBed.inject(NodesApiService);
|
||||
|
@ -113,7 +113,7 @@ describe('LibraryMembershipDirective', () => {
|
||||
mockSupportedVersion = false;
|
||||
getMembershipSpy = spyOn(directive['sitesApi'], 'getSiteMembershipRequestForPerson').and.returnValue(Promise.resolve({ entry: requestedMembershipResponse }));
|
||||
addMembershipSpy = spyOn(directive['sitesApi'], 'createSiteMembershipRequestForPerson').and.returnValue(Promise.resolve({ entry: requestedMembershipResponse }));
|
||||
deleteMembershipSpy = spyOn(directive['sitesApi'], 'deleteSiteMembershipRequestForPerson').and.returnValue(Promise.resolve({}));
|
||||
deleteMembershipSpy = spyOn(directive['sitesApi'], 'deleteSiteMembershipRequestForPerson').and.returnValue(Promise.resolve());
|
||||
});
|
||||
|
||||
it('should do nothing if there is no selected library ', fakeAsync(() => {
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import {
|
||||
SiteEntry,
|
||||
SiteMembershipRequestBody,
|
||||
SiteMembershipRequestBodyCreate,
|
||||
SiteMemberEntry,
|
||||
SiteMembershipRequestEntry,
|
||||
SitesApi
|
||||
@ -208,7 +208,7 @@ export class LibraryMembershipDirective implements OnChanges {
|
||||
private joinLibraryRequest(): Observable<SiteMembershipRequestEntry> {
|
||||
const memberBody = {
|
||||
id: this.targetSite.id
|
||||
} as SiteMembershipRequestBody;
|
||||
} as SiteMembershipRequestBodyCreate;
|
||||
|
||||
if (this.versionCompatibilityService.isVersionSupported('7.0.0')) {
|
||||
memberBody.client = 'workspace';
|
||||
|
@ -18,7 +18,7 @@
|
||||
/* eslint-disable @angular-eslint/no-input-rename */
|
||||
|
||||
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
||||
import { NodeEntry, Node, DeletedNodeEntity, DeletedNode, TrashcanApi, NodesApi } from '@alfresco/js-api';
|
||||
import { NodeEntry, Node, DeletedNodeEntry, DeletedNode, TrashcanApi, NodesApi } from '@alfresco/js-api';
|
||||
import { Observable, forkJoin, from, of } from 'rxjs';
|
||||
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
|
||||
import { map, catchError, retry } from 'rxjs/operators';
|
||||
@ -51,7 +51,7 @@ interface ProcessStatus {
|
||||
export class NodeDeleteDirective implements OnChanges {
|
||||
/** Array of nodes to delete. */
|
||||
@Input('adf-delete')
|
||||
selection: NodeEntry[] | DeletedNodeEntity[];
|
||||
selection: NodeEntry[] | DeletedNodeEntry[];
|
||||
|
||||
/** If true then the nodes are deleted immediately rather than being put in the trash */
|
||||
@Input()
|
||||
@ -97,7 +97,7 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
this.elementRef.nativeElement.disabled = disable;
|
||||
}
|
||||
|
||||
private process(selection: NodeEntry[] | DeletedNodeEntity[]) {
|
||||
private process(selection: NodeEntry[] | DeletedNodeEntry[]) {
|
||||
if (selection && selection.length) {
|
||||
|
||||
const batch = this.getDeleteNodesBatch(selection);
|
||||
@ -118,7 +118,7 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
return selection.map((node) => this.deleteNode(node));
|
||||
}
|
||||
|
||||
private deleteNode(node: NodeEntry | DeletedNodeEntity): Observable<ProcessedNodeData> {
|
||||
private deleteNode(node: NodeEntry | DeletedNodeEntry): Observable<ProcessedNodeData> {
|
||||
const id = (node.entry as any).nodeId || node.entry.id;
|
||||
|
||||
let promise: Promise<any>;
|
||||
|
@ -51,7 +51,7 @@ import { DocumentListService } from './../services/document-list.service';
|
||||
import { CustomResourcesService } from './../services/custom-resources.service';
|
||||
import { DocumentListComponent } from './document-list.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { FavoritePaging, NodeEntry, NodePaging, Node } from '@alfresco/js-api';
|
||||
import { FavoritePaging, NodeEntry, NodePaging, Node, FavoritePagingList } from '@alfresco/js-api';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DocumentListModule } from '../document-list.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@ -106,15 +106,15 @@ describe('DocumentList', () => {
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
|
||||
spyFolder = spyOn(documentListService, 'getFolder').and.returnValue(of({ list: {} }));
|
||||
spyFolderNode = spyOn(documentListService, 'getFolderNode').and.returnValue(of(new NodeEntry({ entry: {} })));
|
||||
spyOn(documentList['nodesApi'], 'getNode').and.returnValue(Promise.resolve(new NodeEntry({ entry: {} })));
|
||||
spyFolderNode = spyOn(documentListService, 'getFolderNode').and.returnValue(of(new NodeEntry({ entry: new Node() })));
|
||||
spyOn(documentList['nodesApi'], 'getNode').and.returnValue(Promise.resolve(new NodeEntry({ entry: new Node() })));
|
||||
|
||||
documentList.ngOnInit();
|
||||
documentList.currentFolderId = 'no-node';
|
||||
|
||||
spyGetSites = spyOn(customResourcesService.sitesApi, 'listSites').and.returnValue(Promise.resolve(fakeGetSitesAnswer));
|
||||
spyFavorite = spyOn(customResourcesService.favoritesApi, 'listFavorites').and.returnValue(
|
||||
Promise.resolve(new FavoritePaging({ list: { entries: [] } }))
|
||||
Promise.resolve(new FavoritePaging({ list: new FavoritePagingList({ entries: [] }) }))
|
||||
);
|
||||
});
|
||||
|
||||
@ -1208,7 +1208,7 @@ describe('DocumentList', () => {
|
||||
expect(folderNode.value.id).toBe('fake-node');
|
||||
done();
|
||||
});
|
||||
documentList.onNodeDblClick(new NodeEntry({ entry: { id: 'fake-node', isFolder: true } }));
|
||||
documentList.onNodeDblClick(new NodeEntry({ entry: new Node({ id: 'fake-node', isFolder: true }) }));
|
||||
});
|
||||
|
||||
it('should set no permission when getFolderNode fails with 403', (done) => {
|
||||
|
@ -19,7 +19,7 @@ import { CustomResourcesService } from './custom-resources.service';
|
||||
import { PaginationModel } from '@alfresco/adf-core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { FavoritePaging } from '@alfresco/js-api';
|
||||
import { Favorite, FavoritePaging, FavoritePagingList } from '@alfresco/js-api';
|
||||
|
||||
describe('CustomResourcesService', () => {
|
||||
let customResourcesService: CustomResourcesService;
|
||||
@ -34,22 +34,26 @@ describe('CustomResourcesService', () => {
|
||||
|
||||
describe('loadFavorites', () => {
|
||||
it('should return a list of items with default properties when target properties does not exist', (done) => {
|
||||
spyOn(customResourcesService.favoritesApi, 'listFavorites').and.returnValue(Promise.resolve(new FavoritePaging({
|
||||
list: {
|
||||
spyOn(customResourcesService.favoritesApi, 'listFavorites').and.returnValue(
|
||||
Promise.resolve(
|
||||
new FavoritePaging({
|
||||
list: new FavoritePagingList({
|
||||
entries: [
|
||||
{
|
||||
entry: {
|
||||
entry: new Favorite({
|
||||
target: {
|
||||
file: {
|
||||
title: 'some-title',
|
||||
description: 'some-description'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
})));
|
||||
})
|
||||
})
|
||||
)
|
||||
);
|
||||
const pagination: PaginationModel = {
|
||||
maxItems: 100,
|
||||
skipCount: 0
|
||||
@ -73,11 +77,13 @@ describe('CustomResourcesService', () => {
|
||||
});
|
||||
|
||||
it('should return a list of items with merged properties when target properties exist', (done) => {
|
||||
spyOn(customResourcesService.favoritesApi, 'listFavorites').and.returnValue(Promise.resolve(new FavoritePaging({
|
||||
list: {
|
||||
spyOn(customResourcesService.favoritesApi, 'listFavorites').and.returnValue(
|
||||
Promise.resolve(
|
||||
new FavoritePaging({
|
||||
list: new FavoritePagingList({
|
||||
entries: [
|
||||
{
|
||||
entry: {
|
||||
entry: new Favorite({
|
||||
properties: {
|
||||
'cm:property': 'some-property'
|
||||
},
|
||||
@ -87,11 +93,13 @@ describe('CustomResourcesService', () => {
|
||||
description: 'some-description'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
})));
|
||||
})
|
||||
})
|
||||
)
|
||||
);
|
||||
const pagination: PaginationModel = {
|
||||
maxItems: 100,
|
||||
skipCount: 0
|
||||
|
@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PathInfoEntity } from '@alfresco/js-api';
|
||||
import { PathInfo } from '@alfresco/js-api';
|
||||
|
||||
export class RestoreMessageModel {
|
||||
message: string;
|
||||
path: PathInfoEntity;
|
||||
path: PathInfo;
|
||||
action: string;
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ import { Node, NodePaging, NodeEntry } from '@alfresco/js-api';
|
||||
export const fakeNodeWithCreatePermission = new Node({
|
||||
isFile: false,
|
||||
createdByUser: { id: 'admin', displayName: 'Administrator' },
|
||||
modifiedAt: '2017-06-08T13:53:46.495Z',
|
||||
modifiedAt: new Date('2017-06-08T13:53:46.495Z'),
|
||||
nodeType: 'cm:folder',
|
||||
parentId: '55052317-7e59-4058-8e07-769f41e615e1',
|
||||
createdAt: '2017-05-22T11:36:11.270Z',
|
||||
createdAt: new Date('2017-05-22T11:36:11.270Z'),
|
||||
path: {
|
||||
name: '/Company Home/User Homes',
|
||||
isComplete: true,
|
||||
@ -43,11 +43,11 @@ export const fakeNodeWithCreatePermission = new Node({
|
||||
export const fakeNodeWithNoPermission = new Node({
|
||||
isFile: false,
|
||||
createdByUser: { id: 'admin', displayName: 'Administrator' },
|
||||
modifiedAt: '2017-06-08T13:53:46.495Z',
|
||||
modifiedAt: new Date('2017-06-08T13:53:46.495Z'),
|
||||
nodeType: 'cm:folder',
|
||||
parentId: '55052317-7e59-4058-8e07-769f41e615e1',
|
||||
aspectNames: ['cm:ownable', 'cm:auditable'],
|
||||
createdAt: '2017-05-22T11:36:11.270Z',
|
||||
createdAt: new Date('2017-05-22T11:36:11.270Z'),
|
||||
path: {
|
||||
name: '/Company Home/User Homes',
|
||||
isComplete: true,
|
||||
@ -219,7 +219,7 @@ export const fakeNodePaging: NodePaging = {
|
||||
export const mockNode1 = new Node({
|
||||
isFile: true,
|
||||
createdByUser: { id: 'admin', displayName: 'Administrator' },
|
||||
modifiedAt: '2017-05-24T15:08:55.640Z',
|
||||
modifiedAt: new Date('2017-05-24T15:08:55.640Z'),
|
||||
nodeType: 'cm:content',
|
||||
content: {
|
||||
mimeType: 'application/rtf',
|
||||
@ -228,7 +228,7 @@ export const mockNode1 = new Node({
|
||||
encoding: 'UTF-8'
|
||||
},
|
||||
parentId: 'd124de26-6ba0-4f40-8d98-4907da2d337a',
|
||||
createdAt: '2017-05-24T15:08:55.640Z',
|
||||
createdAt: new Date('2017-05-24T15:08:55.640Z'),
|
||||
path: {
|
||||
name: '/Company Home/Guest Home',
|
||||
isComplete: true,
|
||||
@ -248,7 +248,7 @@ export const mockNode1 = new Node({
|
||||
export const mockNode2 = new Node({
|
||||
isFile: true,
|
||||
createdByUser: { id: 'admin', displayName: 'Administrator' },
|
||||
modifiedAt: '2017-05-24T15:08:55.640Z',
|
||||
modifiedAt: new Date('2017-05-24T15:08:55.640Z'),
|
||||
nodeType: 'cm:content',
|
||||
content: {
|
||||
mimeType: 'application/rtf',
|
||||
@ -257,7 +257,7 @@ export const mockNode2 = new Node({
|
||||
encoding: 'UTF-8'
|
||||
},
|
||||
parentId: 'd124de26-6ba0-4f40-8d98-4907da2d337a',
|
||||
createdAt: '2017-05-24T15:08:55.640Z',
|
||||
createdAt: new Date('2017-05-24T15:08:55.640Z'),
|
||||
path: {
|
||||
name: '/Company Home/Guest Home',
|
||||
isComplete: true,
|
||||
@ -277,7 +277,7 @@ export const mockNode2 = new Node({
|
||||
export const mockNode3 = new Node({
|
||||
isFile: true,
|
||||
createdByUser: { id: 'admin', displayName: 'Administrator' },
|
||||
modifiedAt: '2017-05-24T15:08:55.640Z',
|
||||
modifiedAt: new Date('2017-05-24T15:08:55.640Z'),
|
||||
nodeType: 'cm:content',
|
||||
content: {
|
||||
mimeType: 'application/rtf',
|
||||
@ -286,7 +286,7 @@ export const mockNode3 = new Node({
|
||||
encoding: 'UTF-8'
|
||||
},
|
||||
parentId: 'd124de26-6ba0-4f40-8d98-4907da2d337a',
|
||||
createdAt: '2017-05-24T15:08:55.640Z',
|
||||
createdAt: new Date('2017-05-24T15:08:55.640Z'),
|
||||
path: {
|
||||
name: '/Company Home/Guest Home',
|
||||
isComplete: true,
|
||||
|
@ -17,41 +17,41 @@
|
||||
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { SearchComponent } from '../search/components/search.component';
|
||||
import { SearchRequest, ResultSetPaging } from '@alfresco/js-api';
|
||||
import { SearchRequest, ResultSetPaging, ResultSetRowEntry, ContentInfo, UserInfo, ResultNode } from '@alfresco/js-api';
|
||||
|
||||
const entryItem = {
|
||||
entry: {
|
||||
const entryItem = new ResultSetRowEntry({
|
||||
entry: new ResultNode({
|
||||
id: '123',
|
||||
name: 'MyDoc',
|
||||
isFile: true,
|
||||
content: {
|
||||
content: new ContentInfo({
|
||||
mimeType: 'text/plain'
|
||||
},
|
||||
createdByUser: {
|
||||
}),
|
||||
createdByUser: new UserInfo({
|
||||
displayName: 'John Doe'
|
||||
},
|
||||
modifiedByUser: {
|
||||
}),
|
||||
modifiedByUser: new UserInfo({
|
||||
displayName: 'John Doe'
|
||||
}
|
||||
}
|
||||
};
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
const entryDifferentItem = {
|
||||
entry: {
|
||||
const entryDifferentItem = new ResultSetRowEntry({
|
||||
entry: new ResultNode({
|
||||
id: '999',
|
||||
name: 'TEST_DOC',
|
||||
isFile: true,
|
||||
content: {
|
||||
content: new ContentInfo({
|
||||
mimeType: 'text/plain'
|
||||
},
|
||||
createdByUser: {
|
||||
}),
|
||||
createdByUser: new UserInfo({
|
||||
displayName: 'John TEST'
|
||||
},
|
||||
modifiedByUser: {
|
||||
}),
|
||||
modifiedByUser: new UserInfo({
|
||||
displayName: 'John TEST'
|
||||
}
|
||||
}
|
||||
};
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
export const result = new ResultSetPaging({
|
||||
list: {
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { SitePaging } from '@alfresco/js-api';
|
||||
import { SitePaging, SitePagingList } from '@alfresco/js-api';
|
||||
|
||||
/* We are using functions instead of constants here to pass a new instance of the object each time */
|
||||
export const getFakeSitePaging = (): SitePaging => ({
|
||||
@ -162,9 +162,11 @@ export const getFakeSitePagingLastPage = (): SitePaging => ({
|
||||
}
|
||||
});
|
||||
|
||||
export const getFakeSitePagingWithMembers = () => new SitePaging({
|
||||
list: {
|
||||
entries: [{
|
||||
export const getFakeSitePagingWithMembers = () =>
|
||||
new SitePaging({
|
||||
list: new SitePagingList({
|
||||
entries: [
|
||||
{
|
||||
entry: {
|
||||
visibility: 'MODERATED',
|
||||
guid: 'b4cff62a-664d-4d45-9302-98723eac1319',
|
||||
@ -204,7 +206,7 @@ export const getFakeSitePagingWithMembers = () => new SitePaging({
|
||||
lastName: 'Beecher',
|
||||
userStatus: 'Helping to design the look and feel of the new web site',
|
||||
jobTitle: 'Graphic Designer',
|
||||
statusUpdatedAt: '2011-02-15T20:20:13.432+0000',
|
||||
statusUpdatedAt: new Date('2011-02-15T20:20:13.432+0000'),
|
||||
mobile: '0112211001100',
|
||||
emailNotificationsEnabled: true,
|
||||
description: 'Alice is a demo user for the sample Alfresco Team site.',
|
||||
@ -231,7 +233,8 @@ export const getFakeSitePagingWithMembers = () => new SitePaging({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
entry: {
|
||||
visibility: 'PUBLIC',
|
||||
guid: 'b4cff62a-664d-4d45-9302-98723eac1319',
|
||||
@ -240,7 +243,8 @@ export const getFakeSitePagingWithMembers = () => new SitePaging({
|
||||
preset: 'site-dashboard',
|
||||
title: 'FAKE-SITE-PUBLIC'
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
entry: {
|
||||
visibility: 'PRIVATE',
|
||||
guid: 'b4cff62a-664d-4d45-9302-98723eac1319',
|
||||
@ -279,5 +283,5 @@ export const getFakeSitePagingWithMembers = () => new SitePaging({
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -15,31 +15,27 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommentModel } from '@alfresco/adf-core';
|
||||
import { CommentModel, User } from '@alfresco/adf-core';
|
||||
import { EcmCompanyModel } from '../../common/models/ecm-company.model';
|
||||
import { EcmUserModel } from '../../common/models/ecm-user.model';
|
||||
|
||||
export const fakeUser1 = {
|
||||
export const fakeUser1 = new User({
|
||||
enabled: true,
|
||||
firstName: 'firstName',
|
||||
lastName: 'lastName',
|
||||
email: 'fake-email@dom.com',
|
||||
emailNotificationsEnabled: true,
|
||||
company: {},
|
||||
id: 'fake-email@dom.com',
|
||||
avatarId: '123-123-123'
|
||||
};
|
||||
});
|
||||
|
||||
export const fakeUser2 = {
|
||||
export const fakeUser2 = new User({
|
||||
enabled: true,
|
||||
firstName: 'some',
|
||||
lastName: 'one',
|
||||
email: 'some-one@somegroup.com',
|
||||
emailNotificationsEnabled: true,
|
||||
company: {},
|
||||
id: 'fake-email@dom.com',
|
||||
avatarId: '001-001-001'
|
||||
};
|
||||
});
|
||||
|
||||
export const fakeContentComments = {
|
||||
list: {
|
||||
@ -153,28 +149,28 @@ export const commentsNodeData: CommentModel[] = [
|
||||
id: 1,
|
||||
message: `I've done this component, is it cool?`,
|
||||
created: getDateXMinutesAgo(30),
|
||||
createdBy: johnDoe,
|
||||
createdBy: new User(johnDoe),
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 2,
|
||||
message: 'Yeah',
|
||||
created: getDateXMinutesAgo(15),
|
||||
createdBy: janeEod,
|
||||
createdBy: new User(janeEod),
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 3,
|
||||
message: '+1',
|
||||
created: getDateXMinutesAgo(12),
|
||||
createdBy: robertSmith,
|
||||
createdBy: new User(robertSmith),
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 4,
|
||||
message: 'ty',
|
||||
created: new Date(),
|
||||
createdBy: johnDoe,
|
||||
createdBy: new User(johnDoe),
|
||||
isSelected: false
|
||||
})
|
||||
];
|
||||
@ -184,28 +180,28 @@ export const commentsTaskData: CommentModel[] = [
|
||||
id: 1,
|
||||
message: `I've done this task, what's next?`,
|
||||
created: getDateXMinutesAgo(30),
|
||||
createdBy: johnDoe,
|
||||
createdBy: new User(johnDoe),
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 2,
|
||||
message: `I've assigned you another one 🤠`,
|
||||
created: getDateXMinutesAgo(15),
|
||||
createdBy: janeEod,
|
||||
createdBy: new User(janeEod),
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 3,
|
||||
message: '+1',
|
||||
created: getDateXMinutesAgo(12),
|
||||
createdBy: robertSmith,
|
||||
createdBy: new User(robertSmith),
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 4,
|
||||
message: 'Cheers',
|
||||
created: new Date(),
|
||||
createdBy: johnDoe,
|
||||
createdBy: new User(johnDoe),
|
||||
isSelected: false
|
||||
})
|
||||
];
|
||||
|
@ -19,7 +19,8 @@ import {
|
||||
AlfrescoApiService,
|
||||
LogService,
|
||||
CommentModel,
|
||||
CommentsService
|
||||
CommentsService,
|
||||
User
|
||||
} from '@alfresco/adf-core';
|
||||
import { CommentEntry, CommentsApi, Comment } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
@ -98,7 +99,7 @@ export class NodeCommentsService implements CommentsService {
|
||||
id: comment.id,
|
||||
message: comment.content,
|
||||
created: comment.createdAt,
|
||||
createdBy: comment.createdBy
|
||||
createdBy: new User(comment.createdBy)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { SearchConfigurationService } from '../../../search/services/search-configuration.service';
|
||||
import { SearchService } from '../../../search/services/search.service';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { Component, EventEmitter, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
@ -30,13 +30,9 @@ import { MatSelectionList } from '@angular/material/list';
|
||||
templateUrl: './add-permission-panel.component.html',
|
||||
styleUrls: ['./add-permission-panel.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
providers: [
|
||||
{ provide: SearchConfigurationService, useClass: SearchPermissionConfigurationService },
|
||||
SearchService
|
||||
]
|
||||
providers: [{ provide: SearchConfigurationService, useClass: SearchPermissionConfigurationService }, SearchService]
|
||||
})
|
||||
export class AddPermissionPanelComponent {
|
||||
|
||||
@ViewChild('search', { static: true })
|
||||
search: SearchComponent;
|
||||
|
||||
@ -54,15 +50,13 @@ export class AddPermissionPanelComponent {
|
||||
selectedItems: NodeEntry[] = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
EVERYONE: NodeEntry = new NodeEntry({ entry: { nodeType: 'cm:authorityContainer', properties: {'cm:authorityName': 'GROUP_EVERYONE'}}});
|
||||
EVERYONE: NodeEntry = new NodeEntry({
|
||||
entry: new Node({ nodeType: 'cm:authorityContainer', properties: { 'cm:authorityName': 'GROUP_EVERYONE' } })
|
||||
});
|
||||
|
||||
constructor() {
|
||||
this.searchInput.valueChanges
|
||||
.pipe(
|
||||
debounceTime(this.debounceSearch)
|
||||
)
|
||||
.subscribe((searchValue) => {
|
||||
const selectionOptions = this.matSelectionList.selectedOptions.selected.map(option => option.value);
|
||||
this.searchInput.valueChanges.pipe(debounceTime(this.debounceSearch)).subscribe((searchValue) => {
|
||||
const selectionOptions = this.matSelectionList.selectedOptions.selected.map((option) => option.value);
|
||||
this.selectedItems.push(...selectionOptions);
|
||||
this.matSelectionList.deselectAll();
|
||||
this.searchedWord = searchValue;
|
||||
@ -73,10 +67,9 @@ export class AddPermissionPanelComponent {
|
||||
}
|
||||
|
||||
onSelectionChange() {
|
||||
const currentSelection = this.matSelectionList.selectedOptions.selected.map(option => option.value);
|
||||
const uniqueSelection = [ ...currentSelection, ...this.selectedItems ]
|
||||
.reduce((uniquesElements, currentElement) => {
|
||||
const isExist = uniquesElements.find(uniqueElement => uniqueElement.entry.id === currentElement.entry.id);
|
||||
const currentSelection = this.matSelectionList.selectedOptions.selected.map((option) => option.value);
|
||||
const uniqueSelection = [...currentSelection, ...this.selectedItems].reduce((uniquesElements, currentElement) => {
|
||||
const isExist = uniquesElements.find((uniqueElement) => uniqueElement.entry.id === currentElement.entry.id);
|
||||
if (!isExist) {
|
||||
uniquesElements.push(currentElement);
|
||||
}
|
||||
@ -90,5 +83,4 @@ export class AddPermissionPanelComponent {
|
||||
this.selectedItems.splice(0, this.selectedItems.length);
|
||||
this.search.resetResults();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { User } from '@alfresco/adf-core';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { Group, NodeEntry } from '@alfresco/js-api';
|
||||
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
@ -48,7 +48,7 @@ export class UserIconColumnComponent implements OnInit {
|
||||
@Input()
|
||||
selected: boolean = false;
|
||||
|
||||
displayText$ = new BehaviorSubject<User>(null);
|
||||
displayText$ = new BehaviorSubject<User | Group>(null);
|
||||
group = false;
|
||||
|
||||
get isSelected(): boolean {
|
||||
@ -61,13 +61,15 @@ export class UserIconColumnComponent implements OnInit {
|
||||
if (this.context) {
|
||||
const { person, group, authorityId } = this.context.row.obj?.entry ?? this.context.row.obj;
|
||||
this.group = this.isGroup(group, authorityId);
|
||||
this.displayText$.next(person || group || { displayName: authorityId });
|
||||
const user = person ? new User(person) : undefined;
|
||||
this.displayText$.next(user || group || { displayName: authorityId });
|
||||
}
|
||||
|
||||
if (this.node) {
|
||||
const { person, group } = this.nodePermissionService.transformNodeToUserPerson(this.node.entry);
|
||||
this.group = this.isGroup(group, null);
|
||||
this.displayText$.next(person || group);
|
||||
const user = person ? new User(person) : undefined;
|
||||
this.displayText$.next(user || group);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentInfo, Node, NodePagingList, UserInfo } from '@alfresco/js-api';
|
||||
|
||||
export const fakeSearch = {
|
||||
list: {
|
||||
list: new NodePagingList({
|
||||
pagination: {
|
||||
count: 1,
|
||||
hasMoreItems: false,
|
||||
@ -26,22 +28,20 @@ export const fakeSearch = {
|
||||
},
|
||||
entries: [
|
||||
{
|
||||
entry: {
|
||||
entry: new Node({
|
||||
id: '123',
|
||||
name: 'MyDoc',
|
||||
content: {
|
||||
mimetype: 'text/plain'
|
||||
},
|
||||
createdByUser: {
|
||||
content: new ContentInfo({ mimeType: 'text/plain' }),
|
||||
createdByUser: new UserInfo({
|
||||
displayName: 'John Doe'
|
||||
},
|
||||
modifiedByUser: {
|
||||
}),
|
||||
modifiedByUser: new UserInfo({
|
||||
displayName: 'John Doe'
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
export const mockError = {
|
||||
@ -55,7 +55,5 @@ export const mockError = {
|
||||
};
|
||||
|
||||
export const searchMockApi: any = {
|
||||
|
||||
findNodes: () => Promise.resolve(fakeSearch)
|
||||
|
||||
};
|
||||
|
@ -124,13 +124,13 @@ export interface SearchOptions {
|
||||
include?: string[];
|
||||
|
||||
/**
|
||||
* String to control the order of the entities returned in a list. You can use this
|
||||
* String array to control the order of the entities returned in a list. You can use this
|
||||
* parameter to sort the list by one or more fields. Each field has a default sort order,
|
||||
* which is normally ascending order (but see the JS-API docs to check if any fields used
|
||||
* in a method have a descending default search order). To sort the entities in a specific
|
||||
* order, you can use the "ASC" and "DESC" keywords for any field.
|
||||
*/
|
||||
orderBy?: string;
|
||||
orderBy?: string[];
|
||||
|
||||
/**
|
||||
* List of field names. You can use this parameter to restrict the fields returned within
|
||||
|
@ -19,20 +19,9 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { SecurityControlsService } from './security-controls-groups-marks-security.service';
|
||||
import { fakeAuthorityClearanceApiResponse } from './mock/security-authorities.mock';
|
||||
import {
|
||||
fakeGroupsApiResponse,
|
||||
createNewSecurityGroupMock
|
||||
} from './mock/security-groups.mock';
|
||||
import {
|
||||
fakeMarksApiResponse,
|
||||
createNewSecurityMarkMock
|
||||
} from './mock/security-marks.mock';
|
||||
import {
|
||||
SecurityGroupBody,
|
||||
SecurityGroupEntry,
|
||||
SecurityMarkBody,
|
||||
SecurityMarkEntry
|
||||
} from '@alfresco/js-api';
|
||||
import { fakeGroupsApiResponse, createNewSecurityGroupMock } from './mock/security-groups.mock';
|
||||
import { fakeMarksApiResponse, createNewSecurityMarkMock } from './mock/security-marks.mock';
|
||||
import { SecurityGroup, SecurityGroupBody, SecurityGroupEntry, SecurityMarkBody, SecurityMarkEntry } from '@alfresco/js-api';
|
||||
|
||||
describe('SecurityControlsService', () => {
|
||||
let service: SecurityControlsService;
|
||||
@ -55,10 +44,7 @@ describe('SecurityControlsService', () => {
|
||||
});
|
||||
|
||||
it('should be able to get the list of Security groups', async () => {
|
||||
const getGroupSpy = spyOn(
|
||||
service.groupsApi,
|
||||
'getSecurityGroups'
|
||||
).and.returnValue(Promise.resolve(fakeGroupsApiResponse));
|
||||
const getGroupSpy = spyOn(service.groupsApi, 'getSecurityGroups').and.returnValue(Promise.resolve(fakeGroupsApiResponse));
|
||||
const groupPromise = service.getSecurityGroup(0, 5, 'inUse');
|
||||
const group = await groupPromise;
|
||||
expect(getGroupSpy).toHaveBeenCalledWith({
|
||||
@ -73,21 +59,15 @@ describe('SecurityControlsService', () => {
|
||||
expect(group.entries[0].groupName).toBe('Classification');
|
||||
expect(group.entries[0].groupType).toBe('HIERARCHICAL');
|
||||
|
||||
expect(group.entries[1].id).toBe(
|
||||
'd2b11d9f-2707-439f-a7c6-e7872f395553'
|
||||
);
|
||||
expect(group.entries[1].id).toBe('d2b11d9f-2707-439f-a7c6-e7872f395553');
|
||||
expect(group.entries[1].groupName).toBe('SG1');
|
||||
expect(group.entries[1].groupType).toBe('USER_REQUIRES_ALL');
|
||||
|
||||
expect(group.entries[2].id).toBe(
|
||||
'1b77a32d-6b8b-4a37-b195-7f2ff2fe4ed3'
|
||||
);
|
||||
expect(group.entries[2].id).toBe('1b77a32d-6b8b-4a37-b195-7f2ff2fe4ed3');
|
||||
expect(group.entries[2].groupName).toBe('SG2');
|
||||
expect(group.entries[2].groupType).toBe('USER_REQUIRES_ALL');
|
||||
|
||||
expect(group.entries[3].id).toBe(
|
||||
'709791f8-22dc-428a-82dd-daf3e1aa8a60'
|
||||
);
|
||||
expect(group.entries[3].id).toBe('709791f8-22dc-428a-82dd-daf3e1aa8a60');
|
||||
expect(group.entries[3].groupName).toBe('SG3');
|
||||
expect(group.entries[3].groupType).toBe('USER_REQUIRES_ALL');
|
||||
});
|
||||
@ -96,48 +76,34 @@ describe('SecurityControlsService', () => {
|
||||
spyOn(service.groupsApi, 'createSecurityGroup').and.returnValue(
|
||||
Promise.resolve(
|
||||
new SecurityGroupEntry({
|
||||
entry: {
|
||||
entry: new SecurityGroup({
|
||||
groupName: 'TestGroup',
|
||||
groupType: 'HIERARCHICAL',
|
||||
id: 'eddf6269-ceba-42c6-b979-9ac445d29a94'
|
||||
}
|
||||
})
|
||||
})
|
||||
)
|
||||
);
|
||||
const response = await service
|
||||
.createSecurityGroup(createNewSecurityGroupMock)
|
||||
.toPromise();
|
||||
const response = await service.createSecurityGroup(createNewSecurityGroupMock).toPromise();
|
||||
|
||||
securityGroupId = response.entry.id;
|
||||
expect(response.entry.groupName).toEqual('TestGroup');
|
||||
expect(response.entry.groupType).toEqual('HIERARCHICAL');
|
||||
expect(response.entry.id).toEqual(
|
||||
'eddf6269-ceba-42c6-b979-9ac445d29a94'
|
||||
);
|
||||
expect(response.entry.id).toEqual('eddf6269-ceba-42c6-b979-9ac445d29a94');
|
||||
});
|
||||
|
||||
it('should be able to get the list of Security Marks', async () => {
|
||||
const getMarkSpy = spyOn(
|
||||
service.marksApi,
|
||||
'getSecurityMarks'
|
||||
).and.returnValue(Promise.resolve(fakeMarksApiResponse));
|
||||
const markPromise = service.getSecurityMark(
|
||||
securityGroupId,
|
||||
0,
|
||||
'inUse'
|
||||
);
|
||||
const getMarkSpy = spyOn(service.marksApi, 'getSecurityMarks').and.returnValue(Promise.resolve(fakeMarksApiResponse));
|
||||
const markPromise = service.getSecurityMark(securityGroupId, 0);
|
||||
const mark = await markPromise;
|
||||
|
||||
expect(getMarkSpy).toHaveBeenCalledWith(securityGroupId, {
|
||||
skipCount: 0,
|
||||
include: 'inUse'
|
||||
skipCount: 0
|
||||
});
|
||||
|
||||
expect(mark.pagination.skipCount).toBe(0);
|
||||
expect(mark.pagination.maxItems).toBe(10);
|
||||
expect(mark.entries[0].groupId).toBe(
|
||||
'eddf6269-ceba-42c6-b979-9ac445d29a94'
|
||||
);
|
||||
expect(mark.entries[0].groupId).toBe('eddf6269-ceba-42c6-b979-9ac445d29a94');
|
||||
expect(mark.entries[0].name).toBe('securityMark1');
|
||||
expect(mark.entries[0].id).toBe('ffBOeOJJ');
|
||||
});
|
||||
@ -176,12 +142,7 @@ describe('SecurityControlsService', () => {
|
||||
})
|
||||
)
|
||||
);
|
||||
const response = await service
|
||||
.updateSecurityMark(
|
||||
securityGroupId,
|
||||
securityMarkId,
|
||||
securityMarkBody
|
||||
);
|
||||
const response = await service.updateSecurityMark(securityGroupId, securityMarkId, securityMarkBody);
|
||||
|
||||
securityGroupId = response.entry.groupId;
|
||||
securityMarkId = response.entry.id;
|
||||
@ -194,11 +155,11 @@ describe('SecurityControlsService', () => {
|
||||
spyOn(service.groupsApi, 'updateSecurityGroup').and.returnValue(
|
||||
Promise.resolve(
|
||||
new SecurityGroupEntry({
|
||||
entry: {
|
||||
entry: new SecurityGroup({
|
||||
groupName: 'TestGroup',
|
||||
groupType: 'HIERARCHICAL',
|
||||
id: 'eddf6269-ceba-42c6-b979-9ac445d29a94'
|
||||
}
|
||||
})
|
||||
})
|
||||
)
|
||||
);
|
||||
@ -230,31 +191,15 @@ describe('SecurityControlsService', () => {
|
||||
});
|
||||
|
||||
it('should delete a security group', async () => {
|
||||
spyOn(service.groupsApi, 'deleteSecurityGroup').and.returnValue(
|
||||
Promise.resolve(
|
||||
new SecurityGroupEntry({
|
||||
entry: {
|
||||
groupName: 'TestGroup',
|
||||
groupType: 'HIERARCHICAL',
|
||||
id: 'eddf6269-ceba-42c6-b979-9ac445d29a94'
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
const response = await service
|
||||
.deleteSecurityGroup(securityGroupId)
|
||||
.toPromise();
|
||||
|
||||
expect(response.entry.groupName).toEqual('TestGroup');
|
||||
expect(response.entry.groupType).toEqual('HIERARCHICAL');
|
||||
expect(response.entry.id).toEqual('eddf6269-ceba-42c6-b979-9ac445d29a94');
|
||||
spyOn(service.groupsApi, 'deleteSecurityGroup').and.returnValue(Promise.resolve());
|
||||
await service.deleteSecurityGroup(securityGroupId).toPromise();
|
||||
expect(service.groupsApi.deleteSecurityGroup).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should be able to get clearances for authority', async () => {
|
||||
const getClearancesForAuthoritySpy = spyOn(
|
||||
service.authorityClearanceApi,
|
||||
'getAuthorityClearanceForAuthority'
|
||||
).and.returnValue(Promise.resolve(fakeAuthorityClearanceApiResponse));
|
||||
const getClearancesForAuthoritySpy = spyOn(service.authorityClearanceApi, 'getAuthorityClearanceForAuthority').and.returnValue(
|
||||
Promise.resolve(fakeAuthorityClearanceApiResponse)
|
||||
);
|
||||
const clearancePromise = service.getClearancesForAuthority('test-id', 0, 10);
|
||||
const clearance = await clearancePromise.toPromise();
|
||||
|
||||
@ -283,11 +228,15 @@ describe('SecurityControlsService', () => {
|
||||
})
|
||||
)
|
||||
);
|
||||
const response = await service.updateClearancesForAuthority('test-id', [{
|
||||
const response = await service
|
||||
.updateClearancesForAuthority('test-id', [
|
||||
{
|
||||
groupId: 'test-group-id',
|
||||
op: 'test-op',
|
||||
id: 'test-id'
|
||||
}]).toPromise();
|
||||
}
|
||||
])
|
||||
.toPromise();
|
||||
|
||||
if (response instanceof SecurityMarkEntry) {
|
||||
expect(response.entry.id).toEqual('test-id');
|
||||
@ -296,8 +245,8 @@ describe('SecurityControlsService', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('should reload security groups', doneCallback => {
|
||||
service.reloadSecurityControls$.subscribe(res => {
|
||||
it('should reload security groups', (doneCallback) => {
|
||||
service.reloadSecurityControls$.subscribe((res) => {
|
||||
expect(res).toBeUndefined();
|
||||
doneCallback();
|
||||
});
|
||||
|
@ -30,7 +30,8 @@ import {
|
||||
SecurityGroupPaging,
|
||||
AuthorityClearanceApi,
|
||||
AuthorityClearanceGroupPaging,
|
||||
NodeSecurityMarkBody
|
||||
NodeSecurityMarkBody,
|
||||
GsGroupInclude
|
||||
} from '@alfresco/js-api';
|
||||
import { AlfrescoApiService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { finalize } from 'rxjs/operators';
|
||||
@ -125,8 +126,8 @@ export class SecurityControlsService {
|
||||
const payload: SecurityGroupBody = {
|
||||
...input
|
||||
};
|
||||
const opts = {
|
||||
DEFAULT_INCLUDE
|
||||
const opts: GsGroupInclude = {
|
||||
include: DEFAULT_INCLUDE
|
||||
};
|
||||
const promise = this.groupsApi.createSecurityGroup(payload, opts);
|
||||
|
||||
@ -169,19 +170,16 @@ export class SecurityControlsService {
|
||||
*
|
||||
* @param securityGroupId The key for the security group id.
|
||||
* @param skipCount The number of entities that exist in the collection before those included in this list.
|
||||
* @param include The key for the security mark is in use or not
|
||||
* @return Promise<SecurityControlsMarkResponse>
|
||||
*/
|
||||
getSecurityMark(
|
||||
securityGroupId: string,
|
||||
skipCount = DEFAULT_SKIP_COUNT,
|
||||
include = DEFAULT_INCLUDE
|
||||
skipCount = DEFAULT_SKIP_COUNT
|
||||
): Promise<SecurityControlsMarkResponse> {
|
||||
let securityControlsMarkResponse: SecurityControlsMarkResponse;
|
||||
return new Promise((resolve, reject) => {
|
||||
this.marksApi
|
||||
.getSecurityMarks(securityGroupId, {
|
||||
include,
|
||||
skipCount
|
||||
})
|
||||
.then((response: SecurityMarkPaging) => {
|
||||
@ -276,11 +274,11 @@ export class SecurityControlsService {
|
||||
* Delete security group
|
||||
*
|
||||
* @param securityGroupId The key for the security group id.
|
||||
* @return Observable<SecurityGroupEntry>
|
||||
* @return Observable<void>
|
||||
*/
|
||||
deleteSecurityGroup(
|
||||
securityGroupId: string
|
||||
): Observable<SecurityGroupEntry> {
|
||||
): Observable<void> {
|
||||
this.loadingSource.next(true);
|
||||
const promise = this.groupsApi.deleteSecurityGroup(securityGroupId);
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { LogService, InfiniteSelectScrollDirective, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { SitePaging, SiteEntry } from '@alfresco/js-api';
|
||||
import { SitePaging, SiteEntry, Site } from '@alfresco/js-api';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import {LiveAnnouncer} from '@angular/cdk/a11y';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
@ -128,11 +128,7 @@ export class DropdownSitesComponent implements OnInit {
|
||||
|
||||
if (!this.hideMyFiles) {
|
||||
const siteEntry = new SiteEntry({
|
||||
entry: {
|
||||
id: this.MY_FILES_VALUE,
|
||||
guid: this.MY_FILES_VALUE,
|
||||
title: 'DROPDOWN.MY_FILES_OPTION'
|
||||
}
|
||||
entry: new Site({ id: this.MY_FILES_VALUE, guid: this.MY_FILES_VALUE, title: 'DROPDOWN.MY_FILES_OPTION' })
|
||||
});
|
||||
|
||||
this.siteList.list.entries.unshift(siteEntry);
|
||||
@ -180,7 +176,7 @@ export class DropdownSitesComponent implements OnInit {
|
||||
return sites;
|
||||
}
|
||||
|
||||
private isCurrentUserMember(site, loggedUserName): boolean {
|
||||
private isCurrentUserMember(site: SiteEntry, loggedUserName: string): boolean {
|
||||
return site.entry.visibility === 'PUBLIC' ||
|
||||
!!site.relations.members.list.entries.find((member) => member.entry.id.toLowerCase() === loggedUserName.toLowerCase());
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import { throwError } from 'rxjs';
|
||||
import { Pagination, Tag, TagBody, TagEntry, TagPaging, TagPagingList } from '@alfresco/js-api';
|
||||
|
||||
describe('TagService', () => {
|
||||
|
||||
let service: TagService;
|
||||
let logService: LogService;
|
||||
let userPreferencesService: UserPreferencesService;
|
||||
@ -43,37 +42,32 @@ describe('TagService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule]
|
||||
});
|
||||
service = TestBed.inject(TagService);
|
||||
logService = TestBed.inject(LogService);
|
||||
userPreferencesService = TestBed.inject(UserPreferencesService);
|
||||
|
||||
spyOn(service.tagsApi, 'deleteTagFromNode').and.returnValue(
|
||||
Promise.resolve({})
|
||||
);
|
||||
spyOn(service.tagsApi, 'createTagForNode').and.returnValue(
|
||||
Promise.resolve(new TagEntry({}))
|
||||
);
|
||||
spyOn(service.tagsApi, 'deleteTagFromNode').and.returnValue(Promise.resolve());
|
||||
spyOn(service.tagsApi, 'createTagForNode').and.returnValue(Promise.resolve(new TagEntry({})));
|
||||
});
|
||||
|
||||
describe('Content tests', () => {
|
||||
|
||||
it('should catch errors on getTagsByNodeId call', async () => {
|
||||
spyOn(service, 'getTagsByNodeId').and.returnValue(throwError({ error: 'error' }));
|
||||
await service.getTagsByNodeId('fake-node-id').subscribe(() => {
|
||||
await service.getTagsByNodeId('fake-node-id').subscribe(
|
||||
() => {
|
||||
throwError('This call should fail');
|
||||
}, (error) => {
|
||||
},
|
||||
(error) => {
|
||||
expect(error.error).toBe('error');
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('should trigger a refresh event on removeTag() call', async () => {
|
||||
await service.refresh.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
await service.refresh.subscribe(() => {
|
||||
expect(service.tagsApi.deleteTagFromNode).toHaveBeenCalledWith('fake-node-id', 'fake-tag');
|
||||
});
|
||||
|
||||
service.removeTag('fake-node-id', 'fake-tag');
|
||||
@ -108,12 +102,14 @@ describe('TagService', () => {
|
||||
});
|
||||
|
||||
it('should emit refresh when tags creation is success', fakeAsync(() => {
|
||||
const tags: TagEntry[] = [{
|
||||
const tags: TagEntry[] = [
|
||||
{
|
||||
entry: {
|
||||
id: 'Some id 1',
|
||||
tag: 'Some tag 1'
|
||||
}
|
||||
}];
|
||||
}
|
||||
];
|
||||
spyOn(service.refresh, 'emit');
|
||||
spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.resolve(tags));
|
||||
service.createTags([]);
|
||||
@ -142,9 +138,12 @@ describe('TagService', () => {
|
||||
spyOn(service.tagsApi, 'listTags').and.returnValue(Promise.resolve(result));
|
||||
const skipCount = 10;
|
||||
|
||||
service.getAllTheTags({
|
||||
service.getAllTheTags(
|
||||
{
|
||||
skipCount
|
||||
}, true);
|
||||
},
|
||||
true
|
||||
);
|
||||
expect(service.tagsApi.listTags).toHaveBeenCalledWith({
|
||||
include: ['count'],
|
||||
skipCount
|
||||
@ -155,9 +154,12 @@ describe('TagService', () => {
|
||||
spyOn(service.tagsApi, 'listTags').and.returnValue(Promise.resolve(result));
|
||||
const skipCount = 10;
|
||||
|
||||
service.getAllTheTags({
|
||||
service.getAllTheTags(
|
||||
{
|
||||
skipCount
|
||||
}, false);
|
||||
},
|
||||
false
|
||||
);
|
||||
expect(service.tagsApi.listTags).toHaveBeenCalledWith({
|
||||
include: undefined,
|
||||
skipCount
|
||||
@ -361,7 +363,9 @@ describe('TagService', () => {
|
||||
});
|
||||
|
||||
it('should call assignTagsToNode on TagsApi with correct parameters', () => {
|
||||
spyOn(service.tagsApi, 'assignTagsToNode').and.returnValue(Promise.resolve(singleResult));
|
||||
spyOn(service.tagsApi, 'assignTagsToNode').and.returnValue(
|
||||
Promise.resolve(new TagPaging({ list: new TagPagingList({ entries: [singleResult] }) }))
|
||||
);
|
||||
|
||||
service.assignTagsToNode(nodeId, tags);
|
||||
expect(service.tagsApi.assignTagsToNode).toHaveBeenCalledWith(nodeId, tags);
|
||||
@ -381,10 +385,12 @@ describe('TagService', () => {
|
||||
}));
|
||||
|
||||
it('should return observable which emits single tag', fakeAsync(() => {
|
||||
spyOn(service.tagsApi, 'assignTagsToNode').and.returnValue(Promise.resolve(singleResult));
|
||||
spyOn(service.tagsApi, 'assignTagsToNode').and.returnValue(
|
||||
Promise.resolve(new TagPaging({ list: new TagPagingList({ entries: [singleResult] }) }))
|
||||
);
|
||||
|
||||
service.assignTagsToNode(nodeId, tags).subscribe((tagsResult) => {
|
||||
expect(tagsResult).toEqual(singleResult);
|
||||
expect(tagsResult).toEqual(new TagPaging({ list: new TagPagingList({ entries: [singleResult] }) }));
|
||||
});
|
||||
tick();
|
||||
}));
|
||||
|
@ -99,8 +99,8 @@ export class TagService {
|
||||
removeTag(nodeId: string, tag: string): Observable<void> {
|
||||
const observableRemove = from(this.tagsApi.deleteTagFromNode(nodeId, tag));
|
||||
|
||||
observableRemove.subscribe((data) => {
|
||||
this.refresh.emit(data);
|
||||
observableRemove.subscribe(() => {
|
||||
this.refresh.emit();
|
||||
}, (err) => {
|
||||
this.handleError(err);
|
||||
});
|
||||
|
@ -22,28 +22,39 @@ import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { TreeBaseNode } from '../models/tree-view.model';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodePaging } from '@alfresco/js-api';
|
||||
import { Node, NodePaging } from '@alfresco/js-api';
|
||||
|
||||
describe('TreeViewService', () => {
|
||||
|
||||
let service: TreeViewService;
|
||||
let nodeService: NodesApiService;
|
||||
|
||||
const fakeNodeList = new NodePaging({ list: { entries: [
|
||||
{ entry: { id: 'fake-node-id', name: 'fake-node-name', isFolder: true } }
|
||||
] } });
|
||||
const fakeNodeList = new NodePaging({
|
||||
list: {
|
||||
entries: [
|
||||
{
|
||||
entry: new Node({
|
||||
id: 'fake-node-id',
|
||||
name: 'fake-node-name',
|
||||
isFolder: true,
|
||||
isFile: false,
|
||||
nodeType: 'cm:folder',
|
||||
createdByUser: null,
|
||||
modifiedByUser: null,
|
||||
createdAt: new Date(),
|
||||
modifiedAt: new Date()
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const fakeMixedNodeList = new NodePaging({ list: { entries: [
|
||||
{ entry: { id: 'fake-node-id', name: 'fake-node-name', isFolder: true } },
|
||||
{ entry: { id: 'fake-file-id', name: 'fake-file-name', isFolder: false } }
|
||||
] } });
|
||||
const fakeMixedNodeList = new NodePaging({
|
||||
list: { entries: [fakeNodeList.list.entries[0], { entry: new Node({ id: 'fake-file-id', name: 'fake-file-name', isFolder: false }) }] }
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule]
|
||||
});
|
||||
service = TestBed.inject(TreeViewService);
|
||||
nodeService = TestBed.inject(NodesApiService);
|
||||
|
@ -19,7 +19,7 @@ import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { UploadButtonComponent } from './upload-button.component';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { mockUploadErrorPromise } from '../../mock/upload.service.mock';
|
||||
@ -28,7 +28,6 @@ import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { FileUploadErrorEvent } from '../../common/events/file.event';
|
||||
|
||||
describe('UploadButtonComponent', () => {
|
||||
|
||||
const file = { name: 'fake-name-1', size: 10, webkitRelativePath: 'fake-folder1/fake-name-1.json' };
|
||||
const fakeEvent = {
|
||||
currentTarget: {
|
||||
@ -38,15 +37,7 @@ describe('UploadButtonComponent', () => {
|
||||
};
|
||||
|
||||
const fakeFolderNodeWithPermission = new NodeEntry({
|
||||
entry: {
|
||||
allowableOperations: [
|
||||
'create',
|
||||
'update'
|
||||
],
|
||||
isFolder: true,
|
||||
name: 'Folder Fake Name',
|
||||
nodeType: 'cm:folder'
|
||||
}
|
||||
entry: new Node({ name: 'Folder Fake Name', nodeType: 'cm:folder', isFolder: true, allowableOperations: ['create', 'update'] })
|
||||
});
|
||||
|
||||
let component: UploadButtonComponent;
|
||||
@ -56,10 +47,7 @@ describe('UploadButtonComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule]
|
||||
});
|
||||
fixture = TestBed.createComponent(UploadButtonComponent);
|
||||
uploadService = TestBed.inject(UploadService);
|
||||
@ -214,11 +202,7 @@ describe('UploadButtonComponent', () => {
|
||||
});
|
||||
|
||||
describe('fileSize', () => {
|
||||
|
||||
const files: File[] = [
|
||||
{ name: 'bigFile.png', size: 1000 } as File,
|
||||
{ name: 'smallFile.png', size: 10 } as File
|
||||
];
|
||||
const files: File[] = [{ name: 'bigFile.png', size: 1000 } as File, { name: 'smallFile.png', size: 10 } as File];
|
||||
|
||||
let addToQueueSpy;
|
||||
|
||||
@ -245,9 +229,7 @@ describe('UploadButtonComponent', () => {
|
||||
});
|
||||
|
||||
it('should allow file of 0 size when the max file size is set to 0', () => {
|
||||
const zeroFiles: File[] = [
|
||||
{ name: 'zeroFile.png', size: 0 } as File
|
||||
];
|
||||
const zeroFiles: File[] = [{ name: 'zeroFile.png', size: 0 } as File];
|
||||
component.maxFilesSize = 0;
|
||||
|
||||
component.uploadFiles(zeroFiles);
|
||||
@ -284,12 +266,7 @@ describe('UploadButtonComponent', () => {
|
||||
});
|
||||
|
||||
describe('uploadFiles', () => {
|
||||
|
||||
const files: File[] = [
|
||||
{ name: 'phobos.jpg' } as File,
|
||||
{ name: 'deimos.png' } as File,
|
||||
{ name: 'ganymede.bmp' } as File
|
||||
];
|
||||
const files: File[] = [{ name: 'phobos.jpg' } as File, { name: 'deimos.png' } as File, { name: 'ganymede.bmp' } as File];
|
||||
|
||||
let addToQueueSpy;
|
||||
|
||||
@ -344,8 +321,7 @@ describe('UploadButtonComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue').and.stub();
|
||||
fakeNodeWithNoPermission = {
|
||||
};
|
||||
fakeNodeWithNoPermission = {};
|
||||
});
|
||||
|
||||
it('should not call uploadFiles for node without permission', () => {
|
||||
|
@ -21,7 +21,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { VersionListComponent } from './version-list.component';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { of } from 'rxjs';
|
||||
import { Node, VersionPaging, VersionEntry, NodeEntry } from '@alfresco/js-api';
|
||||
import { Node, VersionPaging, NodeEntry, VersionEntry, Version } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentVersionService } from './content-version.service';
|
||||
@ -36,8 +36,8 @@ describe('VersionListComponent', () => {
|
||||
const versionId = '1.0';
|
||||
|
||||
const versionTest = [
|
||||
{ entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' } } as VersionEntry,
|
||||
{ entry: { name: 'test-file-name-two', id: '1.0', versionComment: 'test-version-comment' } } as VersionEntry
|
||||
new VersionEntry({ entry: new Version({ name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' }) }),
|
||||
new VersionEntry({ entry: new Version({ name: 'test-file-name-two', id: '1.0', versionComment: 'test-version-comment' }) })
|
||||
];
|
||||
|
||||
afterEach(() => {
|
||||
@ -47,10 +47,7 @@ describe('VersionListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionListComponent);
|
||||
@ -61,7 +58,7 @@ describe('VersionListComponent', () => {
|
||||
component.node = { id: nodeId, allowableOperations: ['update'] } as Node;
|
||||
|
||||
spyOn(component, 'downloadContent').and.stub();
|
||||
spyOn(component.nodesApi, 'getNode').and.returnValue(Promise.resolve(new NodeEntry({ entry: { id: 'nodeInfoId' } })));
|
||||
spyOn(component.nodesApi, 'getNode').and.returnValue(Promise.resolve(new NodeEntry({ entry: new Node({ id: 'nodeInfoId' }) })));
|
||||
});
|
||||
|
||||
it('should raise confirmation dialog on delete', () => {
|
||||
@ -84,7 +81,7 @@ describe('VersionListComponent', () => {
|
||||
afterClosed: () => of(true)
|
||||
} as any);
|
||||
|
||||
spyOn(component.versionsApi, 'deleteVersion').and.returnValue(Promise.resolve(true));
|
||||
spyOn(component.versionsApi, 'deleteVersion').and.returnValue(Promise.resolve());
|
||||
|
||||
component.deleteVersion(versionId);
|
||||
|
||||
@ -99,7 +96,7 @@ describe('VersionListComponent', () => {
|
||||
afterClosed: () => of(false)
|
||||
} as any);
|
||||
|
||||
spyOn(component.versionsApi, 'deleteVersion').and.returnValue(Promise.resolve(true));
|
||||
spyOn(component.versionsApi, 'deleteVersion').and.returnValue(Promise.resolve());
|
||||
|
||||
component.deleteVersion(versionId);
|
||||
|
||||
@ -118,10 +115,8 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
describe('Version history fetching', () => {
|
||||
|
||||
it('should use loading bar', () => {
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
|
||||
let loadingProgressBar = fixture.debugElement.query(By.css('[data-automation-id="version-history-loading-bar"]'));
|
||||
expect(loadingProgressBar).toBeNull();
|
||||
@ -134,8 +129,7 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should load the versions for a given id', () => {
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
@ -145,15 +139,15 @@ describe('VersionListComponent', () => {
|
||||
|
||||
it('should show the versions after loading', (done) => {
|
||||
fixture.detectChanges();
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() => Promise.resolve(new VersionPaging({
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() =>
|
||||
Promise.resolve(
|
||||
new VersionPaging({
|
||||
list: {
|
||||
entries: [
|
||||
{
|
||||
entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' }
|
||||
entries: [versionTest[0]]
|
||||
}
|
||||
]
|
||||
}
|
||||
})));
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
component.ngOnChanges();
|
||||
|
||||
@ -171,18 +165,15 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should NOT show the versions comments if input property is set not to show them', (done) => {
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve(
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() =>
|
||||
Promise.resolve(
|
||||
new VersionPaging({
|
||||
list: {
|
||||
entries: [
|
||||
{
|
||||
entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' }
|
||||
}
|
||||
]
|
||||
entries: [versionTest[0]]
|
||||
}
|
||||
})
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
component.showComments = false;
|
||||
fixture.detectChanges();
|
||||
@ -199,14 +190,9 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should be able to download a version', () => {
|
||||
const versionEntry = {
|
||||
entry: {
|
||||
name: 'test-file-name',
|
||||
id: '1.0',
|
||||
versionComment: 'test-version-comment'
|
||||
}
|
||||
};
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.returnValue(Promise.resolve(new VersionPaging({ list: { entries: [versionEntry] } })));
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.returnValue(
|
||||
Promise.resolve(new VersionPaging({ list: { entries: [versionTest[0]] } }))
|
||||
);
|
||||
spyOn(contentVersionService.contentApi, 'getContentUrl').and.returnValue('the/download/url');
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -223,15 +209,9 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should NOT be able to download a version if configured so', () => {
|
||||
const versionEntry = {
|
||||
entry: {
|
||||
name: 'test-file-name',
|
||||
id: '1.0',
|
||||
versionComment: 'test-version-comment'
|
||||
}
|
||||
};
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve(new VersionPaging({ list: { entries: [versionEntry] } })));
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() =>
|
||||
Promise.resolve(new VersionPaging({ list: { entries: [versionTest[0]] } }))
|
||||
);
|
||||
const spyOnDownload = spyOn(component.contentApi, 'getContentUrl').and.stub();
|
||||
|
||||
component.allowDownload = false;
|
||||
@ -243,7 +223,6 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
describe('Version restoring', () => {
|
||||
|
||||
it('should restore version only when restore allowed', () => {
|
||||
component.node.allowableOperations = [];
|
||||
spyOn(component.versionsApi, 'revertVersion').and.stub();
|
||||
@ -255,9 +234,7 @@ describe('VersionListComponent', () => {
|
||||
fixture.detectChanges();
|
||||
component.versions = versionTest;
|
||||
|
||||
const spyOnRevertVersion = spyOn(component.versionsApi, 'revertVersion').and
|
||||
.callFake(() => Promise.resolve(new VersionEntry(
|
||||
{ entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' } })));
|
||||
const spyOnRevertVersion = spyOn(component.versionsApi, 'revertVersion').and.callFake(() => Promise.resolve(versionTest[0]));
|
||||
|
||||
component.restore(versionId);
|
||||
|
||||
@ -267,12 +244,9 @@ describe('VersionListComponent', () => {
|
||||
it('should get node info after restoring the node', fakeAsync(() => {
|
||||
fixture.detectChanges();
|
||||
component.versions = versionTest;
|
||||
spyOn(component.versionsApi, 'listVersionHistory')
|
||||
.and.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
|
||||
spyOn(component.versionsApi, 'revertVersion')
|
||||
.and.callFake(() => Promise.resolve(new VersionEntry(
|
||||
{ entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' } })));
|
||||
spyOn(component.versionsApi, 'revertVersion').and.callFake(() => Promise.resolve(versionTest[0]));
|
||||
|
||||
component.restore(versionId);
|
||||
fixture.detectChanges();
|
||||
@ -284,12 +258,9 @@ describe('VersionListComponent', () => {
|
||||
it('should emit with node info data', fakeAsync(() => {
|
||||
fixture.detectChanges();
|
||||
component.versions = versionTest;
|
||||
spyOn(component.versionsApi, 'listVersionHistory')
|
||||
.and.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
|
||||
spyOn(component.versionsApi, 'revertVersion')
|
||||
.and.callFake(() => Promise.resolve(new VersionEntry(
|
||||
{ entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' } })));
|
||||
spyOn(component.versionsApi, 'revertVersion').and.callFake(() => Promise.resolve(versionTest[0]));
|
||||
|
||||
spyOn(component.restored, 'emit');
|
||||
|
||||
@ -304,8 +275,9 @@ describe('VersionListComponent', () => {
|
||||
fixture.detectChanges();
|
||||
component.versions = versionTest;
|
||||
|
||||
const spyOnListVersionHistory = spyOn(component.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
const spyOnListVersionHistory = spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() =>
|
||||
Promise.resolve({ list: { entries: versionTest } })
|
||||
);
|
||||
spyOn(component.versionsApi, 'revertVersion').and.callFake(() => Promise.resolve(null));
|
||||
|
||||
component.restore(versionId);
|
||||
@ -329,18 +301,16 @@ describe('VersionListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
fixture.detectChanges();
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() => Promise.resolve(new VersionPaging({
|
||||
versionTest[1].entry.id = '1.1';
|
||||
spyOn(component.versionsApi, 'listVersionHistory').and.callFake(() =>
|
||||
Promise.resolve(
|
||||
new VersionPaging({
|
||||
list: {
|
||||
entries: [
|
||||
{
|
||||
entry: { name: 'test-file-two', id: '1.1', versionComment: 'test-version-comment' }
|
||||
},
|
||||
{
|
||||
entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' }
|
||||
entries: versionTest
|
||||
}
|
||||
]
|
||||
}
|
||||
})));
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
describe('showActions', () => {
|
||||
@ -373,7 +343,6 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
describe('disabled', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
component.node = { id: nodeId } as Node;
|
||||
component.ngOnChanges();
|
||||
@ -406,7 +375,6 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
describe('enabled', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
component.node = { id: nodeId, allowableOperations: ['update', 'delete'] } as Node;
|
||||
component.ngOnChanges();
|
||||
@ -425,7 +393,7 @@ describe('VersionListComponent', () => {
|
||||
|
||||
it('should enable restore action if is allowed', (done) => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(getRestoreButton().disabled).toBeFalse();
|
||||
expect(getRestoreButton('1.1').disabled).toBeFalse();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Node, VersionPaging } from '@alfresco/js-api';
|
||||
import { Node, Version, VersionEntry, VersionPaging } from '@alfresco/js-api';
|
||||
import { VersionManagerComponent } from './version-manager.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@ -36,20 +36,11 @@ describe('VersionManagerComponent', () => {
|
||||
name: 'TEST-NODE',
|
||||
isFile: true
|
||||
});
|
||||
const versionEntry = {
|
||||
entry: {
|
||||
id: '1.0',
|
||||
name: node.name,
|
||||
versionComment: expectedComment
|
||||
}
|
||||
};
|
||||
const versionEntry = new VersionEntry({ entry: new Version({ id: '1.0', name: node.name, versionComment: expectedComment }) });
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionManagerComponent);
|
||||
@ -57,8 +48,9 @@ describe('VersionManagerComponent', () => {
|
||||
component.node = node;
|
||||
|
||||
nodesApiService = TestBed.inject(NodesApiService);
|
||||
spyOnListVersionHistory = spyOn(component.versionListComponent['versionsApi'], 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve(new VersionPaging({ list: { entries: [ versionEntry ] }})));
|
||||
spyOnListVersionHistory = spyOn(component.versionListComponent['versionsApi'], 'listVersionHistory').and.callFake(() =>
|
||||
Promise.resolve(new VersionPaging({ list: { entries: [versionEntry] } }))
|
||||
);
|
||||
});
|
||||
|
||||
it('should load the versions for a given node', () => {
|
||||
@ -110,7 +102,6 @@ describe('VersionManagerComponent', () => {
|
||||
});
|
||||
|
||||
describe('Animation', () => {
|
||||
|
||||
it('should upload button be hide by default', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
|
@ -24,7 +24,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { ContentInfo, Node, NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { AlfrescoViewerComponent, NodeActionsService, RenditionService } from '@alfresco/adf-content-services';
|
||||
import { CoreTestingModule, EventMock, ViewUtilService, ViewerComponent } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
@ -45,8 +45,7 @@ import { By } from '@angular/platform-browser';
|
||||
</adf-alfresco-viewer>
|
||||
`
|
||||
})
|
||||
class ViewerWithCustomToolbarComponent {
|
||||
}
|
||||
class ViewerWithCustomToolbarComponent {}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer-container-toolbar-actions',
|
||||
@ -60,8 +59,7 @@ class ViewerWithCustomToolbarComponent {
|
||||
</adf-alfresco-viewer>
|
||||
`
|
||||
})
|
||||
class ViewerWithCustomToolbarActionsComponent {
|
||||
}
|
||||
class ViewerWithCustomToolbarActionsComponent {}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer-container-sidebar',
|
||||
@ -73,15 +71,13 @@ class ViewerWithCustomToolbarActionsComponent {
|
||||
</adf-alfresco-viewer>
|
||||
`
|
||||
})
|
||||
class ViewerWithCustomSidebarComponent {
|
||||
}
|
||||
class ViewerWithCustomSidebarComponent {}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-dialog-dummy',
|
||||
template: ``
|
||||
})
|
||||
class DummyDialogComponent {
|
||||
}
|
||||
class DummyDialogComponent {}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer-container-open-with',
|
||||
@ -104,8 +100,7 @@ class DummyDialogComponent {
|
||||
</adf-alfresco-viewer>
|
||||
`
|
||||
})
|
||||
class ViewerWithCustomOpenWithComponent {
|
||||
}
|
||||
class ViewerWithCustomOpenWithComponent {}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer-container-more-actions',
|
||||
@ -128,12 +123,9 @@ class ViewerWithCustomOpenWithComponent {
|
||||
</adf-alfresco-viewer>
|
||||
`
|
||||
})
|
||||
class ViewerWithCustomMoreActionsComponent {
|
||||
}
|
||||
|
||||
class ViewerWithCustomMoreActionsComponent {}
|
||||
|
||||
describe('AlfrescoViewerComponent', () => {
|
||||
|
||||
let component: AlfrescoViewerComponent;
|
||||
let fixture: ComponentFixture<AlfrescoViewerComponent>;
|
||||
let element: HTMLElement;
|
||||
@ -148,13 +140,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
MatButtonModule,
|
||||
MatIconModule
|
||||
],
|
||||
imports: [NoopAnimationsModule, TranslateModule.forRoot(), CoreTestingModule, MatButtonModule, MatIconModule],
|
||||
declarations: [
|
||||
ViewerWithCustomToolbarComponent,
|
||||
ViewerWithCustomSidebarComponent,
|
||||
@ -164,7 +150,8 @@ describe('AlfrescoViewerComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: RenditionService, useValue: {
|
||||
provide: RenditionService,
|
||||
useValue: {
|
||||
getNodeRendition: () => throwError('thrown'),
|
||||
generateMediaTracksRendition: () => {}
|
||||
}
|
||||
@ -191,10 +178,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
|
||||
describe('Extension Type Test', () => {
|
||||
|
||||
|
||||
it('should use external viewer to display node by id', fakeAsync(() => {
|
||||
const extension: ViewerExtensionRef = {
|
||||
component: 'custom.component',
|
||||
@ -210,7 +194,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
element = fixture.nativeElement;
|
||||
component = fixture.componentInstance;
|
||||
|
||||
spyOn(component.nodesApi, 'getNode').and.callFake(() => Promise.resolve(new NodeEntry({entry: {}})));
|
||||
spyOn(component.nodesApi, 'getNode').and.callFake(() => Promise.resolve(new NodeEntry({ entry: new Node() })));
|
||||
|
||||
component.nodeId = '37f7f34d-4e64-4db6-bb3f-5c89f7844251';
|
||||
component.ngOnChanges();
|
||||
@ -223,20 +207,17 @@ describe('AlfrescoViewerComponent', () => {
|
||||
expect(renditionService.generateMediaTracksRendition).not.toHaveBeenCalled();
|
||||
expect(element.querySelector('[data-automation-id="custom.component"]')).not.toBeNull();
|
||||
}));
|
||||
|
||||
|
||||
});
|
||||
|
||||
describe('MimeType handling', () => {
|
||||
|
||||
it('should node without content show unkonwn', (done) => {
|
||||
const displayName = 'the-name';
|
||||
const contentUrl = '/content/url/path';
|
||||
|
||||
component.nodeId = '12';
|
||||
spyOn(component['nodesApi'], 'getNode').and.returnValue(Promise.resolve(new NodeEntry({
|
||||
entry: {content: {name: displayName, id: '12'}}
|
||||
})));
|
||||
spyOn(component['nodesApi'], 'getNode').and.returnValue(
|
||||
Promise.resolve(new NodeEntry({ entry: new Node({ name: displayName, id: '12', content: new ContentInfo() }) }))
|
||||
);
|
||||
|
||||
spyOn(component['contentApi'], 'getContentUrl').and.returnValue(contentUrl);
|
||||
|
||||
@ -251,8 +232,8 @@ describe('AlfrescoViewerComponent', () => {
|
||||
|
||||
it('should change display name every time node changes', fakeAsync(() => {
|
||||
spyOn(component['nodesApi'], 'getNode').and.returnValues(
|
||||
Promise.resolve(new NodeEntry({entry: {name: 'file1', content: {}}})),
|
||||
Promise.resolve(new NodeEntry({entry: {name: 'file2', content: {}}}))
|
||||
Promise.resolve(new NodeEntry({ entry: new Node({ name: 'file1', content: new ContentInfo() }) })),
|
||||
Promise.resolve(new NodeEntry({ entry: new Node({ name: 'file2', content: new ContentInfo() }) }))
|
||||
);
|
||||
|
||||
component.showViewer = true;
|
||||
@ -272,13 +253,15 @@ describe('AlfrescoViewerComponent', () => {
|
||||
|
||||
it('should append version of the file to the file content URL', fakeAsync(() => {
|
||||
spyOn(component['nodesApi'], 'getNode').and.returnValue(
|
||||
Promise.resolve(new NodeEntry({
|
||||
entry: {
|
||||
Promise.resolve(
|
||||
new NodeEntry({
|
||||
entry: new Node({
|
||||
name: 'file1.pdf',
|
||||
content: {},
|
||||
content: new ContentInfo(),
|
||||
properties: { 'cm:versionLabel': '10' }
|
||||
}
|
||||
}))
|
||||
})
|
||||
})
|
||||
)
|
||||
);
|
||||
spyOn(component['versionsApi'], 'getVersion').and.returnValue(Promise.resolve(undefined));
|
||||
|
||||
@ -293,14 +276,14 @@ describe('AlfrescoViewerComponent', () => {
|
||||
expect(component.urlFileContent).toContain('/public/alfresco/versions/1/nodes/id1/content?attachment=false&10');
|
||||
}));
|
||||
|
||||
it('should change display name every time node\`s version changes', fakeAsync(() => {
|
||||
it('should change display name every time node`s version changes', fakeAsync(() => {
|
||||
spyOn(component['nodesApi'], 'getNode').and.returnValue(
|
||||
Promise.resolve(new NodeEntry({entry: {name: 'node1', content: {}}}))
|
||||
Promise.resolve(new NodeEntry({ entry: new Node({ name: 'node1', content: new ContentInfo() }) }))
|
||||
);
|
||||
|
||||
spyOn(component['versionsApi'], 'getVersion').and.returnValues(
|
||||
Promise.resolve(new VersionEntry({entry: {name: 'file1', content: {}}})),
|
||||
Promise.resolve(new VersionEntry({entry: {name: 'file2', content: {}}}))
|
||||
Promise.resolve(new VersionEntry({ entry: new Node({ name: 'file1', content: new ContentInfo() }) })),
|
||||
Promise.resolve(new VersionEntry({ entry: new Node({ name: 'file2', content: new ContentInfo() }) }))
|
||||
);
|
||||
|
||||
component.nodeId = 'id1';
|
||||
@ -321,7 +304,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
|
||||
it('should update node only if node name changed', fakeAsync(() => {
|
||||
spyOn(component['nodesApi'], 'getNode').and.returnValues(
|
||||
Promise.resolve(new NodeEntry({entry: {name: 'file1', content: {}}}))
|
||||
Promise.resolve(new NodeEntry({ entry: new Node({ name: 'file1', content: new ContentInfo() }) }))
|
||||
);
|
||||
|
||||
component.showViewer = true;
|
||||
@ -357,7 +340,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('Viewer Example Component Rendering', () => {
|
||||
|
||||
it('should use custom toolbar', (done) => {
|
||||
const customFixture = TestBed.createComponent(ViewerWithCustomToolbarComponent);
|
||||
const customElement: HTMLElement = customFixture.nativeElement;
|
||||
@ -414,7 +396,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
expect(customElement.querySelector('.adf-viewer-container-more-actions')).toBeDefined();
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('should stop propagation on sidebar keydown event [keydown]', fakeAsync(() => {
|
||||
@ -447,10 +428,8 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('error handling', () => {
|
||||
|
||||
it('should show unknown view when node file not found', (done) => {
|
||||
spyOn(component['nodesApi'], 'getNode')
|
||||
.and.returnValue(Promise.reject({}));
|
||||
spyOn(component['nodesApi'], 'getNode').and.returnValue(Promise.reject(new Error('error')));
|
||||
|
||||
component.nodeId = 'the-node-id-of-the-file-to-preview';
|
||||
component.mimeType = null;
|
||||
@ -464,8 +443,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
it('should show unknown view when sharedLink file not found', (done) => {
|
||||
spyOn(component['sharedLinksApi'], 'getSharedLink')
|
||||
.and.returnValue(Promise.reject({}));
|
||||
spyOn(component['sharedLinksApi'], 'getSharedLink').and.returnValue(Promise.reject(new Error('error')));
|
||||
|
||||
component.sharedLinkId = 'the-Shared-Link-id';
|
||||
component.mimeType = null;
|
||||
@ -477,12 +455,10 @@ describe('AlfrescoViewerComponent', () => {
|
||||
expect(element.querySelector('adf-viewer-unknown-format')).not.toBeNull();
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('should raise an event when the shared link is invalid', fakeAsync(() => {
|
||||
spyOn(component['sharedLinksApi'], 'getSharedLink')
|
||||
.and.returnValue(Promise.reject({}));
|
||||
spyOn(component['sharedLinksApi'], 'getSharedLink').and.returnValue(Promise.reject(new Error('error')));
|
||||
|
||||
component.sharedLinkId = 'the-Shared-Link-id';
|
||||
component.mimeType = null;
|
||||
@ -498,7 +474,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('Toolbar', () => {
|
||||
|
||||
it('should show only next file button', async () => {
|
||||
component.allowNavigate = true;
|
||||
component.canNavigateBefore = false;
|
||||
@ -658,7 +633,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
component.nodeId = '12';
|
||||
const displayName = 'the-name';
|
||||
const nodeDetails = {
|
||||
entry: {name: displayName, id: '12', content: {mimeType: 'txt'}}
|
||||
entry: new Node({ name: displayName, id: '12', content: new ContentInfo({ mimeType: 'txt' }) })
|
||||
};
|
||||
|
||||
const contentUrl = '/content/url/path';
|
||||
@ -687,8 +662,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
it('should not render close viewer button if it is a shared link', (done) => {
|
||||
spyOn(component['sharedLinksApi'], 'getSharedLink')
|
||||
.and.returnValue(Promise.reject({}));
|
||||
spyOn(component['sharedLinksApi'], 'getSharedLink').and.returnValue(Promise.reject(new Error('error')));
|
||||
|
||||
component.sharedLinkId = 'the-Shared-Link-id';
|
||||
component.mimeType = null;
|
||||
@ -700,11 +674,9 @@ describe('AlfrescoViewerComponent', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Base component', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
component.mimeType = 'application/pdf';
|
||||
component.nodeId = 'id1';
|
||||
@ -713,7 +685,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('SideBar Test', () => {
|
||||
|
||||
it('should NOT display sidebar if is not allowed', (done) => {
|
||||
component.showRightSidebar = true;
|
||||
component.allowRightSidebar = false;
|
||||
@ -748,7 +719,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
expect(sidebar).toBeNull();
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('should display sidebar on the left side', (done) => {
|
||||
@ -765,9 +735,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('View', () => {
|
||||
|
||||
describe('Overlay mode true', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
component.overlayMode = true;
|
||||
component.fileName = 'fake-test-file.pdf';
|
||||
@ -843,7 +811,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('Overlay mode false', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
component.overlayMode = false;
|
||||
fixture.detectChanges();
|
||||
@ -863,7 +830,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('Attribute', () => {
|
||||
|
||||
it('should FileNodeId present not thrown any error ', () => {
|
||||
component.showViewer = true;
|
||||
component.nodeId = 'file-node-id';
|
||||
@ -873,7 +839,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
|
||||
it('should showViewer default value be true', () => {
|
||||
expect(component.showViewer).toBe(true);
|
||||
});
|
||||
@ -887,22 +852,18 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('Events', () => {
|
||||
|
||||
it('should update version when emitted by image-viewer and user has update permissions', () => {
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue').and.callFake(() => {
|
||||
});
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue').and.callFake(() => {});
|
||||
spyOn(uploadService, 'addToQueue');
|
||||
component.readOnly = false;
|
||||
component.nodeEntry = new NodeEntry({
|
||||
entry: {
|
||||
name: 'fakeImage.png',
|
||||
id: '12',
|
||||
content: {mimeType: 'img/png'}
|
||||
}
|
||||
entry: new Node({ name: 'fakeImage.png', id: '12', content: new ContentInfo({ mimeType: 'img/png' }) })
|
||||
});
|
||||
const data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==');
|
||||
const fakeBlob = new Blob([data], { type: 'image/png' });
|
||||
const newImageFile: File = new File([fakeBlob], component?.nodeEntry?.entry?.name, {type: component?.nodeEntry?.entry?.content?.mimeType});
|
||||
const newImageFile: File = new File([fakeBlob], component?.nodeEntry?.entry?.name, {
|
||||
type: component?.nodeEntry?.entry?.content?.mimeType
|
||||
});
|
||||
const newFile = new FileModel(
|
||||
newImageFile,
|
||||
{
|
||||
@ -921,15 +882,10 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
it('should not update version when emitted by image-viewer and user doesn`t have update permissions', () => {
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue').and.callFake(() => {
|
||||
});
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue').and.callFake(() => {});
|
||||
component.readOnly = true;
|
||||
component.nodeEntry = new NodeEntry({
|
||||
entry: {
|
||||
name: 'fakeImage.png',
|
||||
id: '12',
|
||||
content: {mimeType: 'img/png'}
|
||||
}
|
||||
entry: new Node({ name: 'fakeImage.png', id: '12', content: new ContentInfo({ mimeType: 'img/png' }) })
|
||||
});
|
||||
const data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==');
|
||||
const fakeBlob = new Blob([data], { type: 'image/png' });
|
||||
@ -939,6 +895,5 @@ describe('AlfrescoViewerComponent', () => {
|
||||
expect(uploadService.uploadFilesInTheQueue).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
@ -35,7 +35,7 @@
|
||||
"@angular/router": ">=14.1.3",
|
||||
"@mat-datetimepicker/core": "^10.1.1",
|
||||
"@mat-datetimepicker/moment": "^10.1.1",
|
||||
"@alfresco/js-api": ">=6.3.0-1108",
|
||||
"@alfresco/js-api": ">=6.3.0-1271",
|
||||
"@alfresco/adf-extensions": ">=6.2.0",
|
||||
"@ngx-translate/core": ">=14.0.0",
|
||||
"minimatch-browser": ">=1.0.0",
|
||||
|
@ -15,14 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { User } from '../../../../..';
|
||||
import { CommentModel } from '../../../models/comment.model';
|
||||
|
||||
export const testUser = {
|
||||
export const testUser = new User({
|
||||
id: '1',
|
||||
firstName: 'Test',
|
||||
lastName: 'User',
|
||||
email: 'tu@domain.com'
|
||||
};
|
||||
});
|
||||
|
||||
export const mockCommentOne = new CommentModel({
|
||||
id: 1,
|
||||
@ -42,29 +43,25 @@ export const commentUserPictureDefined = new CommentModel({
|
||||
id: 2,
|
||||
message: '2nd Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
createdBy: new User({
|
||||
enabled: true,
|
||||
firstName: 'some',
|
||||
lastName: 'one',
|
||||
email: 'some-one@somegroup.com',
|
||||
emailNotificationsEnabled: true,
|
||||
company: {},
|
||||
id: 'fake-email@dom.com',
|
||||
avatarId: '001-001-001'
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
export const commentUserNoPictureDefined = new CommentModel({
|
||||
id: 2,
|
||||
message: '2nd Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
createdBy: new User({
|
||||
enabled: true,
|
||||
firstName: 'some',
|
||||
lastName: 'one',
|
||||
email: 'some-one@somegroup.com',
|
||||
emailNotificationsEnabled: true,
|
||||
company: {},
|
||||
id: 'fake-email@dom.com'
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -31,87 +31,35 @@ export class CommentsServiceMock implements Partial<CommentsService> {
|
||||
}
|
||||
}
|
||||
|
||||
const commentUser = new User({
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
id: 'hruser',
|
||||
email: 'test'
|
||||
});
|
||||
|
||||
export const commentsResponseMock = {
|
||||
getComments: () => of([
|
||||
new CommentModel({
|
||||
id: 1,
|
||||
message: 'Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
quota: -1,
|
||||
quotaUsed: 12,
|
||||
emailNotificationsEnabled: true,
|
||||
company: {
|
||||
organization: 'test',
|
||||
address1: 'test',
|
||||
address2: 'test',
|
||||
address3: 'test',
|
||||
postcode: 'test',
|
||||
telephone: 'test',
|
||||
fax: 'test',
|
||||
email: 'test'
|
||||
},
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as User,
|
||||
createdBy: commentUser,
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 2,
|
||||
message: 'Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
quota: -1,
|
||||
quotaUsed: 12,
|
||||
emailNotificationsEnabled: true,
|
||||
company: {
|
||||
organization: 'test',
|
||||
address1: 'test',
|
||||
address2: 'test',
|
||||
address3: 'test',
|
||||
postcode: 'test',
|
||||
telephone: 'test',
|
||||
fax: 'test',
|
||||
email: 'test'
|
||||
},
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as User,
|
||||
createdBy: commentUser,
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 3,
|
||||
message: 'Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
quota: -1,
|
||||
quotaUsed: 12,
|
||||
emailNotificationsEnabled: true,
|
||||
company: {
|
||||
organization: 'test',
|
||||
address1: 'test',
|
||||
address2: 'test',
|
||||
address3: 'test',
|
||||
postcode: 'test',
|
||||
telephone: 'test',
|
||||
fax: 'test',
|
||||
email: 'test'
|
||||
},
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as User,
|
||||
createdBy: commentUser,
|
||||
isSelected: false
|
||||
})
|
||||
]),
|
||||
@ -120,27 +68,7 @@ export const commentsResponseMock = {
|
||||
id: 1,
|
||||
message,
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
quota: -1,
|
||||
quotaUsed: 12,
|
||||
emailNotificationsEnabled: true,
|
||||
company: {
|
||||
organization: 'test',
|
||||
address1: 'test',
|
||||
address2: 'test',
|
||||
address3: 'test',
|
||||
postcode: 'test',
|
||||
telephone: 'test',
|
||||
fax: 'test',
|
||||
email: 'test'
|
||||
},
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as User,
|
||||
createdBy: commentUser,
|
||||
isSelected: false
|
||||
})
|
||||
)
|
||||
|
@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommentModel } from '../../models';
|
||||
import { CommentModel, User } from '../../models';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { CommentsService } from '../interfaces/comments-service.interface';
|
||||
import { testUser } from './comments.stories.mock';
|
||||
import { UserLike } from '../../pipes/user-like.interface';
|
||||
|
||||
export class CommentsServiceStoriesMock implements Partial<CommentsService> {
|
||||
|
||||
@ -33,87 +32,35 @@ export class CommentsServiceStoriesMock implements Partial<CommentsService> {
|
||||
}
|
||||
}
|
||||
|
||||
const commentUser = new User({
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
id: 'hruser',
|
||||
email: 'test'
|
||||
});
|
||||
|
||||
export const commentsResponseMock = {
|
||||
getComments: () => of([
|
||||
new CommentModel({
|
||||
id: 1,
|
||||
message: 'Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
quota: -1,
|
||||
quotaUsed: 12,
|
||||
emailNotificationsEnabled: true,
|
||||
company: {
|
||||
organization: 'test',
|
||||
address1: 'test',
|
||||
address2: 'test',
|
||||
address3: 'test',
|
||||
postcode: 'test',
|
||||
telephone: 'test',
|
||||
fax: 'test',
|
||||
email: 'test'
|
||||
},
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as UserLike,
|
||||
createdBy: commentUser,
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 2,
|
||||
message: 'Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
quota: -1,
|
||||
quotaUsed: 12,
|
||||
emailNotificationsEnabled: true,
|
||||
company: {
|
||||
organization: 'test',
|
||||
address1: 'test',
|
||||
address2: 'test',
|
||||
address3: 'test',
|
||||
postcode: 'test',
|
||||
telephone: 'test',
|
||||
fax: 'test',
|
||||
email: 'test'
|
||||
},
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as UserLike,
|
||||
createdBy: commentUser,
|
||||
isSelected: false
|
||||
}),
|
||||
new CommentModel({
|
||||
id: 3,
|
||||
message: 'Test Comment',
|
||||
created: new Date(),
|
||||
createdBy: {
|
||||
enabled: true,
|
||||
firstName: 'hruser',
|
||||
displayName: 'hruser',
|
||||
quota: -1,
|
||||
quotaUsed: 12,
|
||||
emailNotificationsEnabled: true,
|
||||
company: {
|
||||
organization: 'test',
|
||||
address1: 'test',
|
||||
address2: 'test',
|
||||
address3: 'test',
|
||||
postcode: 'test',
|
||||
telephone: 'test',
|
||||
fax: 'test',
|
||||
email: 'test'
|
||||
},
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as UserLike,
|
||||
createdBy: commentUser,
|
||||
isSelected: false
|
||||
})
|
||||
]),
|
||||
|
@ -18,14 +18,14 @@
|
||||
import { User } from './general-user.model';
|
||||
|
||||
export class CommentModel {
|
||||
id: number;
|
||||
id: string | number;
|
||||
message: string;
|
||||
created: Date;
|
||||
createdBy: User;
|
||||
isSelected: boolean;
|
||||
|
||||
get hasAvatarPicture(): boolean {
|
||||
return !!(this.createdBy['pictureId'] || this.createdBy['avatarId']);
|
||||
return !!this.createdBy && !!(this.createdBy['pictureId'] || this.createdBy['avatarId']);
|
||||
}
|
||||
|
||||
get userDisplayName(): string {
|
||||
@ -51,7 +51,7 @@ export class CommentModel {
|
||||
return result.toUpperCase();
|
||||
}
|
||||
|
||||
constructor(obj?: any) {
|
||||
constructor(obj?: Partial<CommentModel>) {
|
||||
if (obj) {
|
||||
this.id = obj.id;
|
||||
this.message = obj.message;
|
||||
|
@ -15,6 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { IdentityUserModel } from '../auth/models/identity-user.model';
|
||||
export class User {
|
||||
displayName?: string;
|
||||
username?: string;
|
||||
id?: string | number;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
email?: string;
|
||||
createdTimestamp?: any;
|
||||
emailVerified?: boolean;
|
||||
enabled?: boolean;
|
||||
readonly?: boolean;
|
||||
pictureId?: number;
|
||||
avatarId: string;
|
||||
|
||||
export type User = (IdentityUserModel) & { displayName?: string } & { username?: string };
|
||||
constructor(user?: Partial<User>) {
|
||||
if (user) {
|
||||
Object.assign(this, user);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -14,7 +14,7 @@
|
||||
"peerDependencies": {
|
||||
"@angular/common": ">=14.1.3",
|
||||
"@angular/core": ">=14.1.3",
|
||||
"@alfresco/js-api": ">=6.3.0-1108"
|
||||
"@alfresco/js-api": ">=6.3.0-1271"
|
||||
},
|
||||
"keywords": [
|
||||
"extensions",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"@angular/platform-browser": ">=14.1.3",
|
||||
"@angular/platform-browser-dynamic": ">=14.1.3",
|
||||
"@angular/router": ">=14.1.3",
|
||||
"@alfresco/js-api": ">=6.3.0-1108",
|
||||
"@alfresco/js-api": ">=6.3.0-1271",
|
||||
"@alfresco/adf-core": ">=6.2.0",
|
||||
"@alfresco/adf-content-services": ">=6.2.0",
|
||||
"@apollo/client": "^3.7.2",
|
||||
|
@ -104,7 +104,7 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi
|
||||
file,
|
||||
'',
|
||||
nodeId,
|
||||
'',
|
||||
null,
|
||||
{ overwrite: true }
|
||||
)).pipe(
|
||||
map((res: any) => res.entry)
|
||||
|
@ -58,7 +58,7 @@ export class ProcessCloudContentService {
|
||||
): Observable<Node> {
|
||||
|
||||
return from(
|
||||
this.uploadApi.uploadFile(file, '', nodeId, '', {overwrite: true})
|
||||
this.uploadApi.uploadFile(file, '', nodeId, null, {overwrite: true})
|
||||
).pipe(
|
||||
map((res: any) => ({
|
||||
...res.entry,
|
||||
|
@ -21,7 +21,7 @@
|
||||
"@angular/platform-browser": ">=14.1.3",
|
||||
"@angular/platform-browser-dynamic": ">=14.1.3",
|
||||
"@angular/router": ">=14.1.3",
|
||||
"@alfresco/js-api": ">=6.3.0-1108",
|
||||
"@alfresco/js-api": ">=6.3.0-1271",
|
||||
"@alfresco/adf-core": ">=6.2.0",
|
||||
"@alfresco/adf-content-services": ">=6.2.0",
|
||||
"@ngx-translate/core": ">=14.0.0",
|
||||
|
@ -64,7 +64,7 @@ export class ActivitiContentService {
|
||||
* @param tenantId
|
||||
* @param includeAccount
|
||||
*/
|
||||
getAlfrescoRepositories(tenantId?: number, includeAccount?: boolean): Observable<any> {
|
||||
getAlfrescoRepositories(tenantId?: string, includeAccount?: boolean): Observable<any> {
|
||||
const opts = {
|
||||
tenantId,
|
||||
includeAccounts: includeAccount ? includeAccount : true
|
||||
|
@ -25,7 +25,7 @@ import { AuthenticationService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AttachFileWidgetDialogComponentData } from './attach-file-widget-dialog-component.interface';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Node, SiteEntry, NodeEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { Node, SiteEntry, NodeEntry, SitePaging, SitePagingList } from '@alfresco/js-api';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('AttachFileWidgetDialogComponent', () => {
|
||||
@ -78,7 +78,7 @@ describe('AttachFileWidgetDialogComponent', () => {
|
||||
spyOn(nodeService, 'getNode').and.returnValue(of(new Node({ id: 'fake-node', path: { elements: [{ nodeType: 'st:site', name: 'fake-site'}] } })));
|
||||
|
||||
spyOn(siteService, 'getSite').and.returnValue(of(fakeSite));
|
||||
spyOn(siteService, 'getSites').and.returnValue(of(new SitePaging({ list: { entries: [] } })));
|
||||
spyOn(siteService, 'getSites').and.returnValue(of(new SitePaging({ list: new SitePagingList({ entries: [] }) })));
|
||||
spyOn(widget, 'isLoggedIn').and.callFake(() => isLogged);
|
||||
});
|
||||
|
||||
|
@ -34,7 +34,7 @@ import { ProcessContentService } from '../../services/process-content.service';
|
||||
const fakePngAnswer = new RelatedContentRepresentation({
|
||||
id: 1155,
|
||||
name: 'a_png_file.png',
|
||||
created: '2017-07-25T17:17:37.099Z',
|
||||
created: new Date('2017-07-25T17:17:37.099Z'),
|
||||
createdBy: {id: 1001, firstName: 'Admin', lastName: 'admin', email: 'admin'},
|
||||
relatedContent: false,
|
||||
contentAvailable: true,
|
||||
|
@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommentModel } from '@alfresco/adf-core';
|
||||
import { CommentModel, User } from '@alfresco/adf-core';
|
||||
|
||||
export const mockProcessInstanceComments = [
|
||||
new CommentModel({ message: 'Test1', created: Date.now(), createdBy: {firstName: 'Admin', lastName: 'User'} }),
|
||||
new CommentModel({ message: 'Test2', created: Date.now(), createdBy: {firstName: 'Admin', lastName: 'User'} }),
|
||||
new CommentModel({ message: 'Test3', created: Date.now(), createdBy: {firstName: 'Admin', lastName: 'User'} })
|
||||
new CommentModel({ message: 'Test1', created: new Date(), createdBy: new User({firstName: 'Admin', lastName: 'User'}) }),
|
||||
new CommentModel({ message: 'Test2', created: new Date(), createdBy: new User({firstName: 'Admin', lastName: 'User'}) }),
|
||||
new CommentModel({ message: 'Test3', created: new Date(), createdBy: new User({firstName: 'Admin', lastName: 'User'}) })
|
||||
];
|
||||
|
@ -911,8 +911,8 @@ export const fakeUser = new UserRepresentation({
|
||||
password: null,
|
||||
type: 'enterprise',
|
||||
status: 'active',
|
||||
created: '2020-08-14T09:21:52.306Z',
|
||||
lastUpdate: '2020-08-14T09:22:48.147Z',
|
||||
created: new Date('2020-08-14T09:21:52.306Z'),
|
||||
lastUpdate: new Date('2020-08-14T09:22:48.147Z'),
|
||||
tenantId: 310,
|
||||
groups: [
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { CommentModel, AlfrescoApiService, LogService, CommentsService } from '@alfresco/adf-core';
|
||||
import { CommentModel, AlfrescoApiService, LogService, CommentsService, User } from '@alfresco/adf-core';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { ActivitiCommentsApi } from '@alfresco/js-api';
|
||||
import { PeopleProcessService } from '../../common/services/people-process.service';
|
||||
@ -57,7 +57,7 @@ export class CommentProcessService implements CommentsService {
|
||||
id: comment.id,
|
||||
message: comment.message,
|
||||
created: comment.created,
|
||||
createdBy: user
|
||||
createdBy: new User(user)
|
||||
}));
|
||||
});
|
||||
return comments;
|
||||
@ -81,7 +81,7 @@ export class CommentProcessService implements CommentsService {
|
||||
id: response.id,
|
||||
message: response.message,
|
||||
created: response.created,
|
||||
createdBy: response.createdBy
|
||||
createdBy: new User(response.createdBy)
|
||||
})),
|
||||
catchError((err: any) => this.handleError(err))
|
||||
);
|
||||
@ -92,7 +92,7 @@ export class CommentProcessService implements CommentsService {
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
|
||||
getUserImage(user: any): string {
|
||||
getUserImage(user: UserProcessModel): string {
|
||||
return this.peopleProcessService.getUserImage(user);
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
ProcessFilterRequestRepresentation,
|
||||
ProcessInstanceQueryRepresentation,
|
||||
ProcessInstanceFilterRepresentation,
|
||||
UserProcessInstanceFilterRepresentation
|
||||
} from '@alfresco/js-api';
|
||||
@ -50,7 +50,7 @@ export class FilterProcessRepresentationModel implements UserProcessInstanceFilt
|
||||
/**
|
||||
* This object represent the parameters of a process filter.
|
||||
*/
|
||||
export class ProcessFilterParamRepresentationModel implements ProcessFilterRequestRepresentation {
|
||||
export class ProcessFilterParamRepresentationModel implements ProcessInstanceQueryRepresentation {
|
||||
|
||||
processDefinitionId?: string;
|
||||
processInstanceId?: string;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, CommentModel, CommentsService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, CommentModel, CommentsService, User } from '@alfresco/adf-core';
|
||||
import { ActivitiCommentsApi, CommentRepresentation } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { from, Observable, throwError } from 'rxjs';
|
||||
@ -100,7 +100,7 @@ export class TaskCommentsService implements CommentsService {
|
||||
id: representation.id,
|
||||
message: representation.message,
|
||||
created: representation.created,
|
||||
createdBy: representation.createdBy
|
||||
createdBy: new User(representation.createdBy)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,8 @@ import {
|
||||
FormOutcomeEvent,
|
||||
FormOutcomeModel,
|
||||
LogService,
|
||||
CommentModel
|
||||
CommentModel,
|
||||
User
|
||||
} from '@alfresco/adf-core';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import {
|
||||
@ -101,9 +102,9 @@ describe('TaskDetailsComponent', () => {
|
||||
taskCommentsService = TestBed.inject(TaskCommentsService);
|
||||
|
||||
spyOn(taskCommentsService, 'get').and.returnValue(of([
|
||||
new CommentModel({ message: 'Test1', created: Date.now(), createdBy: { firstName: 'Admin', lastName: 'User' } }),
|
||||
new CommentModel({ message: 'Test2', created: Date.now(), createdBy: { firstName: 'Admin', lastName: 'User' } }),
|
||||
new CommentModel({ message: 'Test3', created: Date.now(), createdBy: { firstName: 'Admin', lastName: 'User' } })
|
||||
new CommentModel({ message: 'Test1', created: new Date(), createdBy: new User({ firstName: 'Admin', lastName: 'User' }) }),
|
||||
new CommentModel({ message: 'Test2', created: new Date(), createdBy: new User({ firstName: 'Admin', lastName: 'User' }) }),
|
||||
new CommentModel({ message: 'Test3', created: new Date(), createdBy: new User({ firstName: 'Admin', lastName: 'User' }) })
|
||||
]));
|
||||
|
||||
fixture = TestBed.createComponent(TaskDetailsComponent);
|
||||
|
@ -11,7 +11,7 @@
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@alfresco/js-api": ">=6.3.0-1108"
|
||||
"@alfresco/js-api": ">=6.3.0-1271"
|
||||
},
|
||||
"keywords": [
|
||||
"testing",
|
||||
|
@ -49,7 +49,7 @@ export class ModelActions {
|
||||
return this.customModelApi.deactivateCustomModel(modelName);
|
||||
}
|
||||
|
||||
async deleteCustomModel(modelName: string): Promise<{ entry: CustomModel }> {
|
||||
async deleteCustomModel(modelName: string): Promise<void> {
|
||||
return this.customModelApi.deleteCustomModel(modelName);
|
||||
}
|
||||
|
||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -10,7 +10,7 @@
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@alfresco/js-api": "6.3.0-1108",
|
||||
"@alfresco/js-api": "6.3.0-1271",
|
||||
"@angular/animations": "14.1.3",
|
||||
"@angular/cdk": "14.1.2",
|
||||
"@angular/common": "14.1.3",
|
||||
@ -158,9 +158,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@alfresco/js-api": {
|
||||
"version": "6.3.0-1108",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-6.3.0-1108.tgz",
|
||||
"integrity": "sha512-U7YlT6HVsO14OdTi4g0l4MckgugioSfHCUnoAk0KVDQWk/j5CKl+GGIq71mf2ram2L3o9XB/oNhbFSo2cfilTA==",
|
||||
"version": "6.3.0-1271",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-6.3.0-1271.tgz",
|
||||
"integrity": "sha512-Q/zZeZt9V5di8acKeSEPXGmTf5gNyj7PQgPvVFq3Fgvsqjj4P2v5WcRQJbumeMK/Snk8bsWwYQk5Lh/Aau3cyA==",
|
||||
"dependencies": {
|
||||
"event-emitter": "^0.3.5",
|
||||
"superagent": "^8.0.9",
|
||||
|
@ -54,7 +54,7 @@
|
||||
"process services-cloud"
|
||||
],
|
||||
"dependencies": {
|
||||
"@alfresco/js-api": "6.3.0-1108",
|
||||
"@alfresco/js-api": "6.3.0-1271",
|
||||
"@angular/animations": "14.1.3",
|
||||
"@angular/cdk": "14.1.2",
|
||||
"@angular/common": "14.1.3",
|
||||
|
Loading…
x
Reference in New Issue
Block a user