Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
-
8d07203f
by Tony Chemit at 2022-11-10T10:54:05+01:00
-
85fa0c6a
by Tony Chemit at 2022-11-10T10:54:05+01:00
-
a7a1fbc7
by Tony Chemit at 2022-11-10T10:54:19+01:00
14 changed files:
- client/core/src/main/resources/fr/ird/observe/client/ui/ObserveCommon.jcss
- client/datasource/editor/api/src/main/i18n/getters/java.getter
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/sample/SampleContentTableUIModelStates.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/sample/actions/ResetSizeMeasureType.java
- client/datasource/editor/api/src/main/resources/fr/ird/observe/client/datasource/editor/api/content/data/sample/CommonSample.jcss
- client/datasource/editor/ps/src/main/i18n/getters/java.getter
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SampleUI.jaxx
- + client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SampleUI.jcss
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SampleUIHandler.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SampleUIModelStates.java
- core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_0.java
- core/services/i18n/src/main/i18n/translations/services_en_GB.properties
- core/services/i18n/src/main/i18n/translations/services_es_ES.properties
- core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
Changes:
| ... | ... | @@ -114,11 +114,6 @@ |
| 114 | 114 | enabled:false;
|
| 115 | 115 | }
|
| 116 | 116 | |
| 117 | -.computedDataInformation {
|
|
| 118 | - icon:{fr.ird.observe.client.util.UIHelper.getUIManagerActionIcon("data-calcule")};
|
|
| 119 | - disabledIcon:{fr.ird.observe.client.util.UIHelper.getUIManagerActionIcon("data-observe")};
|
|
| 120 | -}
|
|
| 121 | - |
|
| 122 | 117 | .showReset {
|
| 123 | 118 | showReset:true;
|
| 124 | 119 | }
|
| ... | ... | @@ -68,10 +68,6 @@ observe.data.WithDataFile.choose.title.importData |
| 68 | 68 | observe.data.WithDataFile.delete.data.file.message
|
| 69 | 69 | observe.data.message.will.delete.sub.data.type
|
| 70 | 70 | observe.data.message.will.delete.sub.data.type2
|
| 71 | -observe.data.ps.observation.Sample.length.computed.tip
|
|
| 72 | -observe.data.ps.observation.Sample.length.observed.tip
|
|
| 73 | -observe.data.ps.observation.Sample.weight.computed.tip
|
|
| 74 | -observe.data.ps.observation.Sample.weight.observed.tip
|
|
| 75 | 71 | observe.error.storage.backup.local.db
|
| 76 | 72 | observe.error.storage.close.current.db
|
| 77 | 73 | observe.error.storage.close.local.db
|
| ... | ... | @@ -281,7 +277,6 @@ observe.ui.message.db.none.loaded.tip |
| 281 | 277 | observe.ui.message.delete
|
| 282 | 278 | observe.ui.message.delete.new
|
| 283 | 279 | observe.ui.message.loaded.tip
|
| 284 | -observe.ui.message.no.species.selected
|
|
| 285 | 280 | observe.ui.message.quit.invalid.edit
|
| 286 | 281 | observe.ui.message.quit.valid.edit
|
| 287 | 282 | observe.ui.message.show.referential.usages
|
| ... | ... | @@ -23,10 +23,10 @@ package fr.ird.observe.client.datasource.editor.api.content.data.sample; |
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | 25 | import com.google.common.collect.Maps;
|
| 26 | -import fr.ird.observe.dto.data.AcquisitionMode;
|
|
| 27 | 26 | import fr.ird.observe.client.datasource.api.cache.ReferencesCache;
|
| 28 | 27 | import fr.ird.observe.client.datasource.editor.api.content.data.table.ContentTableUIModel;
|
| 29 | 28 | import fr.ird.observe.client.datasource.editor.api.content.data.table.ContentTableUIModelStates;
|
| 29 | +import fr.ird.observe.dto.data.AcquisitionMode;
|
|
| 30 | 30 | import fr.ird.observe.dto.data.ContainerChildDto;
|
| 31 | 31 | import fr.ird.observe.dto.data.DataDto;
|
| 32 | 32 | import fr.ird.observe.dto.data.ps.observation.SampleMeasureDto;
|
| ... | ... | @@ -40,12 +40,6 @@ import java.util.List; |
| 40 | 40 | import java.util.Map;
|
| 41 | 41 | import java.util.Optional;
|
| 42 | 42 | |
| 43 | -import static fr.ird.observe.client.datasource.editor.api.content.data.sample.actions.ResetSizeMeasureType.SIZE_COMPUTED_TIP;
|
|
| 44 | -import static fr.ird.observe.client.datasource.editor.api.content.data.sample.actions.ResetSizeMeasureType.SIZE_OBSERVED_TIP;
|
|
| 45 | -import static fr.ird.observe.client.datasource.editor.api.content.data.sample.actions.ResetSizeMeasureType.WEIGHT_COMPUTED_TIP;
|
|
| 46 | -import static fr.ird.observe.client.datasource.editor.api.content.data.sample.actions.ResetSizeMeasureType.WEIGHT_OBSERVED_TIP;
|
|
| 47 | -import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 48 | - |
|
| 49 | 43 | /**
|
| 50 | 44 | * Created on 08/01/2021.
|
| 51 | 45 | *
|
| ... | ... | @@ -75,14 +69,6 @@ public abstract class SampleContentTableUIModelStates<D extends DataDto, C exten |
| 75 | 69 | |
| 76 | 70 | public abstract AcquisitionMode getDefaultAcquisitionMode();
|
| 77 | 71 | |
| 78 | - public String getWeightDataTip(boolean computed) {
|
|
| 79 | - return computed ? t(WEIGHT_COMPUTED_TIP) : t(WEIGHT_OBSERVED_TIP);
|
|
| 80 | - }
|
|
| 81 | - |
|
| 82 | - public String getLengthDataTip(boolean computed) {
|
|
| 83 | - return computed ? t(SIZE_COMPUTED_TIP) : t(SIZE_OBSERVED_TIP);
|
|
| 84 | - }
|
|
| 85 | - |
|
| 86 | 72 | public SizeMeasureTypeReference getDefaultSizeMeasureType() {
|
| 87 | 73 | return defaultSizeMeasureType;
|
| 88 | 74 | }
|
| ... | ... | @@ -31,16 +31,10 @@ import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox; |
| 31 | 31 | import javax.swing.JButton;
|
| 32 | 32 | import java.awt.event.ActionEvent;
|
| 33 | 33 | |
| 34 | -import static io.ultreia.java4all.i18n.I18n.n;
|
|
| 35 | 34 | import static io.ultreia.java4all.i18n.I18n.t;
|
| 36 | 35 | |
| 37 | 36 | public class ResetSizeMeasureType<U extends ContentTableUI<?, ?, U>> extends ContentTableUIActionSupport<U> {
|
| 38 | 37 | |
| 39 | - public static final String WEIGHT_COMPUTED_TIP = n("observe.data.ps.observation.Sample.weight.computed.tip");
|
|
| 40 | - public static final String WEIGHT_OBSERVED_TIP = n("observe.data.ps.observation.Sample.weight.observed.tip");
|
|
| 41 | - public static final String SIZE_COMPUTED_TIP = n("observe.data.ps.observation.Sample.length.computed.tip");
|
|
| 42 | - public static final String SIZE_OBSERVED_TIP = n("observe.data.ps.observation.Sample.length.observed.tip");
|
|
| 43 | - public static final String NO_SPECIES_SELECTED = n("observe.ui.message.no.species.selected");
|
|
| 44 | 38 | private final FilterableComboBox<?> combo;
|
| 45 | 39 | |
| 46 | 40 | public static <U extends ContentTableUI<?, ?, U>> void install(U ui, JButton editor, FilterableComboBox<?> combo) {
|
| ... | ... | @@ -66,16 +66,6 @@ |
| 66 | 66 | focusable:false;
|
| 67 | 67 | }
|
| 68 | 68 | |
| 69 | -#lengthSourceInformation {
|
|
| 70 | - enabled: {tableEditBean.isIsLengthComputed()};
|
|
| 71 | - toolTipText:{getStates().getLengthDataTip(tableEditBean.isIsLengthComputed())};
|
|
| 72 | -}
|
|
| 73 | - |
|
| 74 | -#weightSourceInformation {
|
|
| 75 | - enabled: {tableEditBean.getAcquisitionMode() == 1 && tableEditBean.isIsWeightComputed()};
|
|
| 76 | - toolTipText:{getStates().getWeightDataTip(tableEditBean.isIsWeightComputed())};
|
|
| 77 | -}
|
|
| 78 | - |
|
| 79 | 69 | #tagNumber {
|
| 80 | 70 | enabled:{tableEditBean.getAcquisitionMode() == 1};
|
| 81 | 71 | } |
| ... | ... | @@ -29,6 +29,10 @@ observe.data.ps.observation.Catch.totalCountComputed.observed.tip |
| 29 | 29 | observe.data.ps.observation.Route.choice.create.fin.veille.activity
|
| 30 | 30 | observe.data.ps.observation.Route.choice.not.create.fin.veille.activity.and.continue
|
| 31 | 31 | observe.data.ps.observation.Route.message.need.fin.veille.activity
|
| 32 | +observe.data.ps.observation.Sample.length.computed.tip
|
|
| 33 | +observe.data.ps.observation.Sample.length.observed.tip
|
|
| 34 | +observe.data.ps.observation.Sample.weight.computed.tip
|
|
| 35 | +observe.data.ps.observation.Sample.weight.observed.tip
|
|
| 32 | 36 | observe.data.ps.observation.Set.schoolType.not.fill
|
| 33 | 37 | observe.referential.Referential.type
|
| 34 | 38 | observe.ui.action.copyCoordinate
|
| ... | ... | @@ -187,7 +187,7 @@ |
| 187 | 187 | <JPanel id="invisible">
|
| 188 | 188 | <JButton id="defaultSizeMeasureType"/>
|
| 189 | 189 | <JButton id="defaultWeightMeasureType"/>
|
| 190 | - <JButton id='lengthSourceInformation' styleClass='computedDataInformation' onActionPerformed='handler.resetIsLengthComputed()'/>
|
|
| 191 | - <JButton id='weightSourceInformation' styleClass='computedDataInformation' onActionPerformed='handler.resetIsWeightComputed()'/>
|
|
| 190 | + <JButton id='lengthSourceInformation' onActionPerformed='handler.resetIsLengthComputed()'/>
|
|
| 191 | + <JButton id='weightSourceInformation' onActionPerformed='handler.resetIsWeightComputed()'/>
|
|
| 192 | 192 | </JPanel>
|
| 193 | 193 | </fr.ird.observe.client.datasource.editor.api.content.data.table.ContentTableUI> |
| 1 | +/*-
|
|
| 2 | + * #%L
|
|
| 3 | + * ObServe Client :: DataSource :: Editor :: PS
|
|
| 4 | + * %%
|
|
| 5 | + * Copyright (C) 2008 - 2022 IRD, Ultreia.io
|
|
| 6 | + * %%
|
|
| 7 | + * This program is free software: you can redistribute it and/or modify
|
|
| 8 | + * it under the terms of the GNU General Public License as
|
|
| 9 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 10 | + * License, or (at your option) any later version.
|
|
| 11 | + *
|
|
| 12 | + * This program is distributed in the hope that it will be useful,
|
|
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 | + * GNU General Public License for more details.
|
|
| 16 | + *
|
|
| 17 | + * You should have received a copy of the GNU General Public
|
|
| 18 | + * License along with this program. If not, see
|
|
| 19 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 | + * #L%
|
|
| 21 | + */
|
|
| 22 | + |
|
| 23 | +#lengthSourceInformation {
|
|
| 24 | + enabled: {tableEditBean.isIsLengthComputed()};
|
|
| 25 | + toolTipText:{getStates().getLengthDataTip(tableEditBean.isIsLengthComputed())};
|
|
| 26 | + icon:{getStates().getSourceInformationIcon(tableEditBean.isIsLengthComputed())};
|
|
| 27 | + disabledIcon:{getStates().getSourceInformationIcon(tableEditBean.isIsLengthComputed())};
|
|
| 28 | +}
|
|
| 29 | + |
|
| 30 | +#weightSourceInformation {
|
|
| 31 | + enabled: {tableEditBean.getAcquisitionMode() == 1 && tableEditBean.isIsWeightComputed()};
|
|
| 32 | + toolTipText:{getStates().getWeightDataTip(tableEditBean.isIsWeightComputed())};
|
|
| 33 | + icon:{getStates().getSourceInformationIcon(tableEditBean.isIsWeightComputed())};
|
|
| 34 | + disabledIcon:{getStates().getSourceInformationIcon(tableEditBean.isIsWeightComputed())};
|
|
| 35 | +} |
| ... | ... | @@ -21,9 +21,9 @@ |
| 21 | 21 | */
|
| 22 | 22 | package fr.ird.observe.client.datasource.editor.ps.data.observation;
|
| 23 | 23 | |
| 24 | -import fr.ird.observe.dto.data.AcquisitionMode;
|
|
| 25 | 24 | import fr.ird.observe.client.datasource.editor.api.content.data.sample.actions.ResetSizeMeasureType;
|
| 26 | 25 | import fr.ird.observe.client.datasource.editor.api.content.data.sample.actions.ResetWeightMeasureType;
|
| 26 | +import fr.ird.observe.dto.data.AcquisitionMode;
|
|
| 27 | 27 | import fr.ird.observe.dto.data.ps.observation.SampleMeasureDto;
|
| 28 | 28 | import fr.ird.observe.dto.referential.common.SizeMeasureTypeReference;
|
| 29 | 29 | import fr.ird.observe.dto.referential.common.SpeciesReference;
|
| ... | ... | @@ -251,7 +251,9 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { |
| 251 | 251 | |
| 252 | 252 | protected void onWeightChanged(Float newValue) {
|
| 253 | 253 | SampleMeasureDto tableEditBean = ui.getModel().getStates().getTableEditBean();
|
| 254 | - tableEditBean.setIsWeightComputed(false);
|
|
| 254 | + if (tableEditBean.getAcquisitionMode() == 1) {
|
|
| 255 | + tableEditBean.setIsWeightComputed(false);
|
|
| 256 | + }
|
|
| 255 | 257 | if (newValue == null) {
|
| 256 | 258 | tableEditBean.setWeightMeasureMethod(null);
|
| 257 | 259 | }
|
| ... | ... | @@ -26,6 +26,7 @@ import fr.ird.observe.client.configuration.ClientConfig; |
| 26 | 26 | import fr.ird.observe.client.datasource.api.cache.ReferencesCache;
|
| 27 | 27 | import fr.ird.observe.client.datasource.api.cache.ReferencesFilterHelper;
|
| 28 | 28 | import fr.ird.observe.client.datasource.editor.api.content.data.sample.SampleContentTableUIModelStates;
|
| 29 | +import fr.ird.observe.client.util.UIHelper;
|
|
| 29 | 30 | import fr.ird.observe.dto.data.AcquisitionMode;
|
| 30 | 31 | import fr.ird.observe.dto.data.ps.observation.SampleDto;
|
| 31 | 32 | import fr.ird.observe.dto.data.ps.observation.SampleMeasureDto;
|
| ... | ... | @@ -35,11 +36,25 @@ import fr.ird.observe.navigation.id.Project; |
| 35 | 36 | import fr.ird.observe.services.ObserveServicesProvider;
|
| 36 | 37 | import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
|
| 37 | 38 | |
| 39 | +import javax.swing.Icon;
|
|
| 40 | + |
|
| 41 | +import static io.ultreia.java4all.i18n.I18n.n;
|
|
| 42 | +import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 43 | + |
|
| 38 | 44 | @GenerateJavaBeanDefinition
|
| 39 | 45 | public class SampleUIModelStates extends SampleContentTableUIModelStates<SampleDto, SampleMeasureDto> {
|
| 40 | 46 | |
| 47 | + public static final String WEIGHT_COMPUTED_TIP = n("observe.data.ps.observation.Sample.weight.computed.tip");
|
|
| 48 | + public static final String WEIGHT_OBSERVED_TIP = n("observe.data.ps.observation.Sample.weight.observed.tip");
|
|
| 49 | + public static final String SIZE_COMPUTED_TIP = n("observe.data.ps.observation.Sample.length.computed.tip");
|
|
| 50 | + public static final String SIZE_OBSERVED_TIP = n("observe.data.ps.observation.Sample.length.observed.tip");
|
|
| 51 | + private final Icon computedIcon;
|
|
| 52 | + private final Icon observedIcon;
|
|
| 53 | + |
|
| 41 | 54 | public SampleUIModelStates(GeneratedSampleUIModel model) {
|
| 42 | 55 | super(model, SampleDto.newDto(new java.util.Date()), SampleMeasureDto.newDto(new java.util.Date()), model.getSource().getInitializer().getSelectedId(), model.getSource().getInitializer().getScope().isStandalone());
|
| 56 | + this.computedIcon = UIHelper.getUIManagerActionIcon("data-calcule");
|
|
| 57 | + this.observedIcon = UIHelper.getUIManagerActionIcon("data-observe");
|
|
| 43 | 58 | }
|
| 44 | 59 | |
| 45 | 60 | @Override
|
| ... | ... | @@ -65,4 +80,16 @@ public class SampleUIModelStates extends SampleContentTableUIModelStates<SampleD |
| 65 | 80 | return beanToSave;
|
| 66 | 81 | }
|
| 67 | 82 | |
| 83 | + public String getWeightDataTip(boolean computed) {
|
|
| 84 | + return computed ? t(WEIGHT_COMPUTED_TIP) : t(WEIGHT_OBSERVED_TIP);
|
|
| 85 | + }
|
|
| 86 | + |
|
| 87 | + public String getLengthDataTip(boolean computed) {
|
|
| 88 | + return computed ? t(SIZE_COMPUTED_TIP) : t(SIZE_OBSERVED_TIP);
|
|
| 89 | + }
|
|
| 90 | + |
|
| 91 | + public Icon getSourceInformationIcon(boolean computed) {
|
|
| 92 | + return computed ? computedIcon : observedIcon;
|
|
| 93 | + }
|
|
| 94 | + |
|
| 68 | 95 | } |
| ... | ... | @@ -372,6 +372,10 @@ public class DataSourceMigrationForVersion_9_0 extends ByMajorMigrationVersionRe |
| 372 | 372 | this.sample_idx = resultSet.getInt(20);
|
| 373 | 373 | this.lengthMeasureMethod = resultSet.getString(21);
|
| 374 | 374 | this.weightMeasureMethod = resultSet.getString(22);
|
| 375 | + // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2503
|
|
| 376 | + if (acquisitionMode == 0 && weight != null && !isWeightComputed) {
|
|
| 377 | + isWeightComputed = true;
|
|
| 378 | + }
|
|
| 375 | 379 | }
|
| 376 | 380 | |
| 377 | 381 | }
|
| ... | ... | @@ -1634,7 +1634,7 @@ observe.referential.ps.common.ObjectMaterial.validation=Validation |
| 1634 | 1634 | observe.referential.ps.common.ObjectMaterial.validation.bad.parentCode=Code should starts with %1$s-
|
| 1635 | 1635 | observe.referential.ps.common.ObjectMaterial.validation.invalid.validation=Validation formula is not valid.
|
| 1636 | 1636 | observe.referential.ps.common.ObjectMaterial.validationInformation=Validation formula must contains variable x
|
| 1637 | -observe.referential.ps.common.ObjectMaterialType.type=Floating objet material type
|
|
| 1637 | +observe.referential.ps.common.ObjectMaterialType.type=Data type of properties/material of FOB
|
|
| 1638 | 1638 | observe.referential.ps.common.ObjectOperation.atLeastOneSelected=Domain
|
| 1639 | 1639 | observe.referential.ps.common.ObjectOperation.type=Object operation
|
| 1640 | 1640 | observe.referential.ps.common.ObjectOperation.validation.atLeastOneSelected=At least one domain must be selected.
|
| ... | ... | @@ -1634,7 +1634,7 @@ observe.referential.ps.common.ObjectMaterial.validation=Validation \#TODO |
| 1634 | 1634 | observe.referential.ps.common.ObjectMaterial.validation.bad.parentCode=Code should starts with %1$s- \#TODO
|
| 1635 | 1635 | observe.referential.ps.common.ObjectMaterial.validation.invalid.validation=La formule de validation n'est pas cohérente. \#TODO
|
| 1636 | 1636 | observe.referential.ps.common.ObjectMaterial.validationInformation=La formule de validation doit contenir la variable x \#TODO
|
| 1637 | -observe.referential.ps.common.ObjectMaterialType.type=Type d'objet flottant \#TODO
|
|
| 1637 | +observe.referential.ps.common.ObjectMaterialType.type=Data type of properties/material of FOB \#TODO
|
|
| 1638 | 1638 | observe.referential.ps.common.ObjectOperation.atLeastOneSelected=Domain
|
| 1639 | 1639 | observe.referential.ps.common.ObjectOperation.type=Operación sobre el objeto
|
| 1640 | 1640 | observe.referential.ps.common.ObjectOperation.validation.atLeastOneSelected=At least one domain must be selected.
|
| ... | ... | @@ -1634,7 +1634,7 @@ observe.referential.ps.common.ObjectMaterial.validation=Validation |
| 1634 | 1634 | observe.referential.ps.common.ObjectMaterial.validation.bad.parentCode=Le code doit commencer par %1$s-
|
| 1635 | 1635 | observe.referential.ps.common.ObjectMaterial.validation.invalid.validation=La formule de validation n'est pas cohérente.
|
| 1636 | 1636 | observe.referential.ps.common.ObjectMaterial.validationInformation=La formule de validation doit contenir la variable x
|
| 1637 | -observe.referential.ps.common.ObjectMaterialType.type=Type d'objet flottant
|
|
| 1637 | +observe.referential.ps.common.ObjectMaterialType.type=Type de données des propriétés/matériaux de FOB
|
|
| 1638 | 1638 | observe.referential.ps.common.ObjectOperation.atLeastOneSelected=Sous-domaine
|
| 1639 | 1639 | observe.referential.ps.common.ObjectOperation.type=Opération sur l'objet
|
| 1640 | 1640 | observe.referential.ps.common.ObjectOperation.validation.atLeastOneSelected=Veuillez sélectionner au moins un sous domaine.
|