mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-19 17:14:45 +00:00
add workaround needed in ADW due to REPO-4772 (#1353)
This commit is contained in:
parent
1162cb1ba0
commit
2e126b787d
@ -33,7 +33,7 @@ export class NodeBodyCreate {
|
|||||||
public name: string,
|
public name: string,
|
||||||
public nodeType: string,
|
public nodeType: string,
|
||||||
public relativePath: string = '/',
|
public relativePath: string = '/',
|
||||||
public aspectNames?: string[], // workaround for REPO-4772
|
public aspectNames?: string[],
|
||||||
public properties?: any[]
|
public properties?: any[]
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
@ -231,6 +231,9 @@ export class NodesApi extends RepoApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '', imageProps: any = null, author: string = '', majorVersion: boolean = true, aspectNames: string[] = null): Promise<NodeEntry|null> {
|
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '', imageProps: any = null, author: string = '', majorVersion: boolean = true, aspectNames: string[] = null): Promise<NodeEntry|null> {
|
||||||
|
if (!aspectNames) {
|
||||||
|
aspectNames = ['cm:versionable']; // workaround for REPO-4772
|
||||||
|
}
|
||||||
const nodeBody = {
|
const nodeBody = {
|
||||||
name,
|
name,
|
||||||
nodeType,
|
nodeType,
|
||||||
@ -255,9 +258,6 @@ export class NodesApi extends RepoApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createFile(name: string, parentId: string = '-my-', title: string = '', description: string = '', author: string = '', majorVersion: boolean = true, aspectNames: string[] = null): Promise<NodeEntry> {
|
async createFile(name: string, parentId: string = '-my-', title: string = '', description: string = '', author: string = '', majorVersion: boolean = true, aspectNames: string[] = null): Promise<NodeEntry> {
|
||||||
if (!aspectNames) {
|
|
||||||
aspectNames = ['cm:versionable'] // workaround for REPO-4772
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion, aspectNames);
|
return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion, aspectNames);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -75,7 +75,9 @@ export class Utils {
|
|||||||
static retryCall(fn: () => Promise<any>, retry: number = 30, delay: number = 1000): Promise<any> {
|
static retryCall(fn: () => Promise<any>, retry: number = 30, delay: number = 1000): Promise<any> {
|
||||||
const pause = duration => new Promise(res => setTimeout(res, duration));
|
const pause = duration => new Promise(res => setTimeout(res, duration));
|
||||||
|
|
||||||
const run = retries => fn().catch(err => (retries > 1 ? pause(delay).then(() => run(retries - 1)) : Promise.reject(err)));
|
const run = retries => {
|
||||||
|
return fn().catch(err => (retries > 1 ? pause(delay).then(() => run(retries - 1)) : Promise.reject(err)));
|
||||||
|
}
|
||||||
|
|
||||||
return run(retry);
|
return run(retry);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user