Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: d1d8df8e by Tony Chemit at 2022-05-09T17:14:00+02:00 Sur échantillons PS, un contrôle de validation imparfait - Closes #2295 - - - - - 2ab1abf6 by Tony Chemit at 2022-05-09T17:14:00+02:00 Le gestionnaire de connexion directe a une petite imperfection - Closes #2330 - - - - - 18f96f99 by Tony Chemit at 2022-05-09T17:14:00+02:00 Dans le gestionnaire de connexions, l'onglet serveurs pourrait être le premier - Closes #2286 - - - - - 15 changed files: - client/core/src/main/i18n/getters/java.getter - client/core/src/main/java/fr/ird/observe/client/datasource/presets/actions/Create.java - client/core/src/main/java/fr/ird/observe/client/datasource/presets/actions/TestRemote.java - client/core/src/main/java/fr/ird/observe/client/datasource/presets/actions/TestServer.java - client/runner/src/main/i18n/translations/client-runner_en_GB.properties - client/runner/src/main/i18n/translations/client-runner_es_ES.properties - client/runner/src/main/i18n/translations/client-runner_fr_FR.properties - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Sample/validation-create.json - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Sample/validation-update.json - core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-referentialResult.json - model/src/main/models/Observe/dto/attribute/notNullIf.properties - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-create-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-create.json - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-update-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-update.json Changes: ===================================== client/core/src/main/i18n/getters/java.getter ===================================== @@ -135,6 +135,9 @@ observe.ui.datasource.editor.actions.data.import.result observe.ui.datasource.editor.actions.data.import.title.require.add.missing.referential observe.ui.datasource.editor.actions.data.insertMissingReferentialToLeft observe.ui.datasource.editor.actions.data.insertMissingReferentialToRight +observe.ui.datasource.storage.config.test.message.failure +observe.ui.datasource.storage.config.test.message.success +observe.ui.datasource.storage.config.test.title observe.ui.datasource.storage.error.badUrl observe.ui.datasource.storage.error.dbVersionMismatch observe.ui.datasource.storage.error.serverVersionMismatch ===================================== client/core/src/main/java/fr/ird/observe/client/datasource/presets/actions/Create.java ===================================== @@ -48,15 +48,6 @@ public class Create extends RemotePresetsUIActionSupport { protected void doActionPerformed(ActionEvent e, RemotePresetsUI ui) { switch (ui.getTabs().getSelectedIndex()) { - case 0: { - RemoteDataSourceConfiguration configuration = new RemoteDataSourceConfiguration(); - List<RemoteDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getRemoteDataSourceConfigurations()); - configurations.add(configuration); - ui.getModel().setRemoteDataSourceConfigurations(configurations); - ui.getModel().setRemoteCreateMode(true); - ui.getRemoteConfigurations().setSelectedValue(configuration, true); - } - break; case 1: { ServerDataSourceConfiguration configuration = new ServerDataSourceConfiguration(); List<ServerDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getServerDataSourceConfigurations()); @@ -66,6 +57,15 @@ public class Create extends RemotePresetsUIActionSupport { ui.getServerConfigurations().setSelectedValue(configuration, true); } break; + case 0: { + RemoteDataSourceConfiguration configuration = new RemoteDataSourceConfiguration(); + List<RemoteDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getRemoteDataSourceConfigurations()); + configurations.add(configuration); + ui.getModel().setRemoteDataSourceConfigurations(configurations); + ui.getModel().setRemoteCreateMode(true); + ui.getRemoteConfigurations().setSelectedValue(configuration, true); + } + break; } } ===================================== client/core/src/main/java/fr/ird/observe/client/datasource/presets/actions/TestRemote.java ===================================== @@ -54,6 +54,7 @@ public class TestRemote extends RemoteActionSupport { String connexionStatusError = null; Version modelVersion = getClientConfig().getModelVersion(); + config.setModelVersion(modelVersion); ObserveSwingDataSource dataSource = getDataSourcesManager().newDataSource(config); try { ObserveDataSourceInformation dataSourceInformation = dataSource.checkCanConnect(false); @@ -74,9 +75,9 @@ public class TestRemote extends RemoteActionSupport { } } finally { if (connexionStatusError == null) { - displayInfo("Test de connexion", "Le connexion a été établie avec succès."); + displayWarning(t("observe.ui.datasource.storage.config.test.title"), t("observe.ui.datasource.storage.config.test.message.success")); } else { - displayWarning("Test de connexion", "Le test de connexion a échoué :\n" + connexionStatusError); + displayWarning(t("observe.ui.datasource.storage.config.test.title"), t("observe.ui.datasource.storage.config.test.message.failure", connexionStatusError)); } } } ===================================== client/core/src/main/java/fr/ird/observe/client/datasource/presets/actions/TestServer.java ===================================== @@ -103,9 +103,9 @@ public class TestServer extends ServerActionSupport { } } finally { if (connexionStatusError == null) { - displayInfo("Test de connexion", "Le connexion a été établie avec succès."); + displayInfo(t("observe.ui.datasource.storage.config.test.title"), t("observe.ui.datasource.storage.config.test.message.success")); } else { - displayWarning("Test de connexion", "Le test de connexion a échoué :\n" + connexionStatusError); + displayWarning(t("observe.ui.datasource.storage.config.test.title"), t("observe.ui.datasource.storage.config.test.message.failure", connexionStatusError)); } } } ===================================== client/runner/src/main/i18n/translations/client-runner_en_GB.properties ===================================== @@ -688,6 +688,9 @@ observe.ui.datasource.storage.config.referentiel.mode=Referential import mode observe.ui.datasource.storage.config.referentiel.storage=Central data source configuration observe.ui.datasource.storage.config.right.storage=Right data source configuration observe.ui.datasource.storage.config.source.storage=Configuration of data source to update +observe.ui.datasource.storage.config.test.message.failure=The connexion has failed\: %s +observe.ui.datasource.storage.config.test.message.success=The connexion was successful +observe.ui.datasource.storage.config.test.title=Testing connexion observe.ui.datasource.storage.error.badUrl=The url format is not valid (%s) observe.ui.datasource.storage.error.dbVersionMismatch=Version of remote database (%s) is not compliant with the model version (%s) observe.ui.datasource.storage.error.serverVersionMismatch=Remote server version (%s) is not compliant with the client version (%s) ===================================== client/runner/src/main/i18n/translations/client-runner_es_ES.properties ===================================== @@ -688,6 +688,9 @@ observe.ui.datasource.storage.config.referentiel.mode=Modo de importación del r observe.ui.datasource.storage.config.referentiel.storage=Configuración de la base de referencia observe.ui.datasource.storage.config.right.storage=Configuration de la base de la derecha observe.ui.datasource.storage.config.source.storage=Configuración de la base de la izquierda +observe.ui.datasource.storage.config.test.message.failure=The connexion has failed\: %s \#TODO +observe.ui.datasource.storage.config.test.message.success=The connexion was successful \#TODO +observe.ui.datasource.storage.config.test.title=Testing connexion \#TODO observe.ui.datasource.storage.error.badUrl=Error en el formato de la dirección (URL) %s observe.ui.datasource.storage.error.dbVersionMismatch=La versión de la base remota (%s) no es compatible con la versión del modelo (%s). observe.ui.datasource.storage.error.serverVersionMismatch=La versión del servidor remoto (%s) no es compatible con la versión del modelo (%s) ===================================== client/runner/src/main/i18n/translations/client-runner_fr_FR.properties ===================================== @@ -688,6 +688,9 @@ observe.ui.datasource.storage.config.referentiel.mode=Mode d'import du référen observe.ui.datasource.storage.config.referentiel.storage=Configuration de la base de référence observe.ui.datasource.storage.config.right.storage=Configuration de la base de droite observe.ui.datasource.storage.config.source.storage=Configuration de la base à mettre à jour +observe.ui.datasource.storage.config.test.message.failure=Le test de connexion a échoué \: \n %s +observe.ui.datasource.storage.config.test.message.success=Le connexion a été établie avec succès. +observe.ui.datasource.storage.config.test.title=Testing connexion observe.ui.datasource.storage.error.badUrl=Erreur dans le format de l'URL %s observe.ui.datasource.storage.error.dbVersionMismatch=La version de la base distante (%s) n'est pas compatible avec la version du modèle (%s) observe.ui.datasource.storage.error.serverVersionMismatch=La version du serveur distant (%s) n'est pas compatible avec la version du client (%s) ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Sample/validation-create.json ===================================== @@ -3,7 +3,7 @@ "errors": [ "0.0 <= bigsWeight <= 200.0", "bigsWeight is a positive number", - "bigsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "bigsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "bigsWeight not allowed if totalWeight filled" ] }, @@ -54,7 +54,7 @@ "errors": [ "0.0 <= smallsWeight <= 200.0", "smallsWeight is a positive number", - "smallsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "smallsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "smallsWeight not allowed if totalWeight filled" ] }, @@ -67,7 +67,7 @@ "errors": [ "0.0 <= totalWeight <= 200.0", "totalWeight is a positive number", - "totalWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", + "totalWeight is mandatory except if (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", "totalWeight not allowed if bigsWeight and smallsWeight filled" ] }, ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Sample/validation-update.json ===================================== @@ -3,7 +3,7 @@ "errors": [ "0.0 <= bigsWeight <= 200.0", "bigsWeight is a positive number", - "bigsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "bigsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "bigsWeight not allowed if totalWeight filled" ] }, @@ -54,7 +54,7 @@ "errors": [ "0.0 <= smallsWeight <= 200.0", "smallsWeight is a positive number", - "smallsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "smallsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "smallsWeight not allowed if totalWeight filled" ] }, @@ -67,7 +67,7 @@ "errors": [ "0.0 <= totalWeight <= 200.0", "totalWeight is a positive number", - "totalWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", + "totalWeight is mandatory except if (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", "totalWeight not allowed if bigsWeight and smallsWeight filled" ] }, ===================================== core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-referentialResult.json ===================================== @@ -118397,6 +118397,33 @@ } ] }, + { + "reference": { + "type": "fr.ird.observe.dto.referential.ll.landing.DataSourceReference", + "content": { + "code": "R Dogley", + "label": "Ruby Dogley (Technicien SFA)", + "needComment": false, + "enabled": true, + "id": "fr.ird.referential.ll.landing.DataSource#1651919221463#0.13484675401101676", + "lastUpdateDate": "2022-05-07T14:27:01.463Z", + "topiaVersion": 1, + "topiaCreateDate": "2022-05-07T14:25:57.747Z" + } + }, + "messages": [ + { + "fieldName": "label1", + "scope": "WARNING", + "message": "Le libellé anglais n\u0027est pas traduit." + }, + { + "fieldName": "label3", + "scope": "WARNING", + "message": "Le libellé espagnol n\u0027est pas traduit." + } + ] + }, { "reference": { "type": "fr.ird.observe.dto.referential.ll.landing.DataSourceReference", ===================================== model/src/main/models/Observe/dto/attribute/notNullIf.properties ===================================== @@ -48,9 +48,9 @@ data.ps.logbook.Activity.attribute.longitude=floatingObjectEnabled && !setEnable data.ps.logbook.Activity.attribute.quadrant=floatingObjectEnabled && !setEnabled data.ps.logbook.Activity.attribute.setCount=!setEnabled data.ps.logbook.Activity.attribute.setSuccessStatus=!setEnabled || reasonForNoFishing != null -data.ps.logbook.Sample.attribute.bigsWeight=(smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) -data.ps.logbook.Sample.attribute.smallsWeight=(smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) -data.ps.logbook.Sample.attribute.totalWeight=(smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) +data.ps.logbook.Sample.attribute.bigsWeight=(totalWeight != null && totalWeight > 0) +data.ps.logbook.Sample.attribute.smallsWeight=(totalWeight != null && totalWeight > 0) +data.ps.logbook.Sample.attribute.totalWeight=(bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) data.ps.observation.Catch.attribute.catchWeight=totalCount != null data.ps.observation.Catch.attribute.totalCount=catchWeight != null data.ps.observation.SampleMeasure.attribute.length=acquisitionMode == 1 && weight != null ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-create-error.xml ===================================== @@ -25,9 +25,9 @@ <validators> <field name="bigsWeight"> - <!-- bigsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) --> + <!-- bigsWeight is mandatory except if (totalWeight != null && totalWeight > 0) --> <field-validator type="mandatory" short-circuit="true"> - <param name="skip"><![CDATA[ (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) ]]></param> + <param name="skip"><![CDATA[ (totalWeight != null && totalWeight > 0) ]]></param> <message>observe.data.ps.logbook.Sample.bigsWeight.validation.required</message> </field-validator> @@ -111,9 +111,9 @@ </field> <field name="smallsWeight"> - <!-- smallsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) --> + <!-- smallsWeight is mandatory except if (totalWeight != null && totalWeight > 0) --> <field-validator type="mandatory" short-circuit="true"> - <param name="skip"><![CDATA[ (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) ]]></param> + <param name="skip"><![CDATA[ (totalWeight != null && totalWeight > 0) ]]></param> <message>observe.data.ps.logbook.Sample.smallsWeight.validation.required</message> </field-validator> @@ -144,9 +144,9 @@ </field> <field name="totalWeight"> - <!-- totalWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) --> + <!-- totalWeight is mandatory except if (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) --> <field-validator type="mandatory" short-circuit="true"> - <param name="skip"><![CDATA[ (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) ]]></param> + <param name="skip"><![CDATA[ (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) ]]></param> <message>observe.data.ps.logbook.Sample.totalWeight.validation.required</message> </field-validator> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-create.json ===================================== @@ -3,7 +3,7 @@ "errors": [ "0.0 <= bigsWeight <= 200.0", "bigsWeight is a positive number", - "bigsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "bigsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "bigsWeight not allowed if totalWeight filled" ] }, @@ -54,7 +54,7 @@ "errors": [ "0.0 <= smallsWeight <= 200.0", "smallsWeight is a positive number", - "smallsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "smallsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "smallsWeight not allowed if totalWeight filled" ] }, @@ -67,7 +67,7 @@ "errors": [ "0.0 <= totalWeight <= 200.0", "totalWeight is a positive number", - "totalWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", + "totalWeight is mandatory except if (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", "totalWeight not allowed if bigsWeight and smallsWeight filled" ] }, ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-update-error.xml ===================================== @@ -25,9 +25,9 @@ <validators> <field name="bigsWeight"> - <!-- bigsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) --> + <!-- bigsWeight is mandatory except if (totalWeight != null && totalWeight > 0) --> <field-validator type="mandatory" short-circuit="true"> - <param name="skip"><![CDATA[ (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) ]]></param> + <param name="skip"><![CDATA[ (totalWeight != null && totalWeight > 0) ]]></param> <message>observe.data.ps.logbook.Sample.bigsWeight.validation.required</message> </field-validator> @@ -111,9 +111,9 @@ </field> <field name="smallsWeight"> - <!-- smallsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) --> + <!-- smallsWeight is mandatory except if (totalWeight != null && totalWeight > 0) --> <field-validator type="mandatory" short-circuit="true"> - <param name="skip"><![CDATA[ (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0) ]]></param> + <param name="skip"><![CDATA[ (totalWeight != null && totalWeight > 0) ]]></param> <message>observe.data.ps.logbook.Sample.smallsWeight.validation.required</message> </field-validator> @@ -144,9 +144,9 @@ </field> <field name="totalWeight"> - <!-- totalWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) --> + <!-- totalWeight is mandatory except if (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) --> <field-validator type="mandatory" short-circuit="true"> - <param name="skip"><![CDATA[ (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) ]]></param> + <param name="skip"><![CDATA[ (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0) ]]></param> <message>observe.data.ps.logbook.Sample.totalWeight.validation.required</message> </field-validator> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Sample/validation-update.json ===================================== @@ -3,7 +3,7 @@ "errors": [ "0.0 <= bigsWeight <= 200.0", "bigsWeight is a positive number", - "bigsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "bigsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "bigsWeight not allowed if totalWeight filled" ] }, @@ -54,7 +54,7 @@ "errors": [ "0.0 <= smallsWeight <= 200.0", "smallsWeight is a positive number", - "smallsWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (totalWeight != null && totalWeight > 0)", + "smallsWeight is mandatory except if (totalWeight != null && totalWeight > 0)", "smallsWeight not allowed if totalWeight filled" ] }, @@ -67,7 +67,7 @@ "errors": [ "0.0 <= totalWeight <= 200.0", "totalWeight is a positive number", - "totalWeight is mandatory except if (smallsWeight == null && bigsWeight == null && totalWeight == null) || (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", + "totalWeight is mandatory except if (bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0)", "totalWeight not allowed if bigsWeight and smallsWeight filled" ] }, View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/24ab1f48fe37f892ce32d37e8... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/24ab1f48fe37f892ce32d37e8... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT (@tchemit)