mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
Sonarcloud issues fixes (#3499)
* Sonarcloud issues fixes * Code smell fixes * Refactoring to remove new code duplications * Sonarcloud code smell fixes part I * Sonarcloud code smell fixes part II * Missing code smell fix * Add new ESLint rules to cover fixed SonarCloud issues * Add missing command * Add missing is existing check
This commit is contained in:
@@ -142,20 +142,18 @@ export class UserActions {
|
||||
* @param expectedSize Size of the trashcan to wait for.
|
||||
*/
|
||||
async waitForTrashcanSize(expectedSize: number): Promise<number> {
|
||||
try {
|
||||
return Utils.retryCall(async () => {
|
||||
const totalItems = await this.getTrashcanSize();
|
||||
return Utils.retryCall(async () => {
|
||||
const totalItems = await this.getTrashcanSize();
|
||||
|
||||
if (totalItems !== expectedSize) {
|
||||
return Promise.reject(totalItems);
|
||||
} else {
|
||||
return Promise.resolve(totalItems);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
if (totalItems !== expectedSize) {
|
||||
return Promise.reject(totalItems);
|
||||
} else {
|
||||
return Promise.resolve(totalItems);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.handleError('User Actions - waitForTrashcanSize failed : ', error);
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async lockNodes(nodeIds: string[], lockType: string = 'ALLOW_OWNER_CHANGES') {
|
||||
|
Reference in New Issue
Block a user