Search in sources :

Example 1 with LabMessageStatus

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());
}
Also used : LabMessageStatus(de.symeda.sormas.api.labmessage.LabMessageStatus)

Example 2 with LabMessageStatus

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);
}
Also used : LabMessageStatus(de.symeda.sormas.api.labmessage.LabMessageStatus) Predicate(javax.persistence.criteria.Predicate) Test(org.junit.Test)

Aggregations

LabMessageStatus (de.symeda.sormas.api.labmessage.LabMessageStatus)2 Predicate (javax.persistence.criteria.Predicate)1 Test (org.junit.Test)1