[ADF-4096] ProcessCloud/TaskList - undefined filename attribute (#4333)

* [ADF-4127] ProcessServicesCloud - add claim/unclaim directive (#4464)

* [ADF-4127] ProessServicesCloud - claim task directive

* [ADF-4127] - fix doc

* [ADF-4127] - revert docs changes

* [ADF-4127] - revert doc changes

* [ADF-4127] - fix doc and reset sourceLinker.js

* [ADF-4127] - refractor task-cloud.service. add validation for claim/unclaim and fix unit tests

* [ADF-4127] - fix docs files

* [ADF-4127[ - add aditional complete task validation

* [ADF-4127] - PR changes

* [ADF-4127] - complete docs file

* [ADF-4127] - more PR changes

* [ADF-4127] - change Unclaim task name and wait for task to be claimed and unclaimed before emit the success event

* [ADF-4127] - fix unit tests

* [ADF-4095] ProcessCloud - change api response format

* Revert "[ADF-4095] ProcessCloud - change api response format"

This reverts commit 8ddd3477ad3de047911f0538941c65d2bf7e60e2.

* [ADF-4096] DatatableComponent - revert changes and remove filename attribute

* [ADF-4096] - change filename attribute and fix unit tests

* [ADF-4096] - fix core e2e test
This commit is contained in:
Silviu Popa 2019-03-25 18:23:04 +02:00 committed by Eugenio Romano
parent e415bd8cd5
commit c3bbbe6dab
9 changed files with 86 additions and 27 deletions

View File

@ -0,0 +1,26 @@
---
Title: Claim Task Directive
Added: v3.1.0
Status: Experimental
Last reviewed: 2019-03-05
---
# [Claim task directive](../../lib/process-services-cloud/src/lib/task/directives/claim-task.directive.ts "Defined in claim-task.directive.ts")
Claim a task
## Basic Usage
```html
<button adf-claim-task [appName]="appName" [taskId]="taskId" (success)="onTaskClaimed()">Complete</button>
```
## Class members
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| taskId | `string` | empty |(Required) The id of the task. |
| appName | `string` | empty | (Required) The name of the application. |
| success | `EventEmitter<any>` | empty | Emitted when the task is completed. |
| error | `EventEmitter<any>` | empty | Emitted when the task cannot be completed. |

View File

@ -0,0 +1,26 @@
---
Title: Unclaim Task Directive
Added: v3.1.0
Status: Experimental
Last reviewed: 2019-03-05
---
# [Unclaim task directive](../../lib/process-services-cloud/src/lib/task/directives/unclaim-task.directive.ts "Defined in unclaim-task.directive.ts")
Unclaim a task
## Basic Usage
```html
<button adf-unclaim-task [appName]="appName" [taskId]="taskId" (success)="onTaskUnclaimed()">Complete</button>
```
## Class members
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| taskId | `string` | empty |(Required) The id of the task. |
| appName | `string` | empty | (Required) The name of the application. |
| success | `EventEmitter<any>` | empty | Emitted when the task is completed. |
| error | `EventEmitter<any>` | empty | Emitted when the task cannot be completed. |

View File

@ -544,7 +544,7 @@ export class ContentServicesPage {
}
checkLockIsDisplayedForElement(name) {
const lockButton = element(by.css(`div.adf-datatable-cell[filename="${name}"] button`));
const lockButton = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
Util.waitUntilElementIsVisible(lockButton);
}
@ -553,7 +553,7 @@ export class ContentServicesPage {
}
async getStyleValueForRowText(rowName, styleName) {
const row = element(by.css(`div.adf-datatable-cell[filename="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
const row = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
Util.waitUntilElementIsVisible(row);
return row.getCssValue(styleName);
}
@ -577,7 +577,7 @@ export class ContentServicesPage {
}
checkIconForRowIsDisplayed(fileName) {
const iconRow = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${fileName}"] img`));
const iconRow = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
Util.waitUntilElementIsVisible(iconRow);
return iconRow;
}
@ -607,17 +607,17 @@ export class ContentServicesPage {
}
getDocumentCardIconForElement(elementName) {
const elementIcon = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"] img`));
const elementIcon = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
return elementIcon.getAttribute('src');
}
checkDocumentCardPropertyIsShowed(elementName, propertyName) {
const elementProperty = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"][title="${propertyName}"]`));
const elementProperty = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
Util.waitUntilElementIsVisible(elementProperty);
}
getAttributeValueForElement(elementName, propertyName) {
const elementSize = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"][title="${propertyName}"] span`));
const elementSize = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`));
return elementSize.getText();
}
@ -627,9 +627,9 @@ export class ContentServicesPage {
}
navigateToCardFolder(folderName) {
const folderCard = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[filename="${folderName}"]`));
let folderCard = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
folderCard.click();
const folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[filename="${folderName}"].adf-datatable-cell--image`));
let folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`));
Util.waitUntilElementIsVisible(folderSelected);
browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
@ -659,7 +659,7 @@ export class ContentServicesPage {
}
clickContentNodeSelectorResult(name) {
const resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[filename="${name}"`)).first();
const resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[data-automation-id="${name}"`)).first();
Util.waitUntilElementIsVisible(resultElement);
resultElement.click();
}

View File

@ -43,7 +43,7 @@ export class AttachmentListPage {
}
checkFileIsAttached(name) {
const fileAttached = element.all(by.css('div[filename="' + name + '"]')).first();
const fileAttached = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
Util.waitUntilElementIsVisible(fileAttached);
}
@ -52,8 +52,8 @@ export class AttachmentListPage {
}
viewFile(name) {
Util.waitUntilElementIsVisible(element.all(by.css('div[filename="' + name + '"]')).first());
element.all(by.css('div[filename="' + name + '"]')).first().click();
Util.waitUntilElementIsVisible(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
element.all(by.css('div[data-automation-id="' + name + '"]')).first().click();
Util.waitUntilElementIsVisible(this.buttonMenu);
this.buttonMenu.click();
Util.waitUntilElementIsVisible(this.viewButton);
@ -64,8 +64,8 @@ export class AttachmentListPage {
}
removeFile(name) {
Util.waitUntilElementIsVisible(element.all(by.css('div[filename="' + name + '"]')).first());
element.all(by.css('div[filename="' + name + '"]')).first().click();
Util.waitUntilElementIsVisible(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
element.all(by.css('div[data-automation-id="' + name + '"]')).first().click();
Util.waitUntilElementIsVisible(this.buttonMenu);
this.buttonMenu.click();
Util.waitUntilElementIsVisible(this.removeButton);
@ -76,8 +76,8 @@ export class AttachmentListPage {
}
downloadFile(name) {
Util.waitUntilElementIsVisible(element.all(by.css('div[filename="' + name + '"]')).first());
element.all(by.css('div[filename="' + name + '"]')).first().click();
Util.waitUntilElementIsVisible(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
element.all(by.css('div[data-automation-id="' + name + '"]')).first().click();
Util.waitUntilElementIsVisible(this.buttonMenu);
this.buttonMenu.click();
Util.waitUntilElementIsVisible(this.downloadButton);
@ -87,8 +87,8 @@ export class AttachmentListPage {
}
doubleClickFile(name) {
Util.waitUntilElementIsVisible(element.all(by.css('div[filename="' + name + '"]')).first());
const fileAttached = element.all(by.css('div[filename="' + name + '"]')).first();
Util.waitUntilElementIsVisible(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
const fileAttached = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
Util.waitUntilElementIsVisible(fileAttached);
Util.waitUntilElementIsClickable(fileAttached);
fileAttached.click();
@ -96,7 +96,7 @@ export class AttachmentListPage {
}
checkFileIsRemoved(name) {
const fileAttached = element.all(by.css('div[filename="' + name + '"]')).first();
const fileAttached = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
Util.waitUntilElementIsNotVisible(fileAttached);
return this;
}

View File

@ -103,7 +103,7 @@ export class ViewerPage {
}
viewFile(fileName) {
const fileView = element.all(by.css(`#document-list-container div[filename="${fileName}"]`)).first();
const fileView = element.all(by.css(`#document-list-container div[data-automation-id="${fileName}"]`)).first();
Util.waitUntilElementIsVisible(fileView);
fileView.click();
browser.actions().sendKeys(protractor.Key.ENTER).perform();

View File

@ -90,7 +90,7 @@
role="gridcell"
class=" adf-datatable-cell adf-datatable-cell--{{col.type || 'text'}} {{col.cssClass}}"
[attr.title]="col.title | translate"
[attr.filename]="getFilename(row)"
[attr.data-automation-id]="getAutomationValue(row, col)"
tabindex="0"
(click)="onRowClick(row, $event)"
(keydown.enter)="onEnterKeyPressed(row, $event)"

View File

@ -599,10 +599,6 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
return `${row.cssClass} ${this.rowStyleClass}`;
}
getFilename(row: DataRow): string {
return row.getValue('name');
}
getSortingKey(): string {
if (this.data.getSorting()) {
return this.data.getSorting().key;
@ -694,4 +690,15 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
this.fakeRows = [];
}
}
getNameColumnValue() {
return this.data.getColumns().find( (el: any) => {
return el.key.includes('name');
});
}
getAutomationValue(row: DataRow, col: DataColumn) {
const name = this.getNameColumnValue();
return name ? row.getValue(name.key) : '';
}
}

View File

@ -174,7 +174,7 @@
"ADF_CLOUD_TASK_HEADER": {
"BUTTON": {
"CLAIM": "Claim",
"UNCLAIM": "Requeue"
"UNCLAIM": "Release"
},
"PROPERTIES": {
"TASK_NAME": "Task",

View File

@ -73,7 +73,7 @@
"BUTTON": {
"COMPLETE": "Complete",
"CLAIM": "Claim",
"UNCLAIM": "Requeue",
"UNCLAIM": "Release",
"DRAG-ATTACHMENT": "Drop files to upload",
"UPLOAD-ATTACHMENT": "Upload Attachment"
},