use of de.symeda.sormas.api.labmessage.LabMessageStatus in project SORMAS-Project by hzi-braunschweig.
the class LabMessagesView method updateStatusButtons.
private void updateStatusButtons() {
statusButtons.keySet().forEach(b -> {
CssStyles.style(b, CssStyles.BUTTON_FILTER_LIGHT);
b.setCaption(statusButtons.get(b));
if (b.getData() == criteria.getLabMessageStatus()) {
activeStatusButton = b;
}
});
if (activeStatusButton != null) {
CssStyles.removeStyles(activeStatusButton, CssStyles.BUTTON_FILTER_LIGHT);
activeStatusButton.setCaption(statusButtons.get(activeStatusButton) + LayoutUtil.spanCss(CssStyles.BADGE, String.valueOf(grid.getItemCount())));
}
LabMessageStatus activeStatus = (LabMessageStatus) activeStatusButton.getData();
grid.updateProcessColumnVisibility(activeStatus == null || activeStatus.isProcessable());
}
use of de.symeda.sormas.api.labmessage.LabMessageStatus in project SORMAS-Project by hzi-braunschweig.
the class LabMessageServiceUnitTest method testBuildCriteriaFilter.
@Test
public void testBuildCriteriaFilter() {
LabMessageService sut = new LabMessageService();
LabMessageStatus status = LabMessageStatus.PROCESSED;
when(criteria.getLabMessageStatus()).thenReturn(status);
when(labMessage.get(LabMessage.STATUS)).thenReturn(objectPath);
when(cb.equal(objectPath, status)).thenReturn(predicate);
Predicate result = sut.buildCriteriaFilter(cb, labMessage, criteria);
assertEquals(predicate, result);
}
Aggregations