mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-04-23 22:30:24 +00:00
[ACS-11306] Fixed eslint issues related with unused error and optional chaining
This commit is contained in:
@@ -116,7 +116,7 @@ test.describe('Mark items as favorites', () => {
|
||||
await favoritesApi.addFavoritesByIds('file', [fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id]);
|
||||
await favoritesApi.addFavoriteById('folder', folderId);
|
||||
await favoritesApi.removeFavoritesByIds(username, [fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id]);
|
||||
} catch (error) {}
|
||||
} catch {}
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ personalFiles }) => {
|
||||
|
||||
@@ -281,7 +281,7 @@ export class ManageRulesSmartComponent implements OnInit {
|
||||
try {
|
||||
await this.folderRuleSetsService.deleteRuleSetLink(this.nodeId, linkedRuleSet.id);
|
||||
this.folderRuleSetsService.refreshMainRuleSet();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
this.notificationService.showError('ACA_FOLDER_RULES.ERRORS.DELETE_RULE_SET_LINK_FAILED');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
// check the child nodes to show dropped folder
|
||||
if (event && event.file.options.parentId === this.getParentNodeId()) {
|
||||
if (event?.file.options.parentId === this.getParentNodeId()) {
|
||||
this.displayFolderParent(0, event.file.options.path);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ export class SearchLibrariesResultsComponent extends PageComponent implements On
|
||||
if (statusCode === 400) {
|
||||
this.appHookService.library400Error.next();
|
||||
}
|
||||
} catch (e) {}
|
||||
} catch {}
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -488,7 +488,7 @@ export class ContentManagementService {
|
||||
} else if (statusCode === 403) {
|
||||
i18nMessageString = 'APP.MESSAGES.ERRORS.PERMISSION';
|
||||
}
|
||||
} catch (err) {
|
||||
} catch {
|
||||
/* Do nothing, keep the original message */
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ describe('NodeActionsService', () => {
|
||||
new Promise((resolve, reject) => {
|
||||
if (isForbidden) {
|
||||
reject(permissionError);
|
||||
} else if (nameExistingOnDestination && options && options.name === nameExistingOnDestination) {
|
||||
} else if (nameExistingOnDestination && options?.name === nameExistingOnDestination) {
|
||||
reject(conflictError);
|
||||
} else {
|
||||
resolve('');
|
||||
|
||||
@@ -351,7 +351,7 @@ export class NodeActionsService {
|
||||
error: { statusCode }
|
||||
} = JSON.parse(err.message);
|
||||
errStatusCode = statusCode;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ export class NodeActionsService {
|
||||
error: { statusCode }
|
||||
} = JSON.parse(err.message);
|
||||
errStatusCode = statusCode;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ export class TemplateEffects {
|
||||
|
||||
try {
|
||||
statusCode = JSON.parse(error.message).error.statusCode;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
statusCode = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
}
|
||||
await this.router.navigate([this.previewLocation, id]);
|
||||
} catch (err) {
|
||||
if (!err || err.status !== 401) {
|
||||
if (err?.status !== 401) {
|
||||
await this.router.navigate([this.previewLocation, id]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export class FavoritesPageApi {
|
||||
}
|
||||
};
|
||||
return await Utils.retryCall(favorite);
|
||||
} catch (error) {}
|
||||
} catch {}
|
||||
return isFavorite;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ export class FileActionsApi {
|
||||
const apiCall = async () => {
|
||||
try {
|
||||
return (await this.queryNodesNames(searchTerm)).list.pagination.totalItems;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ export class SharedLinksApi {
|
||||
expiresAt: expireDate
|
||||
};
|
||||
return this.apiService.share.createSharedLink(data);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ type LaunchOptions = Parameters<typeof chromium.launch>[0];
|
||||
|
||||
try {
|
||||
loadEnvFile();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// .env file is optional, continue without it
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user