Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 7d63077a by Tony Chemit at 2022-11-13T12:25:33+01:00 Rapport Liste des captures de faune accessoire selon le type de banc, filtrées par groupe - Closes #2532 - - - - - a0b62552 by Tony Chemit at 2022-11-13T12:25:37+01:00 GUI - use resetEdit state when reset entry on content table - - - - - b8a08b6b by Tony Chemit at 2022-11-13T12:25:42+01:00 GUI - Sur échantillons PS observations saisis par lots, migrés vers 9.0, valeurs étranges sur le champ poids individuel - Closes #2503 - - - - - 3 changed files: - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/actions/entry/ResetEntry.java - client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SampleUIHandler.java - core/api/dto/src/main/resources/observe-reports.properties Changes: ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/actions/entry/ResetEntry.java ===================================== @@ -59,7 +59,12 @@ public final class ResetEntry extends ContentTableUIActionSupport<ContentTableUI } } else { // reset existing entry - tableModel.resetEditBean(); + ui.getStates().setResetEdit(true); + try { + tableModel.resetEditBean(); + } finally { + ui.getStates().setResetEdit(false); + } } } ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SampleUIHandler.java ===================================== @@ -51,7 +51,7 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { * * @since 3.0 */ - private final PropertyChangeListener weightChanged; + private final PropertyChangeListener weightChanged = evt -> onWeightChanged((Float) evt.getNewValue(), !ui.getStates().isResetEdit()); /** * Ecoute les modifications de la propriété {@link SampleMeasureDto#getLength()}, @@ -60,7 +60,7 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { * * @since 3.0 */ - private final PropertyChangeListener lengthChanged; + private final PropertyChangeListener lengthChanged = evt -> onLengthChanged((Float) evt.getNewValue(), !ui.getStates().isResetEdit()); /** * Ecoute les modifications de la propriété {@link SampleMeasureDto#getLength()}, @@ -69,14 +69,7 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { * * @since 3.0 */ - private final PropertyChangeListener speciesChanged; - - public SampleUIHandler() { - weightChanged = evt -> onWeightChanged((Float) evt.getNewValue()); - lengthChanged = evt -> onLengthChanged((Float) evt.getNewValue()); - speciesChanged = evt -> onSpeciesChanged((SpeciesReference) evt.getNewValue()); - } - + private final PropertyChangeListener speciesChanged = evt -> onSpeciesChanged((SpeciesReference) evt.getNewValue()); @Override public void onInit(SampleUI ui) { @@ -97,8 +90,8 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { public void onSelectedRowChanged(SampleMeasureDto tableEditBean, SampleMeasureDto previousRowBean, boolean notPersisted, boolean newRow) { - onLengthChanged(tableEditBean.getLength()); - onWeightChanged(tableEditBean.getWeight()); + onLengthChanged(tableEditBean.getLength(), false); + onWeightChanged(tableEditBean.getWeight(), false); SampleUIModel sampleModel = getModel(); @@ -209,6 +202,9 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { } public void startEditTableEditBean(SampleMeasureDto tableEditBean) { + tableEditBean.removePropertyChangeListener(SampleMeasureDto.PROPERTY_WEIGHT, weightChanged); + tableEditBean.removePropertyChangeListener(SampleMeasureDto.PROPERTY_LENGTH, lengthChanged); + tableEditBean.removePropertyChangeListener(SampleMeasureDto.PROPERTY_SPECIES, speciesChanged); tableEditBean.addPropertyChangeListener(SampleMeasureDto.PROPERTY_WEIGHT, weightChanged); tableEditBean.addPropertyChangeListener(SampleMeasureDto.PROPERTY_LENGTH, lengthChanged); tableEditBean.addPropertyChangeListener(SampleMeasureDto.PROPERTY_SPECIES, speciesChanged); @@ -249,9 +245,9 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { acquisitionModeGroup.setSelectedValue(acquisitionMode); } - protected void onWeightChanged(Float newValue) { + protected void onWeightChanged(Float newValue, boolean realChange) { SampleMeasureDto tableEditBean = ui.getModel().getStates().getTableEditBean(); - if (tableEditBean.getAcquisitionMode() == 1) { + if (realChange && tableEditBean.getAcquisitionMode() == 1) { tableEditBean.setIsWeightComputed(false); } if (newValue == null) { @@ -259,9 +255,11 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { } } - protected void onLengthChanged(Float newValue) { + protected void onLengthChanged(Float newValue, boolean realChange) { SampleMeasureDto tableEditBean = ui.getModel().getStates().getTableEditBean(); - tableEditBean.setIsLengthComputed(false); + if (realChange) { + tableEditBean.setIsLengthComputed(false); + } if (newValue == null) { tableEditBean.setLengthMeasureMethod(null); } ===================================== core/api/dto/src/main/resources/observe-reports.properties ===================================== @@ -697,26 +697,26 @@ report.psObservationTargetDiscardedByAssociation.request.19=0,3|row|\ and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \ and os not in elements(a.observedSystem) ################################################################################ -## Captures accessoires observées +## Captures observées ################################################################################ -report.psObservationAccessoryCatch.modelType=PS -report.psObservationAccessoryCatch.name=Observations - Liste des captures accessoires selon le type de banc, filtrées par groupe -report.psObservationAccessoryCatch.description=Afficher les captures accessoires par groupe d'espèce\nLes poids sont exprimés en tonnes. -report.psObservationAccessoryCatch.columns=Espèce, Banc libre, Banc objet -report.psObservationAccessoryCatch.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code -report.psObservationAccessoryCatch.repeatVariable.speciesId=java.lang.String|\ +report.psObservationCatch.modelType=PS +report.psObservationCatch.name=Observations - Liste des captures selon le type de banc, filtrées par groupe +report.psObservationCatch.description=Afficher les captures par groupe d'espèce\nLes poids sont exprimés en tonnes. +report.psObservationCatch.columns=Espèce, Banc libre, Banc objet +report.psObservationCatch.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code +report.psObservationCatch.repeatVariable.speciesId=java.lang.String|\ Select e.id From SpeciesImpl e \ Where e.speciesGroup.id = :speciesGroup \ Order By e.homeId -report.psObservationAccessoryCatch.request.1=0,0|row|\ +report.psObservationCatch.request.1=0,0|row|\ Select \ concat('[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)) \ From SpeciesImpl e \ Where e.id = :speciesId -report.psObservationAccessoryCatch.request.1.repeat=speciesId|column -report.psObservationAccessoryCatch.request.2=1,0|row|\ +report.psObservationCatch.request.1.repeat=speciesId|column +report.psObservationCatch.request.2=1,0|row|\ Select \ case when Count(ca) > 0 then \ concat('+', \ @@ -731,8 +731,8 @@ report.psObservationAccessoryCatch.request.2=1,0|row|\ Join c.catches ca \ with ca.species.id = :speciesId \ Where m.id In :tripId -report.psObservationAccessoryCatch.request.2.repeat=speciesId|column -report.psObservationAccessoryCatch.request.3=2,0|row|\ +report.psObservationCatch.request.2.repeat=speciesId|column +report.psObservationCatch.request.3=2,0|row|\ Select \ case when Count(ca) > 0 then \ concat('+', \ @@ -747,7 +747,7 @@ report.psObservationAccessoryCatch.request.3=2,0|row|\ Join c.catches ca \ with ca.species.id = :speciesId \ Where m.id In :tripId -report.psObservationAccessoryCatch.request.3.repeat=speciesId|column +report.psObservationCatch.request.3.repeat=speciesId|column ################################################################################ ## Captures accessoires par speciesGroup d'espèces ################################################################################ View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/43773fea3548323dff3a5ea8e... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/43773fea3548323dff3a5ea8e... You're receiving this email because of your account on gitlab.com.