mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-26 17:24:45 +00:00
resolve node id for different nodes (#1327)
This commit is contained in:
parent
5102f7d64d
commit
874392159d
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user