From 75b2a914c336fb241016fb9afa76546c58b3486b Mon Sep 17 00:00:00 2001 From: car031 Date: Wed, 8 May 2024 09:23:14 +0200 Subject: [PATCH] minimal fixes in preparation of 8.9.2 --- .../template/AttributeSetPropertiesPanel.java | 13 ++++++---- .../gui/frontend/client/system/LogPanel.java | 7 +++--- .../client/workflow/designer/TaskEditor.java | 8 +++--- .../workflow/designer/WorkflowDesigner.java | 7 ++---- .../workflow/designer/WorkflowToolStrip.java | 15 ++++++----- .../main/resources/i18n/messages.properties | 25 ++++++++++--------- .../resources/i18n/messages_en.properties | 25 ++++++++++--------- .../resources/i18n/messages_en_US.properties | 25 ++++++++++--------- 8 files changed, 65 insertions(+), 60 deletions(-) diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/metadata/template/AttributeSetPropertiesPanel.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/metadata/template/AttributeSetPropertiesPanel.java index 831dbe6d5..ec29059e4 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/metadata/template/AttributeSetPropertiesPanel.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/metadata/template/AttributeSetPropertiesPanel.java @@ -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. @@ -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(); @@ -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)); @@ -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; @@ -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()); @@ -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); diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/system/LogPanel.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/system/LogPanel.java index 4c9057098..a543ec45b 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/system/LogPanel.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/system/LogPanel.java @@ -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() { @Override diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/TaskEditor.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/TaskEditor.java index b1afd6af8..1be53eadd 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/TaskEditor.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/TaskEditor.java @@ -85,7 +85,6 @@ public TaskEditor(StateWidget widget) { setShowModalMask(true); setMargin(3); setWidth(650); - setHeight(600); centerInPage(); Tab propertiesTab = new Tab(I18N.message("properties")); @@ -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")); diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowDesigner.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowDesigner.java index 1e7145212..68f6beabf 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowDesigner.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowDesigner.java @@ -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(); @@ -172,7 +171,5 @@ public boolean saveModel() { srcWidget.getWFState().setTransitions(transitions); } - - return true; } } \ No newline at end of file diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowToolStrip.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowToolStrip.java index 75739cf30..c05c1fed1 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowToolStrip.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/workflow/designer/WorkflowToolStrip.java @@ -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<>() { @@ -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; } @@ -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 diff --git a/logicaldoc-i18n/src/main/resources/i18n/messages.properties b/logicaldoc-i18n/src/main/resources/i18n/messages.properties index 60b1105ba..8fa04f682 100644 --- a/logicaldoc-i18n/src/main/resources/i18n/messages.properties +++ b/logicaldoc-i18n/src/main/resources/i18n/messages.properties @@ -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 {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 = 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 {0} correctly deployed office = Office copyrights = {0} and the logos of {1} are registered trademarks of {2}. productname = Product Name @@ -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 @@ -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 \ No newline at end of file +clicktoshow = Click to show +atleastoneinitialtask = No task has been marked as initial \ No newline at end of file diff --git a/logicaldoc-i18n/src/main/resources/i18n/messages_en.properties b/logicaldoc-i18n/src/main/resources/i18n/messages_en.properties index 60b1105ba..c2277ed72 100644 --- a/logicaldoc-i18n/src/main/resources/i18n/messages_en.properties +++ b/logicaldoc-i18n/src/main/resources/i18n/messages_en.properties @@ -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 {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 = 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 {0} correctly deployed office = Office copyrights = {0} and the logos of {1} are registered trademarks of {2}. productname = Product Name @@ -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 @@ -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 \ No newline at end of file +clicktoshow = Click to show +atleastoneinitialtask = No task has been marked as initial \ No newline at end of file diff --git a/logicaldoc-i18n/src/main/resources/i18n/messages_en_US.properties b/logicaldoc-i18n/src/main/resources/i18n/messages_en_US.properties index abb50bff5..a0fb01b1e 100644 --- a/logicaldoc-i18n/src/main/resources/i18n/messages_en_US.properties +++ b/logicaldoc-i18n/src/main/resources/i18n/messages_en_US.properties @@ -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 {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 = 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 {0} correctly deployed office = Office copyrights = {0} and the logos of {1} are registered trademarks of {2}. productname = Product Name @@ -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 @@ -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 \ No newline at end of file +clicktoshow = Click to show +atleastoneinitialtask = No task has been marked as initial \ No newline at end of file