mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACA-2874] improve the execution time of actions-available tests (#1307)
* some refactoring trying to improve the execution time of actions-available tests * copyright update
This commit is contained in:
committed by
Cilibiu Bogdan
parent
66f9442563
commit
fb6ba7cf6a
@@ -2,7 +2,7 @@
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -27,6 +27,11 @@ import { RepoClient, NodeContentTree } from './repo-client/repo-client';
|
||||
import { PersonEntry, NodeEntry } from '@alfresco/js-api';
|
||||
import { PersonModel } from './repo-client/apis/people/people-api-models';
|
||||
|
||||
import { SitesApi } from './repo-client/apis/sites/sites-api';
|
||||
import { UploadApi } from './repo-client/apis/upload/upload-api';
|
||||
import { NodesApi } from './repo-client/apis/nodes/nodes-api';
|
||||
import { FavoritesApi } from './repo-client/apis/favorites/favorites-api';
|
||||
|
||||
export class AdminActions {
|
||||
private adminApi: RepoClient;
|
||||
|
||||
@@ -34,6 +39,11 @@ export class AdminActions {
|
||||
this.adminApi = new RepoClient();
|
||||
}
|
||||
|
||||
sites: SitesApi = new SitesApi();
|
||||
upload: UploadApi = new UploadApi();
|
||||
nodes: NodesApi = new NodesApi();
|
||||
favorites: FavoritesApi = new FavoritesApi();
|
||||
|
||||
async getDataDictionaryId(): Promise<string> {
|
||||
return await this.adminApi.nodes.getNodeIdFromParent('Data Dictionary', '-root-');
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
*/
|
||||
|
||||
import { RepoApi } from '../repo-api';
|
||||
import { SiteBody, SiteMemberRoleBody, SiteMemberBody, SiteEntry, SiteMembershipRequestEntry, SitesApi as AdfSiteApi } from '@alfresco/js-api';
|
||||
import { SITE_VISIBILITY } from '../../../../configs';
|
||||
import { SiteBody, SiteMemberRoleBody, SiteMemberBody, SiteEntry, SiteMembershipRequestEntry, SitesApi as AdfSiteApi, SiteMemberEntry } from '@alfresco/js-api';
|
||||
import { SITE_VISIBILITY, SITE_ROLES } from '../../../../configs';
|
||||
import { Utils } from '../../../../utilities/utils';
|
||||
|
||||
export class SitesApi extends RepoApi {
|
||||
@@ -112,6 +112,14 @@ export class SitesApi extends RepoApi {
|
||||
}
|
||||
}
|
||||
|
||||
async createSitePrivate(title: string, description?: string, siteId?: string): Promise<SiteEntry> {
|
||||
return this.createSite(title, SITE_VISIBILITY.PRIVATE, description, siteId);
|
||||
}
|
||||
|
||||
async createSiteModerated(title: string, description?: string, siteId?: string): Promise<SiteEntry> {
|
||||
return this.createSite(title, SITE_VISIBILITY.MODERATED, description, siteId);
|
||||
}
|
||||
|
||||
async createSites(titles: string[], visibility?: string) {
|
||||
try {
|
||||
return titles.reduce(async (previous: any, current: any) => {
|
||||
@@ -185,6 +193,22 @@ export class SitesApi extends RepoApi {
|
||||
}
|
||||
}
|
||||
|
||||
async addSiteConsumer(siteId: string, userId: string): Promise<SiteMemberEntry> {
|
||||
return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
}
|
||||
|
||||
async addSiteContributor(siteId: string, userId: string): Promise<SiteMemberEntry> {
|
||||
return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
}
|
||||
|
||||
async addSiteCollaborator(siteId: string, userId: string): Promise<SiteMemberEntry> {
|
||||
return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
}
|
||||
|
||||
async addSiteManager(siteId: string, userId: string): Promise<SiteMemberEntry> {
|
||||
return this.addSiteMember(siteId, userId, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
}
|
||||
|
||||
async deleteSiteMember(siteId: string, userId: string) {
|
||||
try {
|
||||
await this.apiAuth();
|
||||
|
||||
@@ -48,7 +48,7 @@ export class RepoClient {
|
||||
return { username, password };
|
||||
}
|
||||
|
||||
get people () {
|
||||
get people() {
|
||||
return new PeopleApi(this.auth.username, this.auth.password);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user