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 {
|
onActionEditOnlineAos(node: MinimalNodeEntryEntity): void {
|
||||||
if (node && node.isFile && node.properties) {
|
if (node && this.isFile(node) && node.properties) {
|
||||||
if (node.isLocked) {
|
if (node.isLocked) {
|
||||||
// const checkedOut = node.aspectNames.find(
|
// const checkedOut = node.aspectNames.find(
|
||||||
// (aspect: string) => aspect === 'cm:checkedOut'
|
// (aspect: string) => aspect === 'cm:checkedOut'
|
||||||
@ -92,9 +92,9 @@ export class AosEditOnlineService {
|
|||||||
|
|
||||||
private triggerEditOnlineAos(node: MinimalNodeEntryEntity): void {
|
private triggerEditOnlineAos(node: MinimalNodeEntryEntity): void {
|
||||||
const aosHost = this.appConfigService.get('aosHost');
|
const aosHost = this.appConfigService.get('aosHost');
|
||||||
const url = `${aosHost}/_aos_nodeid/${node.id}/${encodeURIComponent(
|
const url = `${aosHost}/_aos_nodeid/${this.getNodeId(
|
||||||
node.name
|
node
|
||||||
)}`;
|
)}/${encodeURIComponent(node.name)}`;
|
||||||
const fileExtension = getFileExtension(node.name);
|
const fileExtension = getFileExtension(node.name);
|
||||||
const protocolHandler = this.getProtocolForFileExtension(fileExtension);
|
const protocolHandler = this.getProtocolForFileExtension(fileExtension);
|
||||||
|
|
||||||
@ -134,4 +134,14 @@ export class AosEditOnlineService {
|
|||||||
}
|
}
|
||||||
}, 500);
|
}, 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