mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
resolve node id for different nodes (#1327)
This commit is contained in:
@@ -44,7 +44,7 @@ export class AosEditOnlineService {
|
||||
) {}
|
||||
|
||||
onActionEditOnlineAos(node: MinimalNodeEntryEntity): void {
|
||||
if (node && node.isFile && node.properties) {
|
||||
if (node && this.isFile(node) && node.properties) {
|
||||
if (node.isLocked) {
|
||||
// const checkedOut = node.aspectNames.find(
|
||||
// (aspect: string) => aspect === 'cm:checkedOut'
|
||||
@@ -92,9 +92,9 @@ export class AosEditOnlineService {
|
||||
|
||||
private triggerEditOnlineAos(node: MinimalNodeEntryEntity): void {
|
||||
const aosHost = this.appConfigService.get('aosHost');
|
||||
const url = `${aosHost}/_aos_nodeid/${node.id}/${encodeURIComponent(
|
||||
node.name
|
||||
)}`;
|
||||
const url = `${aosHost}/_aos_nodeid/${this.getNodeId(
|
||||
node
|
||||
)}/${encodeURIComponent(node.name)}`;
|
||||
const fileExtension = getFileExtension(node.name);
|
||||
const protocolHandler = this.getProtocolForFileExtension(fileExtension);
|
||||
|
||||
@@ -134,4 +134,14 @@ export class AosEditOnlineService {
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
private isFile(node: MinimalNodeEntryEntity): boolean {
|
||||
const implicitFile = (<any>node).nodeId || (<any>node).guid;
|
||||
|
||||
return !!implicitFile || node.isFile;
|
||||
}
|
||||
|
||||
private getNodeId(node: MinimalNodeEntryEntity): string {
|
||||
return (<any>node).nodeId || (<any>node).guid || node.id;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user