Skip to content

Commit

Permalink
fix for [MNT-21394] Edit in Microsoft Office opens MS Excel documents…
Browse files Browse the repository at this point in the history
… then immediately prompts that a newer version exists (#1363)
  • Loading branch information
adinapitul authored Mar 16, 2020
1 parent db86a08 commit a9b278a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class ContentApiService {

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

Expand Down
24 changes: 21 additions & 3 deletions projects/adf-office-services-ext/src/lib/aos-extension.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,27 @@ export class AosEditOnlineService {

private triggerEditOnlineAos(node: MinimalNodeEntryEntity): void {
const aosHost = this.appConfigService.get('aosHost');
const url = `${aosHost}/_aos_nodeid/${this.getNodeId(
node
)}/${encodeURIComponent(node.name)}`;
let url: string;
const pathElements = (node.path.elements || []).map(
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 protocolHandler = this.getProtocolForFileExtension(fileExtension);

Expand Down

0 comments on commit a9b278a

Please sign in to comment.