Skip to content

Commit

Permalink
fixed display of users list in group panel
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed Oct 4, 2023
1 parent 3942d4d commit ef5b546
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.logicaldoc.gui.common.client.data.UsersDS;
import com.logicaldoc.gui.common.client.formatters.UserCellFormatter;
import com.logicaldoc.gui.common.client.i18n.I18N;
import com.logicaldoc.gui.common.client.log.GuiLog;
import com.logicaldoc.gui.common.client.services.SecurityService;
Expand Down Expand Up @@ -61,32 +62,38 @@ public void onDraw() {

ListGridField username = new ListGridField(USERNAME, I18N.message(USERNAME), 100);
username.setCanFilter(true);
username.setCellFormatter(new UserCellFormatter());

ListGridField name = new ListGridField("name", I18N.message("lastname"), 100);
name.setCanFilter(true);
name.setCellFormatter(new UserCellFormatter());

ListGridField firstName = new ListGridField(FIRST_NAME, I18N.message("firstname"), 100);
firstName.setCanFilter(true);
firstName.setCellFormatter(new UserCellFormatter());

ListGridField phone = new ListGridField(PHONE, I18N.message(PHONE), 90);
phone.setCanFilter(true);
phone.setCellFormatter(new UserCellFormatter());

ListGridField cell = new ListGridField("cell", I18N.message("cell"), 90);
cell.setCanFilter(true);
cell.setCellFormatter(new UserCellFormatter());

ListGridField email = new ListGridField(EMAIL, I18N.message(EMAIL), 200);
email.setCanFilter(true);

ListGridField eenabled = new ListGridField(EENABLED, " ", 24);
eenabled.setType(ListGridFieldType.IMAGE);
eenabled.setCanSort(false);
eenabled.setAlign(Alignment.CENTER);
eenabled.setShowDefaultContextMenu(false);
eenabled.setImageURLPrefix(Util.imagePrefix());
eenabled.setImageURLSuffix(".gif");
eenabled.setCanFilter(false);

ListGridField enabled = new ListGridField("_enabled", I18N.message("enabled"), 55);
email.setCellFormatter(new UserCellFormatter());

ListGridField enabledIcon = new ListGridField("enabledIcon", " ", 24);
enabledIcon.setType(ListGridFieldType.IMAGE);
enabledIcon.setCanSort(false);
enabledIcon.setAlign(Alignment.CENTER);
enabledIcon.setShowDefaultContextMenu(false);
enabledIcon.setImageURLPrefix(Util.imagePrefix());
enabledIcon.setImageURLSuffix(".gif");
enabledIcon.setCanFilter(false);

ListGridField enabled = new ListGridField(EENABLED, I18N.message("enabled"), 55);
enabled.setCanFilter(true);
enabled.setHidden(true);

Expand All @@ -104,7 +111,7 @@ public void onDraw() {
list.setFilterOnKeypress(true);
list.setShowFilterEditor(true);
list.setDataSource(UsersDS.get(groupId));
list.setFields(id, eenabled, avatar, username, firstName, name, email, cell, phone, enabled, guest);
list.setFields(id, enabledIcon, avatar, username, firstName, name, email, cell, phone, enabled, guest, enabled);

HLayout buttons = new HLayout();
buttons.setHeight(25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ private void onDoubleClick() {

MenuItem delete = new MenuItem();
delete.setTitle(I18N.message("ddelete"));
delete.addClickHandler(click ->
LD.ask(I18N.message("ddelete"), I18N.message("confirmdelete"), (Boolean answer) -> {
if (Boolean.TRUE.equals(answer))
delete();
}));
delete.addClickHandler(
click -> LD.ask(I18N.message("ddelete"), I18N.message("confirmdelete"), (Boolean answer) -> {
if (Boolean.TRUE.equals(answer))
delete();
}));

MenuItem makeStart = new MenuItem();
makeStart.setTitle(I18N.message("startstate"));
Expand Down Expand Up @@ -163,14 +163,11 @@ public void update() {

private void edit() {
if (isTask() || isEnd()) {
TaskEditor dialog = new TaskEditor(StateWidget.this);
dialog.show();
new TaskEditor(StateWidget.this).show();
} else if (isJoin() || isFork()) {
StatusDialog dialog = new StatusDialog(StateWidget.this);
dialog.show();
new StatusDialog(StateWidget.this).show();
} else {
TransitionEditor dialog = new TransitionEditor(StateWidget.this);
dialog.show();
new TransitionEditor(StateWidget.this).show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ private void onSave() {
if (Boolean.FALSE.equals(vm.validate()) && humanInteraction)
return;

TaskEditor.this.state.setName((String) values.get("taskName"));
// Remove the ' because of the WF engine would go in error saving into the DB
TaskEditor.this.state.setName(values.get("taskName").toString().trim().replace("'", ""));
TaskEditor.this.state.setDisplay((String) values.get("taskColor"));
TaskEditor.this.state.setDescription((String) values.get("taskDescr"));
TaskEditor.this.state.setOnCreation((String) values.get("onCreation"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.smartgwt.client.types.TitleOrientation;
import com.smartgwt.client.widgets.HeaderControl;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.TextAreaItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
Expand All @@ -26,7 +25,7 @@ public class TransitionEditor extends Window {
public TransitionEditor(StateWidget widget) {
this.widget = widget;

HeaderControl closeIcon = new HeaderControl(HeaderControl.CLOSE, (ClickEvent event) -> destroy());
HeaderControl closeIcon = new HeaderControl(HeaderControl.CLOSE, event -> destroy());

setHeaderControls(HeaderControls.HEADER_LABEL, closeIcon);
setTitle(I18N.message("editworkflowstate", I18N.message("transition")));
Expand Down Expand Up @@ -61,18 +60,22 @@ public TransitionEditor(StateWidget widget) {

ToolStripButton save = new ToolStripButton();
save.setTitle(I18N.message("save"));
save.addClickHandler((com.smartgwt.client.widgets.events.ClickEvent event) -> {
save.addClickHandler(event -> {
if (Boolean.TRUE.equals(name.validate())) {
TransitionEditor.this.widget.getTransition().setText(name.getValue().toString().trim());
TransitionEditor.this.widget.setContents(name.getValue().toString().trim());
String transitionName = name.getValue().toString().trim().replace("'", "");

// Remove the ' because of the WF engine would go in error
// saving into the DB
TransitionEditor.this.widget.getTransition().setText(transitionName);
TransitionEditor.this.widget.setContents(transitionName);
TransitionEditor.this.widget.getTransition().setOnChosen(automationForm.getValueAsString("automation"));
destroy();
}
});

ToolStripButton close = new ToolStripButton();
close.setTitle(I18N.message("close"));
close.addClickHandler((com.smartgwt.client.widgets.events.ClickEvent event) -> destroy());
close.addClickHandler(event -> destroy());

toolStrip.addFormItem(name);
toolStrip.addButton(save);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public WorkflowUploader(WorkflowDesigner designer) {
setCanDragResize(true);
setIsModal(true);
setShowModalMask(true);
setMinWidth(400);
setMinHeight(180);
setWidth(400);
setHeight(180);
centerInPage();

layout.setMembersMargin(2);
Expand Down

0 comments on commit ef5b546

Please sign in to comment.