[ACS-5991] ESLint fixes and code quality improvements (#8893)

* prefer-optional-chain: core

* prefer-optional-chain: content, fix typings

* prefer-optional-chain: process, fix typings

* prefer-optional-chain: process-cloud, fix typings, fix ts configs and eslint

* [ci: force] sonar errors fixes, insights lib

* [ci:force] fix security issues

* [ci:force] fix metadata e2e bug, js assignment bugs

* [ci:force] fix lint issue

* [ci:force] fix tests
This commit is contained in:
Denys Vuika
2023-09-18 09:42:16 +01:00
committed by GitHub
parent 99f591ed67
commit a1dd270c5d
203 changed files with 4155 additions and 4960 deletions

View File

@@ -19,7 +19,6 @@ import { $, by, element, Key, protractor, ElementFinder } from 'protractor';
import { BrowserActions, BrowserVisibility, DropdownPage, TestElement, Logger } from '@alfresco/adf-testing';
export class MetadataViewPage {
title = $(`div[info-drawer-title]`);
expandedAspect = $(`mat-expansion-panel-header[aria-expanded='true']`);
aspectTitle = `mat-panel-title`;
@@ -48,8 +47,10 @@ export class MetadataViewPage {
saveMetadataButton = $(`[data-automation-id='save-metadata']`);
resetMetadataButton = $(`[data-automation-id='reset-metadata']`);
private getMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => $(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"]`);
private getExpandedMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => $(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"] > mat-expansion-panel-header`);
private getMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> =>
$(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"]`);
private getExpandedMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> =>
$(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"] > mat-expansion-panel-header`);
async getTitle(): Promise<string> {
return BrowserActions.getText(this.title);
@@ -132,7 +133,9 @@ export class MetadataViewPage {
}
async clickOnPropertiesTab(): Promise<void> {
const propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`));
const propertiesTab = element(
by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`)
);
await BrowserActions.click(propertiesTab);
}
@@ -208,7 +211,9 @@ export class MetadataViewPage {
}
async getMetadataGroupTitle(groupName: string): Promise<string> {
const group = $('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title');
const group = $(
'mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title'
);
return BrowserActions.getText(group);
}
@@ -225,7 +230,7 @@ export class MetadataViewPage {
return false;
}
await type.waitVisible();
const isPresent = type.isPresent();
const isPresent = await type.isPresent();
if (isPresent) {
return true;
}
@@ -269,7 +274,7 @@ export class MetadataViewPage {
} catch (error) {
Logger.log(`re trying content type options attempt :: ${attempt}`);
await BrowserActions.closeMenuAndDialogs();
return this.changeContentType(option, attempt + 1, maxAttempt);
return this.changeContentType(option, attempt + 1, maxAttempt);
}
}