[ACS-5281] Changed editable state of metadata content based on change o… (#3400)

* ACS-5281 Changed editable state of metadata content based on change of file lock state

* ACS-5281 Updated versions

* ACS-5281 Reverted change

* ACS-5281 Upgrade version

* ACS-5281 Small correction

* ACS-5281 Fixed e2e
This commit is contained in:
AleksanderSklorz
2023-08-27 10:00:35 +02:00
committed by GitHub
parent bc9c58176f
commit aec6852672
45 changed files with 455 additions and 364 deletions

View File

@@ -23,11 +23,11 @@
*/
import { Action } from '@ngrx/store';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { Node } from '@alfresco/js-api';
export const AOS_ACTION = 'AOS_ACTION';
export class AosAction implements Action {
readonly type = AOS_ACTION;
constructor(public payload: MinimalNodeEntryEntity) {}
constructor(public payload: Node) {}
}

View File

@@ -25,11 +25,11 @@
/* cspell:disable */
import { AppConfigService, AuthenticationService, LogService, NotificationService } from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { Node } from '@alfresco/js-api';
import { getFileExtension, supportedExtensions } from '@alfresco/aca-shared/rules';
export interface IAosEditOnlineService {
onActionEditOnlineAos(node: MinimalNodeEntryEntity): void;
onActionEditOnlineAos(node: Node): void;
}
@Injectable({
@@ -43,7 +43,7 @@ export class AosEditOnlineService implements IAosEditOnlineService {
private logService: LogService
) {}
onActionEditOnlineAos(node: MinimalNodeEntryEntity): void {
onActionEditOnlineAos(node: Node): void {
if (node && this.isFile(node) && node.properties) {
if (node.isLocked) {
// const checkedOut = node.aspectNames.find(
@@ -88,7 +88,7 @@ export class AosEditOnlineService implements IAosEditOnlineService {
return fileExtension && supportedExtensions[fileExtension];
}
private triggerEditOnlineAos(node: MinimalNodeEntryEntity): void {
private triggerEditOnlineAos(node: Node): void {
const aosHost = this.appConfigService.get('aosHost');
let url: string;
const pathElements = (node.path?.elements || []).map((segment) => segment.name);
@@ -139,13 +139,13 @@ export class AosEditOnlineService implements IAosEditOnlineService {
}, 500);
}
private isFile(node: MinimalNodeEntryEntity): boolean {
private isFile(node: Node): boolean {
const implicitFile = (node as any).nodeId || (node as any).guid;
return !!implicitFile || node.isFile;
}
private getNodeId(node: MinimalNodeEntryEntity): string {
private getNodeId(node: Node): string {
return (node as any).nodeId || (node as any).guid || node.id;
}
}

View File

@@ -22,7 +22,7 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { Node } from '@alfresco/js-api';
import { TestBed } from '@angular/core/testing';
import { provideMockActions } from '@ngrx/effects/testing';
import { Observable, of } from 'rxjs';
@@ -60,7 +60,7 @@ describe('AosEffects', () => {
it('should call onActionEditOnlineAos on AOS_ACTION', () => {
const onActionEditOnlineAosSpy = spyOn(aosEditOnlineService, 'onActionEditOnlineAos');
const payload = new MinimalNodeEntryEntity();
const payload = new Node();
const action = new AosAction(payload);
aosActions$ = of(action);