Search in sources :

Example 56 with SafeHtml

use of com.google.gwt.safehtml.shared.SafeHtml in project drools-wb by kiegroup.

the class AuditLogEntryCellHelperTest method getSafeHtml_ActionSetField.

@Test
public void getSafeHtml_ActionSetField() {
    ActionSetFieldCol52 originalColumn = new ActionSetFieldCol52();
    originalColumn.setBoundName("bind1");
    originalColumn.setFactField("field1");
    originalColumn.setUpdate(false);
    originalColumn.setValueList("q,w,e");
    originalColumn.setHeader("action1");
    originalColumn.setHideColumn(false);
    originalColumn.setDefaultValue(new DTCellValue52("def1"));
    ActionSetFieldCol52 newColumn = new ActionSetFieldCol52();
    newColumn.setBoundName("bind2");
    newColumn.setFactField("field2");
    newColumn.setUpdate(true);
    newColumn.setValueList("a,s,d");
    newColumn.setHeader("action2");
    newColumn.setHideColumn(true);
    newColumn.setDefaultValue(new DTCellValue52("def2"));
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    assertEquals(getActionHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
Also used : UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) LimitedEntryActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionSetFieldCol52) Test(org.junit.Test)

Example 57 with SafeHtml

use of com.google.gwt.safehtml.shared.SafeHtml in project drools-wb by kiegroup.

the class AuditLogEntryCellHelperTest method getSafeHtml_BrlCondition_DefinitionOnly.

@Test
public void getSafeHtml_BrlCondition_DefinitionOnly() {
    BRLConditionColumn originalColumn = new BRLConditionColumn();
    originalColumn.setDefinition(Arrays.asList(new FactPattern("FactType1")));
    originalColumn.setHeader("condition");
    originalColumn.setHideColumn(false);
    BRLConditionColumn newColumn = new BRLConditionColumn();
    originalColumn.setDefinition(Arrays.asList(new FactPattern("FactType2"), new FactPattern("FactType3")));
    newColumn.setHeader("condition");
    newColumn.setHideColumn(false);
    List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
    SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
    // Definition diffs are currently not supported, maybe #soon?
    // assertEquals(getHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
    assertEquals(getHeaderRepre(newColumn.getHeader()) + getDiffRepre(new ArrayList<>()), result.asString());
}
Also used : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) FactPattern(org.drools.workbench.models.datamodel.rule.FactPattern) Test(org.junit.Test)

Aggregations

SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)57 Test (org.junit.Test)29 UpdateColumnAuditLogEntry (org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry)14 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)14 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)10 Column (com.google.gwt.user.cellview.client.Column)8 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)7 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)6 ConfirmDialog (org.eclipse.che.ide.api.dialogs.ConfirmDialog)6 ImageResource (com.google.gwt.resources.client.ImageResource)5 Cell (com.google.gwt.cell.client.Cell)4 Element (com.google.gwt.dom.client.Element)4 Image (com.google.gwt.user.client.ui.Image)4 ConfirmCallback (org.eclipse.che.ide.api.dialogs.ConfirmCallback)4 ClickableTextCell (com.google.gwt.cell.client.ClickableTextCell)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 ListHandler (com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler)3 TextColumn (com.google.gwt.user.cellview.client.TextColumn)3 Application (cz.metacentrum.perun.webgui.model.Application)3 CustomClickableTextCell (cz.metacentrum.perun.webgui.widgets.cells.CustomClickableTextCell)3