fix for [MNT-21394] Edit in Microsoft Office opens MS Excel documents then immediately prompts that a newer version exists (#1363)

This commit is contained in:
Adina Parpalita
2020-03-16 07:18:52 -07:00
committed by GitHub
parent db86a081e4
commit a9b278af18
2 changed files with 22 additions and 4 deletions

View File

@@ -84,7 +84,7 @@ export class ContentApiService {
getNodeInfo(nodeId: string, options?: any): Observable<Node> { getNodeInfo(nodeId: string, options?: any): Observable<Node> {
const defaults = { const defaults = {
include: ['isFavorite', 'allowableOperations'] include: ['isFavorite', 'allowableOperations', 'path']
}; };
const queryOptions = Object.assign(defaults, options || {}); const queryOptions = Object.assign(defaults, options || {});

View File

@@ -92,9 +92,27 @@ 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/${this.getNodeId( let url: string;
node const pathElements = (node.path.elements || []).map(
)}/${encodeURIComponent(node.name)}`; segment => segment.name
);
if (!pathElements.length) {
url = `${aosHost}/Company Home/_aos_nodeid/${this.getNodeId(
node
)}/${encodeURIComponent(node.name)}`;
}
if (pathElements.length === 1) {
url = `${aosHost}/${encodeURIComponent(node.name)}`;
}
if (pathElements.length > 1) {
const root = pathElements[1];
url = `${aosHost}/${root}/_aos_nodeid/${this.getNodeId(
node
)}/${encodeURIComponent(node.name)}`;
}
const fileExtension = getFileExtension(node.name); const fileExtension = getFileExtension(node.name);
const protocolHandler = this.getProtocolForFileExtension(fileExtension); const protocolHandler = this.getProtocolForFileExtension(fileExtension);