mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[AAE-9200] - Be able to customise task/process list and header date f… (#7711)
* [AAE-9200] - Be able to customise task/process list and header date formats * Update json schema * Revert schema changes * Update task and process name translation values * move task/process header date formats inside header config * Add documentation * Update documentation * Use a fixed timezone for unit tests of core and cloud * Fix e2e due to column rename * More e2e fixes due to column rename, remove test covered by unit test
This commit is contained in:
@@ -23,11 +23,11 @@ export class ProcessDetailsCloudDemoPage {
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||
|
||||
async checkTaskIsDisplayed(taskName: string): Promise<void> {
|
||||
await this.dataTable.checkContentIsDisplayed('Name', taskName);
|
||||
await this.dataTable.checkContentIsDisplayed('Task Name', taskName);
|
||||
}
|
||||
|
||||
async selectProcessTaskByName(taskName: string): Promise<void> {
|
||||
await this.dataTable.selectRow('Name', taskName);
|
||||
await this.dataTable.selectRow('Task Name', taskName);
|
||||
}
|
||||
|
||||
async checkListedSelectedProcessInstance(processInstanceId: string): Promise<void> {
|
||||
|
||||
@@ -156,11 +156,11 @@ describe('Process list cloud', () => {
|
||||
await setFilter({ sort: 'Name' });
|
||||
await setFilter({ order: SORT_DIRECTION.ASC });
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Name')).toBe(true);
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Process Name')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Name')).toBe(true);
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Process Name')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C291783] Should display processes ordered by id when Id is selected from sort dropdown', async () => {
|
||||
|
||||
@@ -266,7 +266,7 @@ describe('Start Task Form', () => {
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(startEventFormProcess);
|
||||
|
||||
await processList.getDataTable().selectRow('Name', startEventFormProcess);
|
||||
await processList.getDataTable().selectRow('Process Name', startEventFormProcess);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
|
||||
await processDetailsCloudDemoPage.checkTaskIsDisplayed('StartEventFormTask');
|
||||
|
||||
@@ -20,7 +20,6 @@ import { createApiService,
|
||||
AppListCloudPage,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
TaskHeaderCloudPage,
|
||||
@@ -68,7 +67,6 @@ describe('Task Header cloud component', () => {
|
||||
let subTask: any;
|
||||
let subTaskCreatedDate: string;
|
||||
let completedEndDate: string;
|
||||
let defaultDate: string;
|
||||
let groupInfo: any;
|
||||
let testUser: any;
|
||||
let unclaimedTask: any;
|
||||
@@ -76,7 +74,6 @@ describe('Task Header cloud component', () => {
|
||||
const description = 'descriptionTask';
|
||||
const formatDate = 'MMM D, YYYY';
|
||||
const dateTimeFormat = 'MMM D, Y, H:mm';
|
||||
const defaultFormat = 'M/D/YY';
|
||||
|
||||
const createCompletedTask = async function () {
|
||||
const completedTaskId = await tasksService.createStandaloneTask(completedTaskName,
|
||||
@@ -117,7 +114,6 @@ describe('Task Header cloud component', () => {
|
||||
completedCreatedDate = moment(completedTask.entry.createdDate).format(formatDate);
|
||||
dueDate = moment(completedTask.entry.dueDate).format(dateTimeFormat);
|
||||
completedEndDate = moment(completedTask.entry.endDate).format(formatDate);
|
||||
defaultDate = moment(completedTask.entry.createdDate).format(defaultFormat);
|
||||
|
||||
subTask = await createSubTask(createdTaskId);
|
||||
subTaskCreatedDate = moment(subTask.entry.createdDate).format(formatDate);
|
||||
@@ -241,29 +237,4 @@ describe('Task Header cloud component', () => {
|
||||
await peopleCloudComponentPage.searchAssignee('modeler');
|
||||
await peopleCloudComponentPage.checkNoResultsFoundError();
|
||||
});
|
||||
|
||||
describe('Default Date format', () => {
|
||||
beforeEach(async () => {
|
||||
await LocalStorageUtil.setConfigField('dateValues', '{' +
|
||||
'"defaultDateFormat": "shortDate",' +
|
||||
'"defaultDateTimeFormat": "M/d/yy, h:mm a",' +
|
||||
'"defaultLocale": "uk"' +
|
||||
'}');
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
});
|
||||
|
||||
it('[C311280] Should pick up the default date format from the app configuration', async () => {
|
||||
await taskFilter.clickTaskFilter('completed-tasks');
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await taskList.checkContentIsDisplayedByName(completedTaskName);
|
||||
await taskList.selectRow(completedTaskName);
|
||||
await tasksCloudDemoPage.waitTillContentLoaded();
|
||||
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getCreated()).toEqual(defaultDate);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -142,10 +142,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('name');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Name')).toBe(true);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Task Name')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Name')).toBe(true);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Task Name')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C290156] Should display tasks ordered by id when Id is selected from sort dropdown', async () => {
|
||||
|
||||
Reference in New Issue
Block a user