Skip to content

Commit

Permalink
minimal fixes in preparation of 8.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed May 8, 2024
1 parent 512c953 commit 75b2a91
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;

/**
* This panel shows the properties of an attribute set.
Expand Down Expand Up @@ -210,10 +209,11 @@ protected void refresh() {
mandatory.setWidth(50);
mandatory.setDefaultValue(false);
mandatory.setDisabled(attributeSet.isReadonly());
mandatory.setVisible(true);

boolean updatingAttributeIsNotSection = updatingAttributeName == null
|| attributeSet.getAttribute(updatingAttributeName.trim()) == null
|| attributeSet.getAttribute(updatingAttributeName.trim()).getType() != GUIAttribute.TYPE_SECTION;
mandatory.setVisible(updatingAttributeIsNotSection);

// Hidden
final CheckboxItem hidden = new CheckboxItem();
Expand Down Expand Up @@ -290,7 +290,6 @@ protected void refresh() {
validation.setVisibleWhen(visibleCriteria);

type.addChangedHandler(changed -> {
mandatory.setVisible(!changed.getValue().equals("" + GUIAttribute.TYPE_SECTION));
readonly.setVisible(!changed.getValue().equals("" + GUIAttribute.TYPE_SECTION));
hidden.setVisible(!changed.getValue().equals("" + GUIAttribute.TYPE_SECTION));
multiple.setVisible(!changed.getValue().equals("" + GUIAttribute.TYPE_SECTION));
Expand Down Expand Up @@ -751,7 +750,7 @@ public void onSuccess(Void arg0) {
private MenuItem prepareDeleteContextMenuItem() {
MenuItem delete = new MenuItem();
delete.setTitle(I18N.message("ddelete"));
delete.addClickHandler((MenuItemClickEvent deleteClick) -> {
delete.addClickHandler(click -> {
final ListGridRecord[] selection = attributesList.getSelectedRecords();
if (selection == null || selection.length == 0)
return;
Expand Down Expand Up @@ -783,7 +782,6 @@ protected void onChangeSelectedAttribute(Record rec) {
attributeSettingsForm1.setValue(READONLY, extAttr.isReadonly());
attributeSettingsForm1.setValue(MULTIPLE, extAttr.isMultiple());

attributeSettingsForm1.getItem(MANDATORY).setVisible(!extAttr.isSection());
attributeSettingsForm1.getItem(HIDDEN).setVisible(!extAttr.isSection());
attributeSettingsForm1.getItem(READONLY).setVisible(!extAttr.isSection());
attributeSettingsForm1.getItem(MULTIPLE).setVisible(!extAttr.isSection());
Expand Down Expand Up @@ -814,6 +812,11 @@ public void refreshFieldForm() {
options.setVisible(false);
group.setVisible(false);
group.setValue("");
} else if (type.getValueAsString().equals("" + GUIAttribute.TYPE_SECTION)) {
editor.setVisible(false);
options.setVisible(true);
group.setVisible(false);
group.setValue("");
} else {
editor.setVisible(false);
group.setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ public void onSuccess(Void arg0) {
private void onSaveLogger(SelectItem levelSelector, ComboBoxItem loggerSelector) {
String name = loggerSelector.getValueAsString();
if (name != null && !name.isEmpty()) {
boolean additivity = loggerSelector.getSelectedRecord() != null
&& name.equals(loggerSelector.getSelectedRecord().getAttributeAsString("name"))
&& loggerSelector.getSelectedRecord().getAttributeAsBoolean("additivity");
boolean additivity = loggerSelector.getSelectedRecord().getAttributeAsBoolean("additivity", true) == null
|| (loggerSelector.getSelectedRecord() != null
&& name.equals(loggerSelector.getSelectedRecord().getAttributeAsString("name"))
&& loggerSelector.getSelectedRecord().getAttributeAsBoolean("additivity"));
SystemService.Instance.get().saveLogger(name, levelSelector.getValueAsString(), additivity,
new AsyncCallback<Void>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public TaskEditor(StateWidget widget) {
setShowModalMask(true);
setMargin(3);
setWidth(650);
setHeight(600);
centerInPage();

Tab propertiesTab = new Tab(I18N.message("properties"));
Expand All @@ -106,10 +105,13 @@ public TaskEditor(StateWidget widget) {
TabSet tabSet = new TabSet();
tabSet.setWidth100();

if (state.getType() == GUIWFState.TYPE_TASK)
if (state.getType() == GUIWFState.TYPE_TASK) {
tabSet.setTabs(propertiesTab, duedateTab, validationTab, automationTab, messagesTab);
else
setHeight(600);
} else {
tabSet.setTabs(propertiesTab, automationTab, messagesTab);
setHeight(500);
}
addItem(tabSet);

Button save = new Button(I18N.message("save"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,11 @@ public WorkflowDrawingPanel getDrawingPanel() {

/**
* Saves the current diagram into the object model.
*
* @return true if the model is valid
*/
public boolean saveModel() {
public void saveModel() {
// Collect all the states as drawn in the designer.
int i = 0;

workflow.getStates().clear();
for (FunctionShape shape : getDrawingPanel().getDiagramController().getShapes()) {
StateWidget widget = (StateWidget) shape.getWidget();
Expand Down Expand Up @@ -172,7 +171,5 @@ public boolean saveModel() {

srcWidget.getWFState().setTransitions(transitions);
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,13 @@ private void onDeploy() {
boolean taskWithoutTransitionsFound = checkTaskWithoutTransitions();

if (!taskFound)
SC.warn(I18N.message("workflowtaskatleast"));
GuiLog.error(I18N.message("workflowtaskatleast"));
else if (taskWithoutCandidatesFound)
SC.warn(I18N.message("workflowtaskcandidateatleast"));
GuiLog.error(I18N.message("workflowtaskcandidateatleast"));
else if (taskWithoutTransitionsFound)
SC.warn(I18N.message("workflowtransitiontarget"));
GuiLog.error(I18N.message("workflowtransitiontarget"));
else if (currentWorkflow.getStartStateId() == null)
GuiLog.error(I18N.message("atleastoneinitialtask"));
else {
LD.contactingServer();
WorkflowService.Instance.get().deploy(currentWorkflow, new AsyncCallback<>() {
Expand All @@ -270,7 +272,7 @@ private boolean checkTaskWithoutTransitions() {

for (GUIWFState state : currentWorkflow.getStates()) {
if (state.getType() != GUIWFState.TYPE_END) {
if (state.getTransitions() == null) {
if (state.getTransitions() == null || state.getTransitions().isEmpty()) {
transitionErrorFound = true;
break;
}
Expand Down Expand Up @@ -445,14 +447,11 @@ private void update() {

private void onSave() {
try {
if (!designer.saveModel())
return;
designer.saveModel();
} catch (Exception t) {
// Nothing to do
}

currentWorkflow = designer.getWorkflow();

LD.contactingServer();
WorkflowService.Instance.get().save(currentWorkflow, new AsyncCallback<>() {
@Override
Expand Down
25 changes: 13 additions & 12 deletions logicaldoc-i18n/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1185,16 +1185,16 @@ editwithoffice = Edit with Office
addomain = AD domain
unlink = Unlink
preview = Preview
workflowsametarget = The form element already contains the element ''{0}''
workflowsameobject = You cannot add the same object in its row!
workflowonlytasksallowed = A fork must contain only task elements!
workflowselection = A workflow must be selected!
workflowtransitiontarget = All tasks must have completed transitions!
workflowalreadyexist = A workflow with the same name already exists!
workflowtaskatleast = A workflow must have at least one task!
workflowtransitionalreadyexist = A transition with the same name already exists!
workflowfirstpositionelement = The element at first position must be a Task or a Fork!
workflowdeployed = Workflow ''{0}'' correctly deployed!
workflowsametarget = The form already contains the element <b>{0}</b>
workflowsameobject = You cannot add the same object in its row
workflowonlytasksallowed = A fork must contain only task elements
workflowselection = A workflow must be selected
workflowtransitiontarget = Each task must have at least one transition
workflowalreadyexist = A workflow with the same name already exists
workflowtaskatleast = The workflow must have at least one task
workflowtransitionalreadyexist = A transition with the same name already exists
workflowfirstpositionelement = The initial element must be a Task or a Fork
workflowdeployed = Workflow <b>{0}</b> correctly deployed
office = Office
copyrights = {0} and the logos of {1} are registered trademarks of {2}.
productname = Product Name
Expand All @@ -1206,7 +1206,7 @@ closed = Closed
expired = Expired
confirmimportbundle = Do you want to import the selected bundle?
settingsaffectnewsessions = The settings will affect in the next sessions.
workflowtaskcandidateatleast = All workflow statuses must have at least one candidate!
workflowtaskcandidateatleast = All workflow tasks must have at least one candidate!
operationnotallowed = Operation not allowed
code = Code
guilanguages = GUI Languages
Expand Down Expand Up @@ -3101,4 +3101,5 @@ floating = Floating
cannotconnectlm = Cannot connect the remote License Manager
canconnectlm = Remote License Manager connected
checklmconnection = Check LM connection
clicktoshow = Click to show
clicktoshow = Click to show
atleastoneinitialtask = No task has been marked as initial
25 changes: 13 additions & 12 deletions logicaldoc-i18n/src/main/resources/i18n/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1185,16 +1185,16 @@ editwithoffice = Edit with Office
addomain = AD domain
unlink = Unlink
preview = Preview
workflowsametarget = The form element already contains the element ''{0}''
workflowsameobject = You cannot add the same object in its row!
workflowonlytasksallowed = A fork must contain only task elements!
workflowselection = A workflow must be selected!
workflowtransitiontarget = All tasks must have completed transitions!
workflowalreadyexist = A workflow with the same name already exists!
workflowtaskatleast = A workflow must have at least one task!
workflowtransitionalreadyexist = A transition with the same name already exists!
workflowfirstpositionelement = The element at first position must be a Task or a Fork!
workflowdeployed = Workflow ''{0}'' correctly deployed!
workflowsametarget = The form element already contains the element <b>{0}</b>
workflowsameobject = You cannot add the same object in its row
workflowonlytasksallowed = A fork must contain only task elements
workflowselection = A workflow must be selected
workflowtransitiontarget = Each task must have at least one transition
workflowalreadyexist = A workflow with the same name already exists
workflowtaskatleast = A workflow must have at least one task
workflowtransitionalreadyexist = A transition with the same name already exists
workflowfirstpositionelement = The element at first position must be a Task or a Fork
workflowdeployed = Workflow <b>{0}</b> correctly deployed
office = Office
copyrights = {0} and the logos of {1} are registered trademarks of {2}.
productname = Product Name
Expand All @@ -1206,7 +1206,7 @@ closed = Closed
expired = Expired
confirmimportbundle = Do you want to import the selected bundle?
settingsaffectnewsessions = The settings will affect in the next sessions.
workflowtaskcandidateatleast = All workflow statuses must have at least one candidate!
workflowtaskcandidateatleast = All workflow tasks must have at least one candidate!
operationnotallowed = Operation not allowed
code = Code
guilanguages = GUI Languages
Expand Down Expand Up @@ -3101,4 +3101,5 @@ floating = Floating
cannotconnectlm = Cannot connect the remote License Manager
canconnectlm = Remote License Manager connected
checklmconnection = Check LM connection
clicktoshow = Click to show
clicktoshow = Click to show
atleastoneinitialtask = No task has been marked as initial
25 changes: 13 additions & 12 deletions logicaldoc-i18n/src/main/resources/i18n/messages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1185,16 +1185,16 @@ editwithoffice = Edit with Office
addomain = AD domain
unlink = Unlink
preview = Preview
workflowsametarget = The form element already contains the element ''{0}''
workflowsameobject = You cannot add the same object in its row!
workflowonlytasksallowed = A fork must contain only task elements!
workflowselection = A workflow must be selected!
workflowtransitiontarget = All tasks must have completed transitions!
workflowalreadyexist = A workflow with the same name already exists!
workflowtaskatleast = A workflow must have at least one task!
workflowtransitionalreadyexist = A transition with the same name already exists!
workflowfirstpositionelement = The element at first position must be a Task or a Fork!
workflowdeployed = Workflow ''{0}'' correctly deployed!
workflowsametarget = The form element already contains the element <b>{0}</b>
workflowsameobject = You cannot add the same object in its row
workflowonlytasksallowed = A fork must contain only task elements
workflowselection = A workflow must be selected
workflowtransitiontarget = Each task must have at least one transition
workflowalreadyexist = A workflow with the same name already exists
workflowtaskatleast = A workflow must have at least one task
workflowtransitionalreadyexist = A transition with the same name already exists
workflowfirstpositionelement = The element at first position must be a Task or a Fork
workflowdeployed = Workflow <b>{0}</b> correctly deployed
office = Office
copyrights = {0} and the logos of {1} are registered trademarks of {2}.
productname = Product Name
Expand All @@ -1206,7 +1206,7 @@ closed = Closed
expired = Expired
confirmimportbundle = Do you want to import the selected bundle?
settingsaffectnewsessions = The settings will affect in the next sessions.
workflowtaskcandidateatleast = All workflow statuses must have at least one candidate!
workflowtaskcandidateatleast = All workflow tasks must have at least one candidate!
operationnotallowed = Operation not allowed
code = Code
guilanguages = GUI Languages
Expand Down Expand Up @@ -3101,4 +3101,5 @@ floating = Floating
cannotconnectlm = Cannot connect the remote License Manager
canconnectlm = Remote License Manager connected
checklmconnection = Check LM connection
clicktoshow = Click to show
clicktoshow = Click to show
atleastoneinitialtask = No task has been marked as initial

0 comments on commit 75b2a91

Please sign in to comment.