mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4572] Display value widget display issue when it has no value (#4943)
* [ADF-4572] Display value widget display issue when it has no value * Added readonly type to form-render * Added unit test case * * Fixed ee test * * Updating tests to return textWidget for display value * * Making changes to displayValueWidget css selector * * Updated case to check display value from api
This commit is contained in:
@@ -20,7 +20,8 @@ import {
|
||||
FormFieldModel,
|
||||
FormFieldTypes,
|
||||
UnknownWidgetComponent,
|
||||
UploadWidgetComponent
|
||||
UploadWidgetComponent,
|
||||
TextWidgetComponent
|
||||
} from './../components/widgets/index';
|
||||
import { FormRenderingService } from './form-rendering.service';
|
||||
|
||||
@@ -55,6 +56,12 @@ describe('FormRenderingService', () => {
|
||||
expect(type).toBe(UnknownWidgetComponent);
|
||||
});
|
||||
|
||||
it('should resolve Text widget for readonly field type', () => {
|
||||
const resolver = service.getComponentTypeResolver('readonly');
|
||||
const type = resolver(null);
|
||||
expect(type).toBe(TextWidgetComponent);
|
||||
});
|
||||
|
||||
it('should fallback to default resolver when field type missing', () => {
|
||||
const resolver = service.getComponentTypeResolver(null);
|
||||
const type = resolver(null);
|
||||
|
@@ -58,6 +58,7 @@ export class FormRenderingService extends DynamicComponentMapper {
|
||||
'radio-buttons': DynamicComponentResolver.fromType(RadioButtonsWidgetComponent),
|
||||
'hyperlink': DynamicComponentResolver.fromType(HyperlinkWidgetComponent),
|
||||
'readonly-text': DynamicComponentResolver.fromType(DisplayTextWidgetComponentComponent),
|
||||
'readonly': DynamicComponentResolver.fromType(TextWidgetComponent),
|
||||
'typeahead': DynamicComponentResolver.fromType(TypeaheadWidgetComponent),
|
||||
'people': DynamicComponentResolver.fromType(PeopleWidgetComponent),
|
||||
'functional-group': DynamicComponentResolver.fromType(FunctionalGroupWidgetComponent),
|
||||
|
Reference in New Issue
Block a user