MNT-21394 Edit in Microsoft Office opens MS Excel documents then immediately prompts that a newer version exists (#1355)

* aos path

* node info allowableOperations and path

* fallback when path elements are not defined

* fallback for no path

* fix tests

* call default optionals params

* node info include path
This commit is contained in:
Cilibiu Bogdan 2020-03-17 08:37:47 +02:00 committed by GitHub
parent 8459114b67
commit c80cf9bdd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 4 deletions

View File

@ -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 || {});

View File

@ -92,9 +92,28 @@ export class AosEditOnlineService {
private triggerEditOnlineAos(node: MinimalNodeEntryEntity): void {
const aosHost = this.appConfigService.get('aosHost');
const url = `${aosHost}/_aos_nodeid/${this.getNodeId(
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);