mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
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:
parent
8459114b67
commit
c80cf9bdd2
@ -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 || {});
|
||||
|
||||
|
@ -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(
|
||||
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user