add workaround needed in ADW due to REPO-4772 ()

This commit is contained in:
Adina Parpalita 2020-02-25 18:43:32 +02:00 committed by GitHub
parent 1162cb1ba0
commit 2e126b787d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions
e2e/utilities

@ -33,7 +33,7 @@ export class NodeBodyCreate {
public name: string,
public nodeType: string,
public relativePath: string = '/',
public aspectNames?: string[], // workaround for REPO-4772
public aspectNames?: string[],
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> {
if (!aspectNames) {
aspectNames = ['cm:versionable']; // workaround for REPO-4772
}
const nodeBody = {
name,
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> {
if (!aspectNames) {
aspectNames = ['cm:versionable'] // workaround for REPO-4772
}
try {
return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion, aspectNames);
} catch (error) {

@ -75,7 +75,9 @@ export class Utils {
static retryCall(fn: () => Promise<any>, retry: number = 30, delay: number = 1000): Promise<any> {
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);
}