[ADF-5366] initialize discovery and version compatibility service for oauth based session (#6864)

* [ADF-5366] initialize discovery and version compatibility service for oauth based session

* better error message

* * fix spaces

* * revert the search service

* * fix build

* * check properties after type update

* * check properties after type update

* * check properties after type update

* * fix infinite loop

* * fix test without title

* * wait for options

* * wait for session

* Update metadata-content-type.e2e.ts

* Update metadata-content-type.e2e.ts

* Update protractor.excludes.json

* Update protractor.excludes.json
This commit is contained in:
Dharan
2021-04-29 18:10:49 +05:30
committed by GitHub
parent c0b5935b43
commit 8b5e45f4eb
28 changed files with 532 additions and 345 deletions

View File

@@ -15,17 +15,18 @@
* limitations under the License.
*/
import { CustomModel, CustomModelApi, CustomModelProperty, CustomType, TypePaging, TypesApi } from '@alfresco/js-api';
import { ApiService } from '../../core/actions/api.service';
import { CustomModel, CustomModelApi, CustomType, TypePaging, TypesApi } from '@alfresco/js-api';
import { ApiUtil } from '../../core/actions/api.util';
import { Logger } from '../../core/utils/logger';
export class ModelActions {
customModelApi: CustomModelApi;
typesApi: TypesApi;
constructor(api: ApiService) {
this.customModelApi = new CustomModelApi(api.getInstance());
this.typesApi = new TypesApi(api.getInstance());
constructor(apiService: ApiService) {
this.customModelApi = new CustomModelApi(apiService.getInstance());
this.typesApi = new TypesApi(apiService.getInstance());
}
async createModel({status, description, name, namespaceUri, namespacePrefix, author}: CustomModel): Promise<{ entry: CustomModel }> {
@@ -36,6 +37,10 @@ export class ModelActions {
return this.customModelApi.createCustomType(modelName, name, parentName, title, description);
}
async addPropertyToType(modelName: string, typeName: string, properties?: CustomModelProperty[]): Promise<CustomType> {
return this.customModelApi.addPropertyToType(modelName , typeName, properties);
}
async activateCustomModel(modelName: string): Promise<{ entry: CustomModel }> {
return this.customModelApi.activateCustomModel(modelName);
}
@@ -44,7 +49,25 @@ export class ModelActions {
return this.customModelApi.deactivateCustomModel(modelName);
}
async deleteCustomModel(modelName: string): Promise<{ entry: CustomModel }> {
return this.customModelApi.deleteCustomModel(modelName);
}
async listTypes(opts?: any): Promise<TypePaging> {
return this.typesApi.listTypes(opts);
}
async isCustomTypeSearchable(title: string): Promise<any> {
const predicate = (result: TypePaging) => !!result.list.entries.find(({entry}) => entry.title === title);
const apiCall = async () => {
try {
return this.listTypes({where: `(not namespaceUri matches('http://www.alfresco.*'))`});
} catch (error) {
Logger.error('Failed to list types', error);
return null;
}
};
return ApiUtil.waitForApi(apiCall, predicate);
}
}

View File

@@ -20,6 +20,7 @@ import { BrowserActions } from '../../core/utils/browser-actions';
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { DropdownPage } from '../../core/pages/material/dropdown.page';
import { TestElement } from '../../core/test-element';
const column = {
role: 'Role'
@@ -102,10 +103,10 @@ export class AddPermissionsDialogPage {
await BrowserActions.click(this.addButton);
}
async selectRole(name: string, role) {
async selectRole(name: string, role: string) {
const row = this.userRoleDataTableComponentPage.getRow('Users and Groups', name);
await BrowserActions.click(row.element(by.css('[id="adf-select-role-permission"] .mat-select-trigger')));
await this.getRoleDropdownOptions();
await TestElement.byCss('.mat-select-panel').waitVisible();
await this.selectOption(role);
}
}