mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-3212] Fixed permission issues when updating version (#3503)
* [ADF-3213] Fixed permission issues when updating version * [ADF-3212] fixed test for PR * allowableOperations include viewer get node
This commit is contained in:
parent
cc73484a76
commit
0fae46b50b
@ -99,7 +99,7 @@ describe('UploadService', () => {
|
||||
service.uploadFilesInTheQueue(emitter);
|
||||
|
||||
let request = jasmine.Ajax.requests.mostRecent();
|
||||
expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true');
|
||||
expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true&include=allowableOperations');
|
||||
expect(request.method).toBe('POST');
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@ -124,7 +124,7 @@ describe('UploadService', () => {
|
||||
service.addToQueue(fileFake);
|
||||
service.uploadFilesInTheQueue(emitter);
|
||||
expect(jasmine.Ajax.requests.mostRecent().url)
|
||||
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true');
|
||||
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true&include=allowableOperations');
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
'status': 404,
|
||||
@ -177,6 +177,7 @@ describe('UploadService', () => {
|
||||
size: 10
|
||||
}, undefined, undefined, null, {
|
||||
renditions: 'doclib',
|
||||
include: [ 'allowableOperations' ],
|
||||
overwrite: true,
|
||||
majorVersion: undefined,
|
||||
comment: undefined,
|
||||
@ -200,7 +201,7 @@ describe('UploadService', () => {
|
||||
service.uploadFilesInTheQueue(emitter);
|
||||
|
||||
let request = jasmine.Ajax.requests.mostRecent();
|
||||
expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/123/children?autoRename=true');
|
||||
expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/123/children?autoRename=true&include=allowableOperations');
|
||||
expect(request.method).toBe('POST');
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
|
@ -157,7 +157,8 @@ export class UploadService {
|
||||
*/
|
||||
getUploadPromise(file: FileModel) {
|
||||
let opts: any = {
|
||||
renditions: 'doclib'
|
||||
renditions: 'doclib',
|
||||
include: ['allowableOperations']
|
||||
};
|
||||
|
||||
if (file.options.newVersion === true) {
|
||||
|
@ -175,14 +175,14 @@ describe('ViewerComponent', () => {
|
||||
component.ngOnChanges({});
|
||||
tick();
|
||||
|
||||
expect(alfrescoApiService.nodesApi.getNodeInfo).toHaveBeenCalledWith('id1');
|
||||
expect(alfrescoApiService.nodesApi.getNodeInfo).toHaveBeenCalledWith('id1', {include: [ 'allowableOperations' ]});
|
||||
expect(component.displayName).toBe('file1');
|
||||
|
||||
component.fileNodeId = 'id2';
|
||||
component.ngOnChanges({});
|
||||
tick();
|
||||
|
||||
expect(alfrescoApiService.nodesApi.getNodeInfo).toHaveBeenCalledWith('id2');
|
||||
expect(alfrescoApiService.nodesApi.getNodeInfo).toHaveBeenCalledWith('id2', {include: [ 'allowableOperations' ]});
|
||||
expect(component.displayName).toBe('file2');
|
||||
}));
|
||||
|
||||
|
@ -285,7 +285,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.setUpUrlFile();
|
||||
this.isLoading = false;
|
||||
} else if (this.nodeId) {
|
||||
this.apiService.nodesApi.getNodeInfo(this.nodeId).then(
|
||||
this.apiService.nodesApi.getNodeInfo(this.nodeId, { include: ['allowableOperations'] }).then(
|
||||
(data: MinimalNodeEntryEntity) => {
|
||||
this.setUpNodeFile(data).then(() => {
|
||||
this.isLoading = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user