mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-6081] Reduce references to internal Angular material CSS classes (#3534)
* [ACS-6081] Reduce references to internal Angular material CSS classes * [ACS-6081] rollback default scrollable value [ci:force] * [ACS-6081] linting * [ACS-6081] fix e2es * [ACS-6081] cr fix * [ACS-6081] remove adf-cli logger from e2es
This commit is contained in:
committed by
GitHub
parent
7468111d19
commit
7c95b53c8b
@@ -41,7 +41,6 @@ import {
|
||||
TrashcanApi,
|
||||
PersonEntry
|
||||
} from '@alfresco/js-api';
|
||||
import { logger } from '@alfresco/adf-cli/scripts/logger';
|
||||
import { ActionTypes, Rule } from './rules-api';
|
||||
import { users } from '../base-config';
|
||||
import { Person, PersonModel } from './people-api-models';
|
||||
@@ -145,7 +144,7 @@ export class ApiClientFactory {
|
||||
try {
|
||||
e = await this.alfrescoApi.login(user, userPassword);
|
||||
} catch (error) {
|
||||
logger.error(`[API Client Factory] Log in user ${user} failed ${e}`);
|
||||
console.error(`[API Client Factory] Log in user ${user} failed ${e}`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -155,7 +154,7 @@ export class ApiClientFactory {
|
||||
try {
|
||||
e = await this.alfrescoApi.login(user.username, user.password);
|
||||
} catch (error) {
|
||||
logger.error(`[API Client Factory] Log in user ${user.username} failed ${e}`);
|
||||
console.error(`[API Client Factory] Log in user ${user.username} failed ${e}`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -167,7 +166,7 @@ export class ApiClientFactory {
|
||||
try {
|
||||
return peopleApi.createPerson(person);
|
||||
} catch (error) {
|
||||
logger.error('[API Client Factory] createUser failed : ', error);
|
||||
console.error('[API Client Factory] createUser failed : ', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -178,7 +177,7 @@ export class ApiClientFactory {
|
||||
try {
|
||||
return peopleApi.updatePerson(username, { password: newPassword });
|
||||
} catch (error) {
|
||||
logger.error('[API Client Factory] changePassword failed : ', error);
|
||||
console.error('[API Client Factory] changePassword failed : ', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,6 @@
|
||||
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
import { NodeChildAssociationPaging, NodeEntry, NodePaging } from '@alfresco/js-api';
|
||||
import { logger } from '@alfresco/adf-cli/scripts/logger';
|
||||
import { NodeContentTree, flattenNodeContentTree } from './node-content-tree';
|
||||
|
||||
export class NodesApi {
|
||||
@@ -51,7 +50,7 @@ export class NodesApi {
|
||||
try {
|
||||
return await this.createNode('cm:folder', name, parentId, title, description, null, author, null, aspectNames);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.createFolder.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.createFolder.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +67,7 @@ export class NodesApi {
|
||||
try {
|
||||
return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion, aspectNames);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.createFile.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.createFile.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -77,7 +76,7 @@ export class NodesApi {
|
||||
try {
|
||||
return await this.createContent({ files: names }, relativePath);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.createFiles.name}: ${error}`);
|
||||
console.error(`${this.constructor.name} ${this.createFiles.name}: ${error}`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +115,7 @@ export class NodesApi {
|
||||
majorVersion
|
||||
});
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.createNode.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.createNode.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -125,7 +124,7 @@ export class NodesApi {
|
||||
try {
|
||||
return this.apiService.nodes.updateNode(nodeId, { name: newName });
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.renameNode.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.renameNode.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -141,7 +140,7 @@ export class NodesApi {
|
||||
await this.apiService.nodes.deleteNode(nodeId, { permanent });
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.deleteNodes.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.deleteNodes.name}`, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +154,7 @@ export class NodesApi {
|
||||
const userNodesIds = userNodes.map((nodeChild) => nodeChild.entry.id);
|
||||
await this.deleteNodes(userNodesIds);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.deleteCurrentUserNodes.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.deleteCurrentUserNodes.name}`, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +164,7 @@ export class NodesApi {
|
||||
await this.apiService.nodes.lockNode(nodeId, { type: lockType });
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.lockNodes.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.lockNodes.name}`, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +172,7 @@ export class NodesApi {
|
||||
try {
|
||||
return await this.apiService.nodes.createNode('-my-', flattenNodeContentTree(content, relativePath) as any);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.createContent.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.createContent.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -182,7 +181,7 @@ export class NodesApi {
|
||||
try {
|
||||
return await this.apiService.nodes.getNode(id);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.getNodeById.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.getNodeById.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -192,7 +191,7 @@ export class NodesApi {
|
||||
const children = (await this.getNodeChildren(parentId)).list.entries;
|
||||
return children.find((elem) => elem.entry.name === name).entry.id || '';
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.getNodeIdFromParent.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.getNodeIdFromParent.name}`, error);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -204,7 +203,7 @@ export class NodesApi {
|
||||
};
|
||||
return await this.apiService.nodes.listNodeChildren(nodeId, opts);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.getNodeChildren.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.getNodeChildren.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -213,7 +212,7 @@ export class NodesApi {
|
||||
try {
|
||||
await this.apiService.nodes.deleteNode(id, { permanent });
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.deleteNodeById.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.deleteNodeById.name}`, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +224,7 @@ export class NodesApi {
|
||||
await this.deleteNodeById(nodeId);
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - cleanupNodeTemplatesItems failed : ', error);
|
||||
console.error('Admin Actions - cleanupNodeTemplatesItems failed : ', error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +236,7 @@ export class NodesApi {
|
||||
await this.deleteNodeById(nodeId);
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - cleanupSpaceTemplatesFolder failed : ', error);
|
||||
console.error('Admin Actions - cleanupSpaceTemplatesFolder failed : ', error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +244,7 @@ export class NodesApi {
|
||||
try {
|
||||
return this.getNodeIdFromParent('Node Templates', await this.getDataDictionaryId());
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - getNodeTemplatesFolderId failed : ', error);
|
||||
console.error('Admin Actions - getNodeTemplatesFolderId failed : ', error);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -254,14 +253,14 @@ export class NodesApi {
|
||||
try {
|
||||
return this.getNodeIdFromParent('Space Templates', await this.getDataDictionaryId());
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - getSpaceTemplatesFolderId failed : ', error);
|
||||
console.error('Admin Actions - getSpaceTemplatesFolderId failed : ', error);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
private async getDataDictionaryId(): Promise<string> {
|
||||
return this.getNodeIdFromParent('Data Dictionary', '-root-').catch((error) => {
|
||||
logger.error('Admin Actions - getDataDictionaryId failed : ', error);
|
||||
console.error('Admin Actions - getDataDictionaryId failed : ', error);
|
||||
return '';
|
||||
});
|
||||
}
|
||||
@@ -282,7 +281,7 @@ export class NodesApi {
|
||||
try {
|
||||
return await this.apiService.nodes.updateNode(nodeId, data);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.setGranularPermission.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.setGranularPermission.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -294,7 +293,7 @@ export class NodesApi {
|
||||
|
||||
return this.setInheritPermissions(nodeId, false);
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - removeUserAccessOnNodeTemplate failed : ', error);
|
||||
console.error('Admin Actions - removeUserAccessOnNodeTemplate failed : ', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -306,7 +305,7 @@ export class NodesApi {
|
||||
|
||||
return this.setInheritPermissions(nodeId, false);
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - removeUserAccessOnSpaceTemplate failed : ', error);
|
||||
console.error('Admin Actions - removeUserAccessOnSpaceTemplate failed : ', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -321,7 +320,7 @@ export class NodesApi {
|
||||
try {
|
||||
return await this.apiService.nodes.updateNode(nodeId, data);
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.setInheritPermissions.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.setInheritPermissions.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -330,7 +329,7 @@ export class NodesApi {
|
||||
try {
|
||||
return this.apiService.nodes.updateNode(nodeId, { aspectNames });
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.addAspects.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.addAspects.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -350,7 +349,7 @@ export class NodesApi {
|
||||
await this.addAspects(originalNodeId, ['app:linked']);
|
||||
return link;
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.createFileLink.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.createFileLink.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -373,7 +372,7 @@ export class NodesApi {
|
||||
await this.addAspects(originalNodeId, ['app:linked']);
|
||||
return link;
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.createFolderLink.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.createFolderLink.name}`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -386,7 +385,7 @@ export class NodesApi {
|
||||
|
||||
return this.createFileLink(nodeId, destinationParentId);
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - createLinkToFileName failed : ', error);
|
||||
console.error('Admin Actions - createLinkToFileName failed : ', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -398,7 +397,7 @@ export class NodesApi {
|
||||
const nodeId = await this.getNodeIdFromParent(originalFolderName, originalFolderParentId);
|
||||
return this.createFolderLink(nodeId, destinationParentId);
|
||||
} catch (error) {
|
||||
logger.error('Admin Actions - createLinkToFolderName failed : ', error);
|
||||
console.error('Admin Actions - createLinkToFolderName failed : ', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { logger } from '@alfresco/adf-cli/scripts/logger';
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
import { SharedLinkEntry, SharedLinkPaging } from '@alfresco/js-api';
|
||||
import { Utils } from '../utils';
|
||||
@@ -61,7 +60,7 @@ export class SharedLinksApi {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`SharedLinksApi shareFilesByIds : catch : `, error);
|
||||
console.error(`SharedLinksApi shareFilesByIds : catch : `, error);
|
||||
}
|
||||
return sharedLinks;
|
||||
}
|
||||
@@ -73,7 +72,7 @@ export class SharedLinksApi {
|
||||
};
|
||||
return await this.apiService.share.listSharedLinks(opts);
|
||||
} catch (error) {
|
||||
logger.error(`SharedLinksApi getSharedLinks : catch : `, error);
|
||||
console.error(`SharedLinksApi getSharedLinks : catch : `, error);
|
||||
return new SharedLinkPaging;
|
||||
}
|
||||
}
|
||||
@@ -92,8 +91,8 @@ export class SharedLinksApi {
|
||||
|
||||
return Utils.retryCall(sharedFile);
|
||||
} catch (error) {
|
||||
logger.error(`SharedLinksApi waitForFilesToBeShared : catch : ${error}`);
|
||||
logger.error(`\tWait timeout reached waiting for files to be shared`);
|
||||
console.error(`SharedLinksApi waitForFilesToBeShared : catch : ${error}`);
|
||||
console.error(`\tWait timeout reached waiting for files to be shared`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,6 @@
|
||||
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
import { Site, SiteBodyCreate, SiteEntry, SiteMemberEntry, SiteMembershipBodyCreate, SiteMembershipBodyUpdate } from '@alfresco/js-api';
|
||||
import { logger } from '@alfresco/adf-cli/scripts/logger';
|
||||
|
||||
export class SitesApi {
|
||||
private apiService: ApiClientFactory;
|
||||
@@ -49,7 +48,7 @@ export class SitesApi {
|
||||
try {
|
||||
return await this.apiService.sites.createSite(site);
|
||||
} catch (error) {
|
||||
logger.error(`SitesApi createSite : catch : `, error);
|
||||
console.error(`SitesApi createSite : catch : `, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -58,7 +57,7 @@ export class SitesApi {
|
||||
try {
|
||||
return (await this.apiService.sites.listSiteContainers(siteId)).list.entries[0].entry.id;
|
||||
} catch (error) {
|
||||
logger.error(`SitesApi getDocLibId : catch : `, error);
|
||||
console.error(`SitesApi getDocLibId : catch : `, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +75,7 @@ export class SitesApi {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`${this.constructor.name} ${this.deleteSites.name}`, error);
|
||||
console.error(`${this.constructor.name} ${this.deleteSites.name}`, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +87,7 @@ export class SitesApi {
|
||||
try {
|
||||
return await this.apiService.sites.updateSiteMembership(siteId, userId, siteRole);
|
||||
} catch (error) {
|
||||
logger.error(`SitesApi updateSiteMember : catch : `, error);
|
||||
console.error(`SitesApi updateSiteMember : catch : `, error);
|
||||
return new SiteMemberEntry;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +104,7 @@ export class SitesApi {
|
||||
if (error.status === 409) {
|
||||
return this.updateSiteMember(siteId, userId, role);
|
||||
} else {
|
||||
logger.error(`SitesApi addSiteMember : catch : `, error);
|
||||
console.error(`SitesApi addSiteMember : catch : `, error);
|
||||
return new SiteMemberEntry;
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
import { ApiClientFactory } from './api-client-factory';
|
||||
import { logger } from '@alfresco/adf-cli/scripts/logger';
|
||||
|
||||
export class TrashcanApi {
|
||||
private apiService = new ApiClientFactory();
|
||||
@@ -51,7 +50,7 @@ export class TrashcanApi {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('User Actions - emptyTrashcan failed : ', error);
|
||||
console.error('User Actions - emptyTrashcan failed : ', error);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -37,7 +37,7 @@ export class SidenavComponent extends BaseComponent {
|
||||
private recentFiles = this.getChild(`[data-automation-id='app.navbar.recentFiles']`);
|
||||
private favorites = this.getChild(`[data-automation-id='app.navbar.favorites']`);
|
||||
private trash = this.getChild(`[data-automation-id='app.navbar.trashcan']`);
|
||||
private sidenavToggle = this.getChild(`.sidenav-header-title-logo`);
|
||||
private sidenavToggle = this.getChild(`.aca-sidenav-header-title-logo`);
|
||||
private sidenavExpand = this.page.getByTitle('Expand navigation menu');
|
||||
public expandedSidenav = this.page.locator(`[data-automation-id='expanded']`);
|
||||
|
||||
|
@@ -6,16 +6,14 @@
|
||||
* agreement is prohibited.
|
||||
*/
|
||||
|
||||
import { logger } from '@alfresco/adf-cli/scripts/logger';
|
||||
|
||||
export const getExcludedTestsRegExpArray = (excludedJson: any, projectName: string) => {
|
||||
const prefix = `[ 🎭 Playwright Excludes - ${projectName} ]`;
|
||||
const objectKeys = Object.keys(excludedJson);
|
||||
|
||||
if (!objectKeys.length) {
|
||||
logger.info(`${prefix} ✅ No excluded tests 🎉 `);
|
||||
console.info(`${prefix} ✅ No excluded tests 🎉 `);
|
||||
} else {
|
||||
logger.warn(`${prefix} ❌ Tests excluded because of 🐛 : ${objectKeys}`);
|
||||
console.warn(`${prefix} ❌ Tests excluded because of 🐛 : ${objectKeys}`);
|
||||
}
|
||||
|
||||
return objectKeys.map((key) => new RegExp(key));
|
||||
|
Reference in New Issue
Block a user