Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe

Commits:

15 changed files:

Changes:

  • client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/actions/ToggleInsert.java
    ... ... @@ -26,11 +26,13 @@ import fr.ird.observe.client.datasource.editor.api.ObserveKeyStrokesEditorApi;
    26 26
     import fr.ird.observe.client.datasource.editor.api.content.ContentUI;
    
    27 27
     import org.nuiton.jaxx.runtime.swing.action.MenuAction;
    
    28 28
     
    
    29
    +import javax.swing.AbstractButton;
    
    29 30
     import javax.swing.JComponent;
    
    30 31
     import javax.swing.JPopupMenu;
    
    31 32
     import javax.swing.SwingUtilities;
    
    32 33
     import javax.swing.event.PopupMenuEvent;
    
    33 34
     import javax.swing.event.PopupMenuListener;
    
    35
    +import java.awt.Component;
    
    34 36
     import java.awt.event.ActionEvent;
    
    35 37
     
    
    36 38
     import static io.ultreia.java4all.i18n.I18n.n;
    
    ... ... @@ -72,9 +74,18 @@ public class ToggleInsert<U extends ContentUI> extends ContentUIActionSupport<U>
    72 74
         protected void doActionPerformed(ActionEvent e, U ui) {
    
    73 75
             ui.getToggleInsert().setSelected(true);
    
    74 76
             SwingUtilities.invokeLater(() -> {
    
    75
    -            JComponent c = ui.getToggleInsert();
    
    76 77
                 JPopupMenu p = ui.getInsertPopup();
    
    77
    -            MenuAction.preparePopup(p, c, false);
    
    78
    +            int componentCount = p.getComponentCount();
    
    79
    +            if (componentCount == 1) {
    
    80
    +                Component component = p.getComponent(0);
    
    81
    +                if (component.isEnabled() && component instanceof AbstractButton) {
    
    82
    +                    ((AbstractButton) component).doClick();
    
    83
    +                    ui.getToggleInsert().setSelected(false);
    
    84
    +                }
    
    85
    +            } else {
    
    86
    +                JComponent c = ui.getToggleInsert();
    
    87
    +                MenuAction.preparePopup(p, c, false);
    
    88
    +            }
    
    78 89
             });
    
    79 90
         }
    
    80 91
     
    

  • core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
    ... ... @@ -11897,7 +11897,8 @@
    11897 11897
           {
    
    11898 11898
             "name": "speciesFate",
    
    11899 11899
             "comments": [
    
    11900
    -          "check if referential speciesFate is disabled (only if validation is strong)"
    
    11900
    +          "check if referential speciesFate is disabled (only if validation is strong)",
    
    11901
    +          "speciesFate is mandatory"
    
    11901 11902
             ]
    
    11902 11903
           },
    
    11903 11904
           {
    
    ... ... @@ -12045,7 +12046,8 @@
    12045 12046
           {
    
    12046 12047
             "name": "speciesFate",
    
    12047 12048
             "comments": [
    
    12048
    -          "check if referential speciesFate is disabled (only if validation is strong)"
    
    12049
    +          "check if referential speciesFate is disabled (only if validation is strong)",
    
    12050
    +          "speciesFate is mandatory"
    
    12049 12051
             ]
    
    12050 12052
           },
    
    12051 12053
           {
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-create-error-validation.xml
    ... ... @@ -118,6 +118,11 @@
    118 118
       </field>
    
    119 119
     
    
    120 120
       <field name="speciesFate">
    
    121
    +    <!-- speciesFate is mandatory -->
    
    122
    +    <field-validator type="mandatory" short-circuit="true">
    
    123
    +      <message/>
    
    124
    +    </field-validator>
    
    125
    +
    
    121 126
         <!-- check if referential speciesFate is disabled (only if validation is strong) -->
    
    122 127
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    123 128
           <message/>
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-update-error-validation.xml
    ... ... @@ -123,6 +123,11 @@
    123 123
       </field>
    
    124 124
     
    
    125 125
       <field name="speciesFate">
    
    126
    +    <!-- speciesFate is mandatory -->
    
    127
    +    <field-validator type="mandatory" short-circuit="true">
    
    128
    +      <message/>
    
    129
    +    </field-validator>
    
    130
    +
    
    126 131
         <!-- check if referential speciesFate is disabled (only if validation is strong) -->
    
    127 132
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    128 133
           <message/>
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/Catch/validation-create.json
    ... ... @@ -68,7 +68,8 @@
    68 68
       },
    
    69 69
       "speciesFate": {
    
    70 70
         "errors": [
    
    71
    -      "check if referential speciesFate is disabled (only if validation is strong)"
    
    71
    +      "check if referential speciesFate is disabled (only if validation is strong)",
    
    72
    +      "speciesFate is mandatory"
    
    72 73
         ],
    
    73 74
         "warnings": [
    
    74 75
           "check if referential speciesFate is disabled (only if validation is not strong)"
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/Catch/validation-update.json
    ... ... @@ -68,7 +68,8 @@
    68 68
       },
    
    69 69
       "speciesFate": {
    
    70 70
         "errors": [
    
    71
    -      "check if referential speciesFate is disabled (only if validation is strong)"
    
    71
    +      "check if referential speciesFate is disabled (only if validation is strong)",
    
    72
    +      "speciesFate is mandatory"
    
    72 73
         ],
    
    73 74
         "warnings": [
    
    74 75
           "check if referential speciesFate is disabled (only if validation is not strong)"
    

  • model/src/main/models/Observe/dto/attribute/notNull.properties
    ... ... @@ -167,6 +167,7 @@ data.ps.observation.Activity.attribute.time=true
    167 167
     data.ps.observation.Activity.attribute.vesselActivity=true
    
    168 168
     data.ps.observation.Catch.attribute.informationSource=true
    
    169 169
     data.ps.observation.Catch.attribute.species=true
    
    170
    +data.ps.observation.Catch.attribute.speciesFate=true
    
    170 171
     data.ps.observation.FloatingObjectPart.attribute.objectMaterial=true
    
    171 172
     data.ps.observation.NonTargetCatchRelease.attribute.count=true
    
    172 173
     data.ps.observation.NonTargetCatchRelease.attribute.sex=true
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create-error.xml
    ... ... @@ -231,6 +231,12 @@
    231 231
       </field>
    
    232 232
     
    
    233 233
       <field name="schoolType">
    
    234
    +    <!-- schoolType is mandatory except if !setEnabled -->
    
    235
    +    <field-validator type="mandatory" short-circuit="true">
    
    236
    +      <param name="skip"><![CDATA[ !setEnabled ]]></param>
    
    237
    +      <message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
    
    238
    +    </field-validator>
    
    239
    +
    
    234 240
         <!-- check if referential schoolType is disabled (only if validation is strong) -->
    
    235 241
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    236 242
           <message/>
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create.json
    ... ... @@ -122,7 +122,8 @@
    122 122
       },
    
    123 123
       "schoolType": {
    
    124 124
         "errors": [
    
    125
    -      "check if referential schoolType is disabled (only if validation is strong)"
    
    125
    +      "check if referential schoolType is disabled (only if validation is strong)",
    
    126
    +      "schoolType is mandatory except if !setEnabled"
    
    126 127
         ],
    
    127 128
         "warnings": [
    
    128 129
           "check if referential schoolType is disabled (only if validation is not strong)"
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update-error.xml
    ... ... @@ -231,6 +231,12 @@
    231 231
       </field>
    
    232 232
     
    
    233 233
       <field name="schoolType">
    
    234
    +    <!-- schoolType is mandatory except if !setEnabled -->
    
    235
    +    <field-validator type="mandatory" short-circuit="true">
    
    236
    +      <param name="skip"><![CDATA[ !setEnabled ]]></param>
    
    237
    +      <message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
    
    238
    +    </field-validator>
    
    239
    +
    
    234 240
         <!-- check if referential schoolType is disabled (only if validation is strong) -->
    
    235 241
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    236 242
           <message/>
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update.json
    ... ... @@ -122,7 +122,8 @@
    122 122
       },
    
    123 123
       "schoolType": {
    
    124 124
         "errors": [
    
    125
    -      "check if referential schoolType is disabled (only if validation is strong)"
    
    125
    +      "check if referential schoolType is disabled (only if validation is strong)",
    
    126
    +      "schoolType is mandatory except if !setEnabled"
    
    126 127
         ],
    
    127 128
         "warnings": [
    
    128 129
           "check if referential schoolType is disabled (only if validation is not strong)"
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-create-error.xml
    ... ... @@ -118,6 +118,11 @@
    118 118
       </field>
    
    119 119
     
    
    120 120
       <field name="speciesFate">
    
    121
    +    <!-- speciesFate is mandatory -->
    
    122
    +    <field-validator type="mandatory" short-circuit="true">
    
    123
    +      <message/>
    
    124
    +    </field-validator>
    
    125
    +
    
    121 126
         <!-- check if referential speciesFate is disabled (only if validation is strong) -->
    
    122 127
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    123 128
           <message/>
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-create.json
    ... ... @@ -68,7 +68,8 @@
    68 68
       },
    
    69 69
       "speciesFate": {
    
    70 70
         "errors": [
    
    71
    -      "check if referential speciesFate is disabled (only if validation is strong)"
    
    71
    +      "check if referential speciesFate is disabled (only if validation is strong)",
    
    72
    +      "speciesFate is mandatory"
    
    72 73
         ],
    
    73 74
         "warnings": [
    
    74 75
           "check if referential speciesFate is disabled (only if validation is not strong)"
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-update-error.xml
    ... ... @@ -123,6 +123,11 @@
    123 123
       </field>
    
    124 124
     
    
    125 125
       <field name="speciesFate">
    
    126
    +    <!-- speciesFate is mandatory -->
    
    127
    +    <field-validator type="mandatory" short-circuit="true">
    
    128
    +      <message/>
    
    129
    +    </field-validator>
    
    130
    +
    
    126 131
         <!-- check if referential speciesFate is disabled (only if validation is strong) -->
    
    127 132
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    128 133
           <message/>
    

  • server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-update.json
    ... ... @@ -68,7 +68,8 @@
    68 68
       },
    
    69 69
       "speciesFate": {
    
    70 70
         "errors": [
    
    71
    -      "check if referential speciesFate is disabled (only if validation is strong)"
    
    71
    +      "check if referential speciesFate is disabled (only if validation is strong)",
    
    72
    +      "speciesFate is mandatory"
    
    72 73
         ],
    
    73 74
         "warnings": [
    
    74 75
           "check if referential speciesFate is disabled (only if validation is not strong)"