mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
AAE-33955 Add placeholder for data table widget (preview) (#10796)
* AAE-33955 Add placeholder for data table widget (preview) * add unit test
This commit is contained in:
parent
6fb9474d46
commit
1f73f7fe40
@ -26,5 +26,6 @@
|
|||||||
|
|
||||||
<ng-template #previewTemplate>
|
<ng-template #previewTemplate>
|
||||||
<adf-datatable data-automation-id="adf-data-table-widget-preview" />
|
<adf-datatable data-automation-id="adf-data-table-widget-preview" />
|
||||||
|
<div class="adf-preview-placeholder"></div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
.adf-data-table-widget-failed-message {
|
.adf-data-table-widget-failed-message {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.adf-preview-placeholder {
|
||||||
|
background-color: var(--adf-theme-mat-grey-color-50);
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
@ -237,6 +237,18 @@ describe('DataTableWidgetComponent', () => {
|
|||||||
expect(dataTable).toBeNull();
|
expect(dataTable).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should display data table placeholder if form is in preview state', () => {
|
||||||
|
widget.field = getDataVariable(mockVariableConfig, mockSchemaDefinition, [], mockJsonFormVariable);
|
||||||
|
spyOn(formCloudService, 'getPreviewState').and.returnValue(true);
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
const previewDataTable = getPreview();
|
||||||
|
const dataTablePlaceholder = fixture.nativeElement.querySelector('.adf-preview-placeholder');
|
||||||
|
|
||||||
|
expect(previewDataTable).toBeTruthy();
|
||||||
|
expect(dataTablePlaceholder).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
describe('should NOT display error message if', () => {
|
describe('should NOT display error message if', () => {
|
||||||
it('form is in preview state', () => {
|
it('form is in preview state', () => {
|
||||||
widget.field = getDataVariable(mockVariableConfig, mockSchemaDefinition, [], mockJsonFormVariableWithIncompleteData);
|
widget.field = getDataVariable(mockVariableConfig, mockSchemaDefinition, [], mockJsonFormVariableWithIncompleteData);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user