Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
de95fb1f
by Tony Chemit at 2024-09-05T12:26:25+02:00
-
b7bc8cf9
by Tony Chemit at 2024-09-05T12:26:53+02:00
-
1995338f
by Tony Chemit at 2024-09-05T12:26:58+02:00
8 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/i18n/getters/config.getter
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/rlist/actions/BulkModify.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/rlist/bulk/BulkModifyUIModel.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
Changes:
| ... | ... | @@ -955,6 +955,12 @@ key = ui.nauticalLength.format |
| 955 | 955 | type = io.ultreia.java4all.jaxx.widgets.length.nautical.NauticalLengthFormat
|
| 956 | 956 | defaultValue = M
|
| 957 | 957 | |
| 958 | +[option showSensibleCriteriaInTripBulkChanges]
|
|
| 959 | +description = observe.config.showSensibleCriteriaInTripBulkChanges
|
|
| 960 | +key = ui.showSensibleCriteriaInTripBulkChanges
|
|
| 961 | +type = Boolean
|
|
| 962 | +defaultValue = false
|
|
| 963 | + |
|
| 958 | 964 | [option treeGroupByName]
|
| 959 | 965 | description = observe.config.ui.tree.groupByName
|
| 960 | 966 | key = ui.tree.config.groupByName
|
| ... | ... | @@ -96,6 +96,7 @@ observe.config.navigationIconsPath.description |
| 96 | 96 | observe.config.pg.can.migrate.description
|
| 97 | 97 | observe.config.remoteDataSourceConfigurations.description
|
| 98 | 98 | observe.config.serverDataSourceConfigurations.description
|
| 99 | +observe.config.showSensibleCriteriaInTripBulkChanges
|
|
| 99 | 100 | observe.config.showSql
|
| 100 | 101 | observe.config.simplifiedObjectTypeSpecializedRules.description
|
| 101 | 102 | observe.config.sizeMeasureType.seine.localmarket.sample
|
| ... | ... | @@ -386,32 +386,32 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext |
| 386 | 386 | private void addExpertOptions(ObserveConfigUIBuilder helper) {
|
| 387 | 387 | |
| 388 | 388 | helper.addCategory(n("observe.config.category.expert"),
|
| 389 | - n("observe.config.category.expert.description"),
|
|
| 390 | - "application");
|
|
| 389 | + n("observe.config.category.expert.description"));
|
|
| 391 | 390 | |
| 392 | - helper.addOption(ClientConfigOption.LOAD_LOCAL_STORAGE);
|
|
| 391 | + helper.addOption(ClientConfigOption.LOAD_LOCAL_STORAGE).setOptionCallBack("application");
|
|
| 393 | 392 | |
| 394 | - helper.addOption(ClientConfigOption.BACKUP_USE);
|
|
| 395 | - helper.addOption(ClientConfigOption.BACKUP_DELAY);
|
|
| 396 | - helper.addOption(ClientConfigOption.BACKUP_AT_CLOSE);
|
|
| 393 | + helper.addOption(ClientConfigOption.BACKUP_USE).setOptionCallBack("application");
|
|
| 394 | + helper.addOption(ClientConfigOption.BACKUP_DELAY).setOptionCallBack("application");
|
|
| 395 | + helper.addOption(ClientConfigOption.BACKUP_AT_CLOSE).setOptionCallBack("application");
|
|
| 397 | 396 | |
| 398 | - helper.addOption(ClientConfigOption.REPORT_DIRECTORY);
|
|
| 397 | + helper.addOption(ClientConfigOption.REPORT_DIRECTORY).setOptionCallBack("application");
|
|
| 399 | 398 | |
| 400 | - helper.addOption(ClientConfigOption.TEMPORARY_FILES_TIMEOUT);
|
|
| 401 | - helper.addOption(ClientConfigOption.LOG_FILES_TIMEOUT);
|
|
| 402 | - helper.addOption(ClientConfigOption.FEEDBACK_FILES_TIMEOUT);
|
|
| 403 | - helper.addOption(ClientConfigOption.BACKUP_FILES_TIMEOUT);
|
|
| 399 | + helper.addOption(ClientConfigOption.TEMPORARY_FILES_TIMEOUT).setOptionCallBack("application");
|
|
| 400 | + helper.addOption(ClientConfigOption.LOG_FILES_TIMEOUT).setOptionCallBack("application");
|
|
| 401 | + helper.addOption(ClientConfigOption.FEEDBACK_FILES_TIMEOUT).setOptionCallBack("application");
|
|
| 402 | + helper.addOption(ClientConfigOption.BACKUP_FILES_TIMEOUT).setOptionCallBack("application");
|
|
| 404 | 403 | |
| 405 | - helper.addOption(ClientConfigOption.CHANGE_SYNCHRO_SRC);
|
|
| 406 | - helper.addOption(ClientConfigOption.H2_CAN_MIGRATE);
|
|
| 407 | - helper.addOption(ClientConfigOption.OBSTUNA_CAN_MIGRATE);
|
|
| 408 | - helper.addOption(ClientConfigOption.H2_SERVER_PORT);
|
|
| 409 | - helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL);
|
|
| 410 | - helper.addOption(ClientConfigOption.AVDTH_FORCE_IMPORT);
|
|
| 404 | + helper.addOption(ClientConfigOption.CHANGE_SYNCHRO_SRC).setOptionCallBack("application");
|
|
| 405 | + helper.addOption(ClientConfigOption.H2_CAN_MIGRATE).setOptionCallBack("application");
|
|
| 406 | + helper.addOption(ClientConfigOption.OBSTUNA_CAN_MIGRATE).setOptionCallBack("application");
|
|
| 407 | + helper.addOption(ClientConfigOption.H2_SERVER_PORT).setOptionCallBack("application");
|
|
| 408 | + helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL).setOptionCallBack("ui");
|
|
| 409 | + helper.addOption(ClientConfigOption.AVDTH_FORCE_IMPORT).setOptionCallBack("ui");
|
|
| 411 | 410 | |
| 412 | 411 | helper.addOption(ClientConfigOption.SHOW_SQL);
|
| 413 | 412 | helper.addOption(ClientConfigOption.USE_JVM_KEY_STORE);
|
| 414 | - helper.addOption(ClientConfigOption.SKIP_CONSOLIDATE_STEP_FOR_REPORT);
|
|
| 413 | + helper.addOption(ClientConfigOption.SKIP_CONSOLIDATE_STEP_FOR_REPORT).setOptionCallBack("ui");
|
|
| 414 | + helper.addOption(ClientConfigOption.SHOW_SENSIBLE_CRITERIA_IN_TRIP_BULK_CHANGES).setOptionCallBack("ui");
|
|
| 415 | 415 | |
| 416 | 416 | }
|
| 417 | 417 |
| ... | ... | @@ -71,6 +71,7 @@ public class BulkModify<D extends RootOpenableDto, R extends DataDtoReference, U |
| 71 | 71 | String moduleName = navigationTreeConfig.getModuleName();
|
| 72 | 72 | BusinessModule businessModule = ObserveBusinessProject.get().getBusinessModuleByName(moduleName);
|
| 73 | 73 | BulkModifyUIModel<R> model = new BulkModifyUIModel<>(navigationTreeConfig,
|
| 74 | + getClientConfig().isShowSensibleCriteriaInTripBulkChanges(),
|
|
| 74 | 75 | new ModuleGroupByHelper(businessModule),
|
| 75 | 76 | getMainUI().getBusyModel(),
|
| 76 | 77 | ui.getModel().getStates().createReferenceCache(!navigationTreeConfig.isLoadDisabledGroupBy()),
|
| ... | ... | @@ -22,6 +22,7 @@ package fr.ird.observe.client.datasource.editor.api.content.data.rlist.bulk; |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | +import fr.ird.observe.client.configuration.ClientConfig;
|
|
| 25 | 26 | import fr.ird.observe.client.datasource.api.cache.ReferencesCache;
|
| 26 | 27 | import fr.ird.observe.dto.data.DataGroupByDtoDefinition;
|
| 27 | 28 | import fr.ird.observe.dto.reference.DataDtoReference;
|
| ... | ... | @@ -36,6 +37,7 @@ import javax.swing.ComboBoxModel; |
| 36 | 37 | import javax.swing.DefaultComboBoxModel;
|
| 37 | 38 | import java.util.List;
|
| 38 | 39 | import java.util.Objects;
|
| 40 | +import java.util.Set;
|
|
| 39 | 41 | import java.util.stream.Collectors;
|
| 40 | 42 | |
| 41 | 43 | /**
|
| ... | ... | @@ -50,6 +52,16 @@ public class BulkModifyUIModel<R extends DataDtoReference> extends AbstractJavaB |
| 50 | 52 | public static final String PROPERTY_SELECTED_CRITERIA = "selectedCriteria";
|
| 51 | 53 | public static final String PROPERTY_SELECTED_VALUE = "selectedValue";
|
| 52 | 54 | public static final String PROPERTY_CAN_APPLY = "canApply";
|
| 55 | + /**
|
|
| 56 | + * Sensible criteria to hide if client configuration option is off.
|
|
| 57 | + * <p>
|
|
| 58 | + * See {@link ClientConfig#isShowSensibleCriteriaInTripBulkChanges()}
|
|
| 59 | + */
|
|
| 60 | + private static final Set<String> SENSIBLE_CRITERIA = Set.of(
|
|
| 61 | + "dataLlCommonTripGroupByOcean",
|
|
| 62 | + "dataPsCommonTripGroupByOcean",
|
|
| 63 | + "dataPsCommonTripGroupByLandingHarbour"
|
|
| 64 | + );
|
|
| 53 | 65 | /**
|
| 54 | 66 | * Module groupBy helper.
|
| 55 | 67 | */
|
| ... | ... | @@ -88,6 +100,7 @@ public class BulkModifyUIModel<R extends DataDtoReference> extends AbstractJavaB |
| 88 | 100 | private ReferentialDtoReference selectedValue;
|
| 89 | 101 | |
| 90 | 102 | public BulkModifyUIModel(NavigationTreeConfig navigationTreeConfig,
|
| 103 | + boolean showSensibleCriteriaInTripBulkChanges,
|
|
| 91 | 104 | ModuleGroupByHelper moduleGroupByHelper,
|
| 92 | 105 | BusyModel busyModel,
|
| 93 | 106 | ReferencesCache referencesCache,
|
| ... | ... | @@ -96,18 +109,24 @@ public class BulkModifyUIModel<R extends DataDtoReference> extends AbstractJavaB |
| 96 | 109 | this.navigationTreeConfig = Objects.requireNonNull(navigationTreeConfig);
|
| 97 | 110 | this.moduleGroupByHelper = Objects.requireNonNull(moduleGroupByHelper);
|
| 98 | 111 | this.busyModel = Objects.requireNonNull(busyModel);
|
| 99 | - this.availableCriteria.addAll(moduleGroupByHelper.getGroupByDefinitions().stream().filter(BulkModifyUIModel::acceptCriteria).collect(Collectors.toList()));
|
|
| 112 | + this.availableCriteria.addAll(moduleGroupByHelper.getGroupByDefinitions().stream().filter(c -> acceptCriteria(c, showSensibleCriteriaInTripBulkChanges)).collect(Collectors.toList()));
|
|
| 100 | 113 | this.referencesCache = Objects.requireNonNull(referencesCache);
|
| 101 | 114 | this.data = Objects.requireNonNull(data);
|
| 102 | 115 | this.navigationCriteriaDefinition = getModuleGroupByHelper().getDefinition(navigationTreeConfig.getGroupByName());
|
| 103 | 116 | // Using the navigation tree config criteria (if possible)
|
| 104 | - if (BulkModifyUIModel.acceptCriteria(navigationCriteriaDefinition)) {
|
|
| 117 | + if (BulkModifyUIModel.acceptCriteria(navigationCriteriaDefinition, showSensibleCriteriaInTripBulkChanges)) {
|
|
| 105 | 118 | setSelectedCriteria(navigationCriteriaDefinition);
|
| 119 | + } else {
|
|
| 120 | + // otherwise use the first available criteria
|
|
| 121 | + setSelectedCriteria(availableCriteria.getElementAt(0));
|
|
| 106 | 122 | }
|
| 107 | 123 | }
|
| 108 | 124 | |
| 109 | - public static boolean acceptCriteria(DataGroupByDtoDefinition<?, ?> d) {
|
|
| 110 | - return d.isQualitative() && !d.isQualitativeWithSecondLevel();
|
|
| 125 | + public static boolean acceptCriteria(DataGroupByDtoDefinition<?, ?> d, boolean showSensibleCriteriaInTripBulkChanges) {
|
|
| 126 | + if (!d.isQualitative() || d.isQualitativeWithSecondLevel()) {
|
|
| 127 | + return false;
|
|
| 128 | + }
|
|
| 129 | + return showSensibleCriteriaInTripBulkChanges || !SENSIBLE_CRITERIA.contains(d.getName());
|
|
| 111 | 130 | }
|
| 112 | 131 | |
| 113 | 132 | public DataGroupByDtoDefinition<?, ?> getNavigationCriteriaDefinition() {
|
| ... | ... | @@ -113,6 +113,7 @@ observe.config.navigationIconsPath.description=Default navigation icons path. |
| 113 | 113 | observe.config.pg.can.migrate.description=Flat sets to true when you can migrate remote data sources
|
| 114 | 114 | observe.config.remoteDataSourceConfigurations.description=Remote data source configurations
|
| 115 | 115 | observe.config.serverDataSourceConfigurations.description=Server data source configurations
|
| 116 | +observe.config.showSensibleCriteriaInTripBulkChanges=Show sensible criteria (ocean, landing harbour, ...) in Trip bulk changes
|
|
| 116 | 117 | observe.config.showSql=Show sql
|
| 117 | 118 | observe.config.simplifiedObjectTypeSpecializedRules.description=simplified object type specialized rules
|
| 118 | 119 | observe.config.sizeMeasureType.seine.localmarket.sample=Authorized size measure type on local market
|
| ... | ... | @@ -113,6 +113,7 @@ observe.config.navigationIconsPath.description=Default navigation icons path. \# |
| 113 | 113 | observe.config.pg.can.migrate.description=Autorizar la actualización de las bases remotas (debe ser el propietario de la base)
|
| 114 | 114 | observe.config.remoteDataSourceConfigurations.description=Conexiónes a fuentes remotas
|
| 115 | 115 | observe.config.serverDataSourceConfigurations.description=Conexiones a servidores remotos
|
| 116 | +observe.config.showSensibleCriteriaInTripBulkChanges=Show sensible criteria (ocean, landing harbour, ...) in Trip bulk changes \#TODO
|
|
| 116 | 117 | observe.config.showSql=Mostrar en todas las consultas sql ejecutadas
|
| 117 | 118 | observe.config.simplifiedObjectTypeSpecializedRules.description=simplified object type specialized rules \#TODO
|
| 118 | 119 | observe.config.sizeMeasureType.seine.localmarket.sample=Authorized size measure type on local market
|
| ... | ... | @@ -113,6 +113,7 @@ observe.config.navigationIconsPath.description=Chemin vers les icônes de naviga |
| 113 | 113 | observe.config.pg.can.migrate.description=Autoriser la mise à jour des bases distantes (il faut être propriétaire de la base)
|
| 114 | 114 | observe.config.remoteDataSourceConfigurations.description=connexions à des sources distantes
|
| 115 | 115 | observe.config.serverDataSourceConfigurations.description=connexions à des serveurs distantes
|
| 116 | +observe.config.showSensibleCriteriaInTripBulkChanges=Pour autoriser la modification en masse de marées sur des criètres dit « sensibles »
|
|
| 116 | 117 | observe.config.showSql=Afficher dans les logs toutes les requêtes sql exécutées
|
| 117 | 118 | observe.config.simplifiedObjectTypeSpecializedRules.description=Liste des règles supplémentaires pour la détermination du type simplifié d'un DCP
|
| 118 | 119 | observe.config.sizeMeasureType.seine.localmarket.sample=Type de mesure autorisées pour les échantillons du marché local
|