[ADF-1822] Process header - Should show the businessKey property (#2549)

* Add the businessKey in the process header

* Add unit test
This commit is contained in:
Maurizio Vitale 2017-10-26 15:28:07 +02:00 committed by Eugenio Romano
parent 2588bbda7d
commit cb50ab7e6a
3 changed files with 25 additions and 0 deletions

View File

@ -151,4 +151,20 @@ describe('ProcessInstanceHeaderComponent', () => {
let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]'); let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]');
expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.DESCRIPTION_DEFAULT'); expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.DESCRIPTION_DEFAULT');
}); });
it('should display businessKey value', () => {
component.processInstance.businessKey = 'fakeBusinessKey';
component.ngOnChanges({});
fixture.detectChanges();
let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]');
expect(valueEl.innerText).toBe('fakeBusinessKey');
});
it('should display default key if no businessKey', () => {
component.processInstance.businessKey = null;
component.ngOnChanges({});
fixture.detectChanges();
let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]');
expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.BUSINESS_KEY_DEFAULT');
});
}); });

View File

@ -59,6 +59,13 @@ export class ProcessInstanceHeaderComponent implements OnChanges {
key: 'category', key: 'category',
default: 'ADF_PROCESS_LIST.PROPERTIES.CATEGORY_DEFAULT' default: 'ADF_PROCESS_LIST.PROPERTIES.CATEGORY_DEFAULT'
}), }),
new CardViewTextItemModel(
{
label: 'ADF_PROCESS_LIST.PROPERTIES.BUSINESS_KEY',
value: this.processInstance.businessKey,
key: 'businessKey',
default: 'ADF_PROCESS_LIST.PROPERTIES.BUSINESS_KEY_DEFAULT'
}),
new CardViewTextItemModel( new CardViewTextItemModel(
{ {
label: 'ADF_PROCESS_LIST.PROPERTIES.CREATED_BY', label: 'ADF_PROCESS_LIST.PROPERTIES.CREATED_BY',

View File

@ -21,6 +21,8 @@
"CREATED_BY": "Created By", "CREATED_BY": "Created By",
"CREATED_BY_DEFAULT": "No assignee", "CREATED_BY_DEFAULT": "No assignee",
"CREATED": "Created", "CREATED": "Created",
"BUSINESS_KEY": "Business key",
"BUSINESS_KEY_DEFAULT": "None",
"DESCRIPTION": "Description", "DESCRIPTION": "Description",
"DESCRIPTION_DEFAULT": "No description", "DESCRIPTION_DEFAULT": "No description",
"ID": "Id" "ID": "Id"