Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- 7199 discussions
[Git][ultreiaio/ird-observe][develop] 2 commits: Amélioration du texte d'information quand on ne peut pas encore remplir le...
by Tony CHEMIT (@tchemit) 04 Jan '23
by Tony CHEMIT (@tchemit) 04 Jan '23
04 Jan '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
3afb61ea by Tony Chemit at 2023-01-04T16:07:48+01:00
Amélioration du texte d'information quand on ne peut pas encore remplir le marché local - closes #2586
- - - - -
1dff0c00 by Tony Chemit at 2023-01-04T16:07:52+01:00
Ajout sur le formulaire d'une information sur la saisie possible ou non du marché local à partir du port d'arrivée sélectionné - closes #2590
- - - - -
14 changed files:
- client/datasource/editor/ps/src/main/i18n/getters/java.getter
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_en_GB.ftl
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_es_ES.ftl
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_fr_FR.ftl
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jcss
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUIModelStates.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripLocalMarketAcquisitionStatus.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripSupport.java
- core/api/dto-decoration/src/main/i18n/getters/labels.getter
- 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
- model/src/main/models/Observe/dto/class/i18nLabels.properties
Changes:
=====================================
client/datasource/editor/ps/src/main/i18n/getters/java.getter
=====================================
@@ -6,6 +6,8 @@ observe.Common.whenArriving
observe.Common.whenLeaving
observe.data.Activity.comment2
observe.data.message.will.delete.sub.data
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible
observe.data.ps.dcp.FloatingObjectPreset.action.add
observe.data.ps.dcp.FloatingObjectPreset.action.add.tip
observe.data.ps.dcp.FloatingObjectPreset.add.title
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_en_GB.ftl
=====================================
@@ -20,23 +20,35 @@
<html>
<body>
<p>
- To be able to acquire data of type <i>${dtoLabel}</i>, the trip form must first be completed:
+ To acquire <i>${dtoLabel}</i> data, the trip form must first be completed:
</p>
<ul>
- <li>The <i>Local market collection</i> must be filled with a value that indicate presence of data</li>
- <li>The <i>Logbook and associated data</i> tab must be properly filled</li>
+ <li>The <i>landing harbour</i> must be filled in</li>
+ <li>This harbour must have packaging reference data associated with it</li>
+ <li>The tab named <i>Logbook and associated data</i> must be properly filled in</li>
+ <li>The field named <i>Local market collection</i> must be filled in with a value that indicates existence of data</li>
</ul>
<hr/>
<br/>
<p>
- Click on <b>Access to trip form</b> to fill properly the form and save..
+ Click on <b>Access to trip form</b> to fill in properly the form and save.
</p>
<br/>
-<p>The <i>Local market collection</i> widget will be focused in the proper tab.
+<p>
+ If <i>landing harbour</i> is not filled in,
+<ul>
+ <li>Its widget will be focused in the proper tab, to enable you to fill in it</li>
+ <li>Once the landing harbour is provided, you need to fill in the tab named <i>Local market collection</i> in the proper tab</li>
+</ul>
+</p>
+<p>
+ <b>If <i>landing harbour</i> is filled in, but doesn't have packaging reference data associated associated with it, you will not be able to acquire local market data.</b>
+</p>
+<p>In other cases, the field named <i>Local market collection</i> is focused in the proper tab.
</p>
<br/>
<p>
- You can then enter the data.
+ You can then acquire <i>${dtoLabel}</i> data.
</p>
</body>
</html>
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_es_ES.ftl
=====================================
@@ -21,23 +21,35 @@
<body>
<h1>#TODO</h1>
<p>
- To be able to acquire data of type <i>${dtoLabel}</i>, the trip form must first be completed:
+ To acquire <i>${dtoLabel}</i> data, the trip form must first be completed:
</p>
<ul>
- <li>The <i>Local market collection</i> must be filled with a value that indicate presence of data</li>
- <li>The <i>Logbook and associated data</i> tab must be properly filled</li>
+ <li>The <i>landing harbour</i> must be filled in</li>
+ <li>This harbour must have packaging reference data associated with it</li>
+ <li>The tab named <i>Logbook and associated data</i> must be properly filled in</li>
+ <li>The field named <i>Local market collection</i> must be filled in with a value that indicates existence of data</li>
</ul>
<hr/>
<br/>
<p>
- Click on <b>Access to trip form</b> to fill properly the form and save..
+ Click on <b>Access to trip form</b> to fill in properly the form and save.
</p>
<br/>
-<p>The <i>Local market collection</i> widget will be focused in the proper tab.
+<p>
+ If <i>landing harbour</i> is not filled in,
+<ul>
+ <li>Its widget will be focused in the proper tab, to enable you to fill in it</li>
+ <li>Once the landing harbour is provided, you need to fill in the tab named <i>Local market collection</i> in the proper tab</li>
+</ul>
+</p>
+<p>
+ <b>If <i>landing harbour</i> is filled in, but doesn't have packaging reference data associated associated with it, you will not be able to acquire local market data.</b>
+</p>
+<p>In other cases, the field named <i>Local market collection</i> is focused in the proper tab.
</p>
<br/>
<p>
- You can then enter the data.
+ You can then acquire <i>${dtoLabel}</i> data.
</p>
</body>
</html>
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_fr_FR.ftl
=====================================
@@ -23,18 +23,30 @@
Pour pouvoir créer une donnée de type <i>${dtoLabel}</i>, le formulaire marée doit d'abord être complété :
</p>
<ul>
- <li>La valeur du champs <i>Collecte du marché local</i> doit être renseignée avec une valeur reflétant l'existence de données</li>
+ <li>Le port d'arrivée doit être renseigné</li>
+ <li>Ce port doit disposer d'un référentiel de conditionnements</li>
<li>L'onglet <i>Livre de bord et données associées</i> doit être renseigné</li>
+ <li>Le champ <i>Collecte du marché local</i> doit être renseigné avec une valeur attestant de l'existence de données</li>
</ul>
<hr/>
<br/>
<p>
- Cliquer sur <b>Accéder au formulaire marée</b> pour compléter ces données et enregistrer.
+ Cliquez sur <b>Accéder au formulaire marée</b> pour compléter ces données et enregistrer.
<p>
-<br/>
-<p> Vous serez redirigé vers l'onglet à renseigner et le champs <i>Collecte du marché local</i> sera sélectionné.
+ <br/>
+<p>
+ Si le port d'arrivée n'est pas renseigné :
+<ul>
+ <li>Vous serez redirigé vers l'onglet « Caractéristiques générales », et le champs <i>Port d'arrivée</i> sera sélectionné pour vous permettre de le saisir.</li>
+ <li>Une fois celui-ci renseigné, il vous faudra aller renseigner le champs <i>Collecte du marché local</i> sur l'onglet <i>Livre de bord et données associées</i></li>
+</ul>
+</p>
+<p>
+ <b>Si le port d'arrivée est renseigné mais que celui-ci ne dispose pas d'un référentiel de conditionnements, il ne sera pas possible de saisir des données de marché local.</b>
+</p>
+<p>Si le port d'arrivée est renseigné et dispose d'un référentiel de conditionnements, vous serez directement redirigé vers l'onglet <i>Livre de bord et données associées</i>, et le champ <i>Collecte du marché local</i> sera sélectionné pour vous permettre de le saisir.
</p>
<br/>
-<p> Vous pourrez ensuite saisir la donnée souhaitée.</p>
+<p>Vous pourrez ensuite saisir les données du <i>${dtoLabel}</i>.</p>
</body>
</html>
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jaxx
=====================================
@@ -113,6 +113,11 @@
<FilterableComboBox id='landingHarbour' genericType='HarbourReference'/>
</cell>
</row>
+ <row>
+ <cell anchor='west' columns="2">
+ <JLabel id='landingHarbourMessage' styleClass="skipI18n"/>
+ </cell>
+ </row>
<row>
<cell anchor='west'>
<JLabel id='homeIdLabel'/>
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jcss
=====================================
@@ -24,6 +24,11 @@
enabled:{!states.isUpdatingMode() || bean.isRouteObsEmpty()};
}
+#landingHarbourMessage {
+ icon:{states.getLandingHarbourMessageIcon(states.isLocalmarketPossible())};
+ text:{states.getLandingHarbourMessage(states.isLocalmarketPossible())};
+}
+
#formsUrl {
openLinkTip:"observe.data.ps.common.Trip.action.openLinkFormsUrl.tip";
}
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUIModelStates.java
=====================================
@@ -41,8 +41,11 @@ import fr.ird.observe.dto.referential.ps.logbook.WellContentStatusReference;
import fr.ird.observe.navigation.id.Project;
import fr.ird.observe.services.ObserveServicesProvider;
import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
+import io.ultreia.java4all.i18n.I18n;
import io.ultreia.java4all.util.Dates;
+import org.nuiton.jaxx.validator.swing.SwingValidatorUtil;
+import javax.swing.Icon;
import java.beans.PropertyChangeEvent;
import java.util.Date;
import java.util.Objects;
@@ -133,6 +136,20 @@ public class TripUIModelStates extends GeneratedTripUIModelStates {
firePropertyChange(PROPERTY_LOCALMARKET_POSSIBLE, oldValue, localmarketPossible);
}
+ public Icon getLandingHarbourMessageIcon(boolean localmarketPossible) {
+ if (localmarketPossible) {
+ return SwingValidatorUtil.getInfoIcon();
+ }
+ return SwingValidatorUtil.getErrorIcon();
+ }
+
+ public String getLandingHarbourMessage(boolean localmarketPossible) {
+ if (localmarketPossible) {
+ return I18n.t("observe.data.ps.common.Trip.landingHarbour.localMarketPossible");
+ }
+ return I18n.t("observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible");
+ }
+
public void setDefaultObservationValues(boolean reset) {
TripDto bean = getBean();
if (reset) {
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripLocalMarketAcquisitionStatus.java
=====================================
@@ -45,7 +45,13 @@ import java.util.Set;
public class CheckTripLocalMarketAcquisitionStatus<U extends ContentUI, D extends DataDto> extends CheckTripSupport<U, D> {
public CheckTripLocalMarketAcquisitionStatus() {
- super(Set.of(TripLocalmarketDto.class, TripBatchDto.class), TripReference::isLocalmarketEnabled, TripUI::getLogbookTab, TripUI::getLocalMarketAcquisitionStatus);
+ super(Set.of(TripLocalmarketDto.class, TripBatchDto.class),
+ TripReference::isLocalmarketEnabled,
+ TripUI::getLogbookTab,
+ TripUI::getLocalMarketAcquisitionStatus,
+ r -> r.getStates().isLocalmarketPossible(),
+ TripUI::getGeneralTab,
+ TripUI::getLandingHarbour);
}
@Override
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripSupport.java
=====================================
@@ -49,16 +49,42 @@ public abstract class CheckTripSupport<U extends ContentUI, D extends DataDto> e
private final Predicate<TripReference> tripPredicate;
private TripUINavigationNode tripNode;
- public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes, Predicate<TripReference> tripPredicate, Function<TripUI, TabInfo> getTab, Function<TripUI, FilterableComboBox<?>> getCombo) {
+ public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes,
+ Predicate<TripReference> tripPredicate,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo) {
+ super(acceptedTypes, TripUI.class, target -> SwingUtilities.invokeLater(() -> applyStrategy(target, getTab, getCombo)));
+ this.tripPredicate = Objects.requireNonNull(tripPredicate);
+ }
+
+ public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes,
+ Predicate<TripReference> tripPredicate,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo,
+ Predicate<TripUI> tripPredicate2,
+ Function<TripUI, TabInfo> getTab2,
+ Function<TripUI, FilterableComboBox<?>> getCombo2) {
super(acceptedTypes, TripUI.class, target -> SwingUtilities.invokeLater(() -> {
- TabInfo tabInfo = getTab.apply(target);
- target.selectTab(tabInfo);
- FilterableComboBox<?> comboBox = getCombo.apply(target);
- SwingUtilities.invokeLater(comboBox.getCombobox()::requestFocusInWindow);
+ if (tripPredicate2.test(target)) {
+ // the second predicate is ok, use the first behaviour
+ applyStrategy(target, getTab, getCombo);
+ } else {
+ // the second predicate is ko, use the second behaviour
+ applyStrategy(target, getTab2, getCombo2);
+ }
}));
this.tripPredicate = Objects.requireNonNull(tripPredicate);
}
+ private static void applyStrategy(TripUI target,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo) {
+ TabInfo tabInfo = getTab.apply(target);
+ target.selectTab(tabInfo);
+ FilterableComboBox<?> comboBox = getCombo.apply(target);
+ SwingUtilities.invokeLater(comboBox.getCombobox()::requestFocusInWindow);
+ }
+
@Override
public final boolean checkCanCreate(U source, Class<D> dtoType) {
TripReference reference = (TripReference) getTripNode(source).getCapability().getReference();
=====================================
core/api/dto-decoration/src/main/i18n/getters/labels.getter
=====================================
@@ -776,6 +776,9 @@ observe.data.ps.common.Trip.departureWellContentStatus
observe.data.ps.common.Trip.fishingTime
observe.data.ps.common.Trip.landingAcquisitionStatus
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket
observe.data.ps.common.Trip.landingTotalWeight
observe.data.ps.common.Trip.landingWellContentStatus
observe.data.ps.common.Trip.localMarketAcquisitionStatusLabel.tip
=====================================
core/services/i18n/src/main/i18n/translations/services_en_GB.properties
=====================================
@@ -916,6 +916,9 @@ observe.data.ps.common.Trip.fishingTime=Fishing time (h)
observe.data.ps.common.Trip.gearUseFeaturesStat=Count of vessel equipment
observe.data.ps.common.Trip.landingAcquisitionStatus=Landing sheet collection
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip=Only choices that indicate existence of data allow acquisition for landing
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible=Local market data can not be acquired using this landing harbour
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible=Local market data can be acquired using this landing harbour
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket=The landing harbour is required to acquire local market data
observe.data.ps.common.Trip.landingStat=Count of landing
observe.data.ps.common.Trip.landingTotalWeight=Landing total weight (t)
observe.data.ps.common.Trip.landingWellContentStatus=Landing well content status
=====================================
core/services/i18n/src/main/i18n/translations/services_es_ES.properties
=====================================
@@ -916,6 +916,9 @@ observe.data.ps.common.Trip.fishingTime=Heures de peche \#TODO
observe.data.ps.common.Trip.gearUseFeaturesStat=Count of vessel equipment
observe.data.ps.common.Trip.landingAcquisitionStatus=Landing sheet collection \#TODO
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip=Only choices that indicate existence of data allow acquisition for landing
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible=Local market data can not be acquired using this landing harbour \#TODO
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible=Local market data can be acquired using this landing harbour \#TODO
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket=The landing harbour is required to acquire local market data \#TODO
observe.data.ps.common.Trip.landingStat=Count of landing
observe.data.ps.common.Trip.landingTotalWeight=Total débarqué (en t) \#TODO
observe.data.ps.common.Trip.landingWellContentStatus=État de remplissage des cuves après débarquement \#TODO
=====================================
core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
=====================================
@@ -916,6 +916,9 @@ observe.data.ps.common.Trip.fishingTime=Heures de pêche
observe.data.ps.common.Trip.gearUseFeaturesStat=Nombre d'équipements
observe.data.ps.common.Trip.landingAcquisitionStatus=Collecte du bon de débarquement
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip=Seuls les choix reflétant l'existence des données permettront la collecte du bon de débarquement
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible=Il n'est pas possible de saisir des données du marché local avec le port d'arrivée sélectionné
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible=Il est possible de saisir des données du marché local avec le port d'arrivée sélectionné
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket=Il faut renseigner un port d'arrivée pour permettre la saisie des données du marché local
observe.data.ps.common.Trip.landingStat=Nombre de débarquements
observe.data.ps.common.Trip.landingTotalWeight=Total débarqué (en t)
observe.data.ps.common.Trip.landingWellContentStatus=État de remplissage des cuves après débarquement
=====================================
model/src/main/models/Observe/dto/class/i18nLabels.properties
=====================================
@@ -56,7 +56,7 @@ data.ll.observation.Tdr=basket,branchline,deploymentEnd,deploymentStart,fishingE
data.ll.observation.WeightMeasure=weight,weightMeasureType
data.ps.common.GearUseFeatures=comment,gear,gearUseFeaturesMeasurement,number,usedInTrip
data.ps.common.GearUseFeaturesMeasurement=gearCharacteristic,measurementValue
-data.ps.common.Trip=advancedSamplingAcquisitionStatus,captain,departureHarbour,departureWellContentStatus,endDate,ersId,fishingTime,formsUrl,generalComment,landingAcquisitionStatus,landingHarbour,landingTotalWeight,landingWellContentStatus,localMarketAcquisitionStatus,localMarketSurveySamplingAcquisitionStatus,localMarketTotalWeight,localMarketWellsSamplingAcquisitionStatus,loch,logbookAcquisitionStatus,logbookComment,logbookDataEntryOperator,logbookDataQuality,observationsAcquisitionStatus,observationsComment,observationsDataEntryOperator,observationsDataQuality,observer,ocean,observationsProgram,logbookProgram,reportsUrl,routeLogbook,routeObs,startDate,targetWellsSamplingAcquisitionStatus,timeAtSea,vessel,generalTab,action.openLinkFormsUrl.tip,action.openLinkReportsUrl.tip,landingAcquisitionStatusLabel.tip,localMarketAcquisitionStatusLabel.tip,localMarketSurveySamplingAcquisitionStatusLabel.tip,localMarketWellsSamplingAcquisitionStatusLabel.tip,logbookAcquisitionStatusLabel.tip,logbookTab,mapTab,observationsAcquisitionStatusLabel.tip,observationsTab,targetWellsSamplingAcquisitionStatusLabel.tip,action.create,choice.go.to.trip,list.navigation.node,list.title,message.not.open,navigation.unsaved,observationsTab,title.can.not.create.trip.sub.data,list.title,type,title,root.list.message.none,logbookDataEntryOperator.validation.required,logbookDataQuality.validation.required,logbookProgram.validation.required,observationsDataEntryOperator.validation.required,observationsProgram.validation.required,observer.validation.required
+data.ps.common.Trip=advancedSamplingAcquisitionStatus,captain,departureHarbour,departureWellContentStatus,endDate,ersId,fishingTime,formsUrl,generalComment,landingAcquisitionStatus,landingHarbour,landingTotalWeight,landingWellContentStatus,localMarketAcquisitionStatus,localMarketSurveySamplingAcquisitionStatus,localMarketTotalWeight,localMarketWellsSamplingAcquisitionStatus,loch,logbookAcquisitionStatus,logbookComment,logbookDataEntryOperator,logbookDataQuality,observationsAcquisitionStatus,observationsComment,observationsDataEntryOperator,observationsDataQuality,observer,ocean,observationsProgram,logbookProgram,reportsUrl,routeLogbook,routeObs,startDate,targetWellsSamplingAcquisitionStatus,timeAtSea,vessel,generalTab,action.openLinkFormsUrl.tip,action.openLinkReportsUrl.tip,landingAcquisitionStatusLabel.tip,localMarketAcquisitionStatusLabel.tip,localMarketSurveySamplingAcquisitionStatusLabel.tip,localMarketWellsSamplingAcquisitionStatusLabel.tip,logbookAcquisitionStatusLabel.tip,logbookTab,mapTab,observationsAcquisitionStatusLabel.tip,observationsTab,targetWellsSamplingAcquisitionStatusLabel.tip,action.create,choice.go.to.trip,list.navigation.node,list.title,message.not.open,navigation.unsaved,observationsTab,title.can.not.create.trip.sub.data,list.title,type,title,root.list.message.none,logbookDataEntryOperator.validation.required,logbookDataQuality.validation.required,logbookProgram.validation.required,observationsDataEntryOperator.validation.required,observationsProgram.validation.required,observer.validation.required,landingHarbour.localMarketPossible,landingHarbour.localMarketNotPossible,landingHarbour.requiredForLocalMarket
data.ps.common.TripGearUseFeatures=gearUseFeatures
data.ps.common.TripLocalmarket=localMarketAcquisitionStatus,localMarketSurveySamplingAcquisitionStatus,localMarketWellsSamplingAcquisitionStatus
data.ps.common.TripLogbook=logbookAcquisitionStatus,targetWellsSamplingAcquisitionStatus
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/cd506c645324609f1a9a342e…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/cd506c645324609f1a9a342e…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] 2 commits: Amélioration du texte d'information quand on ne peut pas encore remplir le...
by Tony CHEMIT (@tchemit) 04 Jan '23
by Tony CHEMIT (@tchemit) 04 Jan '23
04 Jan '23
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
fc4ee4b9 by Tony Chemit at 2023-01-04T15:11:19+01:00
Amélioration du texte d'information quand on ne peut pas encore remplir le marché local - closes #2586
- - - - -
6836cd1c by Tony Chemit at 2023-01-04T16:03:51+01:00
Ajout sur le formulaire d'une information sur la saisie possible ou non du marché local à partir du port d'arrivée sélectionné - closes #2590
- - - - -
14 changed files:
- client/datasource/editor/ps/src/main/i18n/getters/java.getter
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_en_GB.ftl
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_es_ES.ftl
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_fr_FR.ftl
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jcss
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUIModelStates.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripLocalMarketAcquisitionStatus.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripSupport.java
- core/api/dto-decoration/src/main/i18n/getters/labels.getter
- 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
- model/src/main/models/Observe/dto/class/i18nLabels.properties
Changes:
=====================================
client/datasource/editor/ps/src/main/i18n/getters/java.getter
=====================================
@@ -6,6 +6,8 @@ observe.Common.whenArriving
observe.Common.whenLeaving
observe.data.Activity.comment2
observe.data.message.will.delete.sub.data
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible
observe.data.ps.dcp.FloatingObjectPreset.action.add
observe.data.ps.dcp.FloatingObjectPreset.action.add.tip
observe.data.ps.dcp.FloatingObjectPreset.add.title
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_en_GB.ftl
=====================================
@@ -20,23 +20,35 @@
<html>
<body>
<p>
- To be able to acquire data of type <i>${dtoLabel}</i>, the trip form must first be completed:
+ To acquire <i>${dtoLabel}</i> data, the trip form must first be completed:
</p>
<ul>
- <li>The <i>Local market collection</i> must be filled with a value that indicate presence of data</li>
- <li>The <i>Logbook and associated data</i> tab must be properly filled</li>
+ <li>The <i>landing harbour</i> must be filled in</li>
+ <li>This harbour must have packaging reference data associated with it</li>
+ <li>The tab named <i>Logbook and associated data</i> must be properly filled in</li>
+ <li>The field named <i>Local market collection</i> must be filled in with a value that indicates existence of data</li>
</ul>
<hr/>
<br/>
<p>
- Click on <b>Access to trip form</b> to fill properly the form and save..
+ Click on <b>Access to trip form</b> to fill in properly the form and save.
</p>
<br/>
-<p>The <i>Local market collection</i> widget will be focused in the proper tab.
+<p>
+ If <i>landing harbour</i> is not filled in,
+<ul>
+ <li>Its widget will be focused in the proper tab, to enable you to fill in it</li>
+ <li>Once the landing harbour is provided, you need to fill in the tab named <i>Local market collection</i> in the proper tab</li>
+</ul>
+</p>
+<p>
+ <b>If <i>landing harbour</i> is filled in, but doesn't have packaging reference data associated associated with it, you will not be able to acquire local market data.</b>
+</p>
+<p>In other cases, the field named <i>Local market collection</i> is focused in the proper tab.
</p>
<br/>
<p>
- You can then enter the data.
+ You can then acquire <i>${dtoLabel}</i> data.
</p>
</body>
</html>
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_es_ES.ftl
=====================================
@@ -21,23 +21,35 @@
<body>
<h1>#TODO</h1>
<p>
- To be able to acquire data of type <i>${dtoLabel}</i>, the trip form must first be completed:
+ To acquire <i>${dtoLabel}</i> data, the trip form must first be completed:
</p>
<ul>
- <li>The <i>Local market collection</i> must be filled with a value that indicate presence of data</li>
- <li>The <i>Logbook and associated data</i> tab must be properly filled</li>
+ <li>The <i>landing harbour</i> must be filled in</li>
+ <li>This harbour must have packaging reference data associated with it</li>
+ <li>The tab named <i>Logbook and associated data</i> must be properly filled in</li>
+ <li>The field named <i>Local market collection</i> must be filled in with a value that indicates existence of data</li>
</ul>
<hr/>
<br/>
<p>
- Click on <b>Access to trip form</b> to fill properly the form and save..
+ Click on <b>Access to trip form</b> to fill in properly the form and save.
</p>
<br/>
-<p>The <i>Local market collection</i> widget will be focused in the proper tab.
+<p>
+ If <i>landing harbour</i> is not filled in,
+<ul>
+ <li>Its widget will be focused in the proper tab, to enable you to fill in it</li>
+ <li>Once the landing harbour is provided, you need to fill in the tab named <i>Local market collection</i> in the proper tab</li>
+</ul>
+</p>
+<p>
+ <b>If <i>landing harbour</i> is filled in, but doesn't have packaging reference data associated associated with it, you will not be able to acquire local market data.</b>
+</p>
+<p>In other cases, the field named <i>Local market collection</i> is focused in the proper tab.
</p>
<br/>
<p>
- You can then enter the data.
+ You can then acquire <i>${dtoLabel}</i> data.
</p>
</body>
</html>
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_fr_FR.ftl
=====================================
@@ -23,18 +23,30 @@
Pour pouvoir créer une donnée de type <i>${dtoLabel}</i>, le formulaire marée doit d'abord être complété :
</p>
<ul>
- <li>La valeur du champs <i>Collecte du marché local</i> doit être renseignée avec une valeur reflétant l'existence de données</li>
+ <li>Le port d'arrivée doit être renseigné</li>
+ <li>Ce port doit disposer d'un référentiel de conditionnements</li>
<li>L'onglet <i>Livre de bord et données associées</i> doit être renseigné</li>
+ <li>Le champ <i>Collecte du marché local</i> doit être renseigné avec une valeur attestant de l'existence de données</li>
</ul>
<hr/>
<br/>
<p>
- Cliquer sur <b>Accéder au formulaire marée</b> pour compléter ces données et enregistrer.
+ Cliquez sur <b>Accéder au formulaire marée</b> pour compléter ces données et enregistrer.
<p>
-<br/>
-<p> Vous serez redirigé vers l'onglet à renseigner et le champs <i>Collecte du marché local</i> sera sélectionné.
+ <br/>
+<p>
+ Si le port d'arrivée n'est pas renseigné :
+<ul>
+ <li>Vous serez redirigé vers l'onglet « Caractéristiques générales », et le champs <i>Port d'arrivée</i> sera sélectionné pour vous permettre de le saisir.</li>
+ <li>Une fois celui-ci renseigné, il vous faudra aller renseigner le champs <i>Collecte du marché local</i> sur l'onglet <i>Livre de bord et données associées</i></li>
+</ul>
+</p>
+<p>
+ <b>Si le port d'arrivée est renseigné mais que celui-ci ne dispose pas d'un référentiel de conditionnements, il ne sera pas possible de saisir des données de marché local.</b>
+</p>
+<p>Si le port d'arrivée est renseigné et dispose d'un référentiel de conditionnements, vous serez directement redirigé vers l'onglet <i>Livre de bord et données associées</i>, et le champ <i>Collecte du marché local</i> sera sélectionné pour vous permettre de le saisir.
</p>
<br/>
-<p> Vous pourrez ensuite saisir la donnée souhaitée.</p>
+<p>Vous pourrez ensuite saisir les données du <i>${dtoLabel}</i>.</p>
</body>
</html>
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jaxx
=====================================
@@ -113,6 +113,11 @@
<FilterableComboBox id='landingHarbour' genericType='HarbourReference'/>
</cell>
</row>
+ <row>
+ <cell anchor='west' columns="2">
+ <JLabel id='landingHarbourMessage' styleClass="skipI18n"/>
+ </cell>
+ </row>
<row>
<cell anchor='west'>
<JLabel id='homeIdLabel'/>
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jcss
=====================================
@@ -24,6 +24,11 @@
enabled:{!states.isUpdatingMode() || bean.isRouteObsEmpty()};
}
+#landingHarbourMessage {
+ icon:{states.getLandingHarbourMessageIcon(states.isLocalmarketPossible())};
+ text:{states.getLandingHarbourMessage(states.isLocalmarketPossible())};
+}
+
#formsUrl {
openLinkTip:"observe.data.ps.common.Trip.action.openLinkFormsUrl.tip";
}
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUIModelStates.java
=====================================
@@ -41,8 +41,11 @@ import fr.ird.observe.dto.referential.ps.logbook.WellContentStatusReference;
import fr.ird.observe.navigation.id.Project;
import fr.ird.observe.services.ObserveServicesProvider;
import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
+import io.ultreia.java4all.i18n.I18n;
import io.ultreia.java4all.util.Dates;
+import org.nuiton.jaxx.validator.swing.SwingValidatorUtil;
+import javax.swing.Icon;
import java.beans.PropertyChangeEvent;
import java.util.Date;
import java.util.Objects;
@@ -133,6 +136,20 @@ public class TripUIModelStates extends GeneratedTripUIModelStates {
firePropertyChange(PROPERTY_LOCALMARKET_POSSIBLE, oldValue, localmarketPossible);
}
+ public Icon getLandingHarbourMessageIcon(boolean localmarketPossible) {
+ if (localmarketPossible) {
+ return SwingValidatorUtil.getInfoIcon();
+ }
+ return SwingValidatorUtil.getErrorIcon();
+ }
+
+ public String getLandingHarbourMessage(boolean localmarketPossible) {
+ if (localmarketPossible) {
+ return I18n.t("observe.data.ps.common.Trip.landingHarbour.localMarketPossible");
+ }
+ return I18n.t("observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible");
+ }
+
public void setDefaultObservationValues(boolean reset) {
TripDto bean = getBean();
if (reset) {
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripLocalMarketAcquisitionStatus.java
=====================================
@@ -45,7 +45,13 @@ import java.util.Set;
public class CheckTripLocalMarketAcquisitionStatus<U extends ContentUI, D extends DataDto> extends CheckTripSupport<U, D> {
public CheckTripLocalMarketAcquisitionStatus() {
- super(Set.of(TripLocalmarketDto.class, TripBatchDto.class), TripReference::isLocalmarketEnabled, TripUI::getLogbookTab, TripUI::getLocalMarketAcquisitionStatus);
+ super(Set.of(TripLocalmarketDto.class, TripBatchDto.class),
+ TripReference::isLocalmarketEnabled,
+ TripUI::getLogbookTab,
+ TripUI::getLocalMarketAcquisitionStatus,
+ r -> r.getStates().isLocalmarketPossible(),
+ TripUI::getGeneralTab,
+ TripUI::getLandingHarbour);
}
@Override
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripSupport.java
=====================================
@@ -49,16 +49,42 @@ public abstract class CheckTripSupport<U extends ContentUI, D extends DataDto> e
private final Predicate<TripReference> tripPredicate;
private TripUINavigationNode tripNode;
- public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes, Predicate<TripReference> tripPredicate, Function<TripUI, TabInfo> getTab, Function<TripUI, FilterableComboBox<?>> getCombo) {
+ public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes,
+ Predicate<TripReference> tripPredicate,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo) {
+ super(acceptedTypes, TripUI.class, target -> SwingUtilities.invokeLater(() -> applyStrategy(target, getTab, getCombo)));
+ this.tripPredicate = Objects.requireNonNull(tripPredicate);
+ }
+
+ public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes,
+ Predicate<TripReference> tripPredicate,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo,
+ Predicate<TripUI> tripPredicate2,
+ Function<TripUI, TabInfo> getTab2,
+ Function<TripUI, FilterableComboBox<?>> getCombo2) {
super(acceptedTypes, TripUI.class, target -> SwingUtilities.invokeLater(() -> {
- TabInfo tabInfo = getTab.apply(target);
- target.selectTab(tabInfo);
- FilterableComboBox<?> comboBox = getCombo.apply(target);
- SwingUtilities.invokeLater(comboBox.getCombobox()::requestFocusInWindow);
+ if (tripPredicate2.test(target)) {
+ // the second predicate is ok, use the first behaviour
+ applyStrategy(target, getTab, getCombo);
+ } else {
+ // the second predicate is ko, use the second behaviour
+ applyStrategy(target, getTab2, getCombo2);
+ }
}));
this.tripPredicate = Objects.requireNonNull(tripPredicate);
}
+ private static void applyStrategy(TripUI target,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo) {
+ TabInfo tabInfo = getTab.apply(target);
+ target.selectTab(tabInfo);
+ FilterableComboBox<?> comboBox = getCombo.apply(target);
+ SwingUtilities.invokeLater(comboBox.getCombobox()::requestFocusInWindow);
+ }
+
@Override
public final boolean checkCanCreate(U source, Class<D> dtoType) {
TripReference reference = (TripReference) getTripNode(source).getCapability().getReference();
=====================================
core/api/dto-decoration/src/main/i18n/getters/labels.getter
=====================================
@@ -776,6 +776,9 @@ observe.data.ps.common.Trip.departureWellContentStatus
observe.data.ps.common.Trip.fishingTime
observe.data.ps.common.Trip.landingAcquisitionStatus
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket
observe.data.ps.common.Trip.landingTotalWeight
observe.data.ps.common.Trip.landingWellContentStatus
observe.data.ps.common.Trip.localMarketAcquisitionStatusLabel.tip
=====================================
core/services/i18n/src/main/i18n/translations/services_en_GB.properties
=====================================
@@ -916,6 +916,9 @@ observe.data.ps.common.Trip.fishingTime=Fishing time (h)
observe.data.ps.common.Trip.gearUseFeaturesStat=Count of vessel equipment
observe.data.ps.common.Trip.landingAcquisitionStatus=Landing sheet collection
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip=Only choices that indicate existence of data allow acquisition for landing
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible=Local market data can not be acquired using this landing harbour
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible=Local market data can be acquired using this landing harbour
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket=The landing harbour is required to acquire local market data
observe.data.ps.common.Trip.landingStat=Count of landing
observe.data.ps.common.Trip.landingTotalWeight=Landing total weight (t)
observe.data.ps.common.Trip.landingWellContentStatus=Landing well content status
=====================================
core/services/i18n/src/main/i18n/translations/services_es_ES.properties
=====================================
@@ -916,6 +916,9 @@ observe.data.ps.common.Trip.fishingTime=Heures de peche \#TODO
observe.data.ps.common.Trip.gearUseFeaturesStat=Count of vessel equipment
observe.data.ps.common.Trip.landingAcquisitionStatus=Landing sheet collection \#TODO
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip=Only choices that indicate existence of data allow acquisition for landing
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible=Local market data can not be acquired using this landing harbour \#TODO
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible=Local market data can be acquired using this landing harbour \#TODO
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket=The landing harbour is required to acquire local market data \#TODO
observe.data.ps.common.Trip.landingStat=Count of landing
observe.data.ps.common.Trip.landingTotalWeight=Total débarqué (en t) \#TODO
observe.data.ps.common.Trip.landingWellContentStatus=État de remplissage des cuves après débarquement \#TODO
=====================================
core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
=====================================
@@ -916,6 +916,9 @@ observe.data.ps.common.Trip.fishingTime=Heures de pêche
observe.data.ps.common.Trip.gearUseFeaturesStat=Nombre d'équipements
observe.data.ps.common.Trip.landingAcquisitionStatus=Collecte du bon de débarquement
observe.data.ps.common.Trip.landingAcquisitionStatusLabel.tip=Seuls les choix reflétant l'existence des données permettront la collecte du bon de débarquement
+observe.data.ps.common.Trip.landingHarbour.localMarketNotPossible=Il n'est pas possible de saisir des données du marché local avec le port d'arrivée sélectionné
+observe.data.ps.common.Trip.landingHarbour.localMarketPossible=Il est possible de saisir des données du marché local avec le port d'arrivée sélectionné
+observe.data.ps.common.Trip.landingHarbour.requiredForLocalMarket=Il faut renseigner un port d'arrivée pour permettre la saisie des données du marché local
observe.data.ps.common.Trip.landingStat=Nombre de débarquements
observe.data.ps.common.Trip.landingTotalWeight=Total débarqué (en t)
observe.data.ps.common.Trip.landingWellContentStatus=État de remplissage des cuves après débarquement
=====================================
model/src/main/models/Observe/dto/class/i18nLabels.properties
=====================================
@@ -56,7 +56,7 @@ data.ll.observation.Tdr=basket,branchline,deploymentEnd,deploymentStart,fishingE
data.ll.observation.WeightMeasure=weight,weightMeasureType
data.ps.common.GearUseFeatures=comment,gear,gearUseFeaturesMeasurement,number,usedInTrip
data.ps.common.GearUseFeaturesMeasurement=gearCharacteristic,measurementValue
-data.ps.common.Trip=advancedSamplingAcquisitionStatus,captain,departureHarbour,departureWellContentStatus,endDate,ersId,fishingTime,formsUrl,generalComment,landingAcquisitionStatus,landingHarbour,landingTotalWeight,landingWellContentStatus,localMarketAcquisitionStatus,localMarketSurveySamplingAcquisitionStatus,localMarketTotalWeight,localMarketWellsSamplingAcquisitionStatus,loch,logbookAcquisitionStatus,logbookComment,logbookDataEntryOperator,logbookDataQuality,observationsAcquisitionStatus,observationsComment,observationsDataEntryOperator,observationsDataQuality,observer,ocean,observationsProgram,logbookProgram,reportsUrl,routeLogbook,routeObs,startDate,targetWellsSamplingAcquisitionStatus,timeAtSea,vessel,generalTab,action.openLinkFormsUrl.tip,action.openLinkReportsUrl.tip,landingAcquisitionStatusLabel.tip,localMarketAcquisitionStatusLabel.tip,localMarketSurveySamplingAcquisitionStatusLabel.tip,localMarketWellsSamplingAcquisitionStatusLabel.tip,logbookAcquisitionStatusLabel.tip,logbookTab,mapTab,observationsAcquisitionStatusLabel.tip,observationsTab,targetWellsSamplingAcquisitionStatusLabel.tip,action.create,choice.go.to.trip,list.navigation.node,list.title,message.not.open,navigation.unsaved,observationsTab,title.can.not.create.trip.sub.data,list.title,type,title,root.list.message.none,logbookDataEntryOperator.validation.required,logbookDataQuality.validation.required,logbookProgram.validation.required,observationsDataEntryOperator.validation.required,observationsProgram.validation.required,observer.validation.required
+data.ps.common.Trip=advancedSamplingAcquisitionStatus,captain,departureHarbour,departureWellContentStatus,endDate,ersId,fishingTime,formsUrl,generalComment,landingAcquisitionStatus,landingHarbour,landingTotalWeight,landingWellContentStatus,localMarketAcquisitionStatus,localMarketSurveySamplingAcquisitionStatus,localMarketTotalWeight,localMarketWellsSamplingAcquisitionStatus,loch,logbookAcquisitionStatus,logbookComment,logbookDataEntryOperator,logbookDataQuality,observationsAcquisitionStatus,observationsComment,observationsDataEntryOperator,observationsDataQuality,observer,ocean,observationsProgram,logbookProgram,reportsUrl,routeLogbook,routeObs,startDate,targetWellsSamplingAcquisitionStatus,timeAtSea,vessel,generalTab,action.openLinkFormsUrl.tip,action.openLinkReportsUrl.tip,landingAcquisitionStatusLabel.tip,localMarketAcquisitionStatusLabel.tip,localMarketSurveySamplingAcquisitionStatusLabel.tip,localMarketWellsSamplingAcquisitionStatusLabel.tip,logbookAcquisitionStatusLabel.tip,logbookTab,mapTab,observationsAcquisitionStatusLabel.tip,observationsTab,targetWellsSamplingAcquisitionStatusLabel.tip,action.create,choice.go.to.trip,list.navigation.node,list.title,message.not.open,navigation.unsaved,observationsTab,title.can.not.create.trip.sub.data,list.title,type,title,root.list.message.none,logbookDataEntryOperator.validation.required,logbookDataQuality.validation.required,logbookProgram.validation.required,observationsDataEntryOperator.validation.required,observationsProgram.validation.required,observer.validation.required,landingHarbour.localMarketPossible,landingHarbour.localMarketNotPossible,landingHarbour.requiredForLocalMarket
data.ps.common.TripGearUseFeatures=gearUseFeatures
data.ps.common.TripLocalmarket=localMarketAcquisitionStatus,localMarketSurveySamplingAcquisitionStatus,localMarketWellsSamplingAcquisitionStatus
data.ps.common.TripLogbook=logbookAcquisitionStatus,targetWellsSamplingAcquisitionStatus
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/ba70fbc5555f2f90d95de241…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/ba70fbc5555f2f90d95de241…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] Amélioration du texte d'information quand on ne peut pas encore remplir le...
by Tony CHEMIT (@tchemit) 04 Jan '23
by Tony CHEMIT (@tchemit) 04 Jan '23
04 Jan '23
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
ba70fbc5 by Tony Chemit at 2023-01-04T14:13:55+01:00
Amélioration du texte d'information quand on ne peut pas encore remplir le marché local - closes #2586
- - - - -
5 changed files:
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_en_GB.ftl
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_es_ES.ftl
- client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_fr_FR.ftl
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripLocalMarketAcquisitionStatus.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripSupport.java
Changes:
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_en_GB.ftl
=====================================
@@ -23,6 +23,7 @@
To be able to acquire data of type <i>${dtoLabel}</i>, the trip form must first be completed:
</p>
<ul>
+ <li>The <i>landing harbour</i> must be filled (<i>with a packaging referential filled</i>)</li>
<li>The <i>Local market collection</i> must be filled with a value that indicate presence of data</li>
<li>The <i>Logbook and associated data</i> tab must be properly filled</li>
</ul>
@@ -32,7 +33,17 @@
Click on <b>Access to trip form</b> to fill properly the form and save..
</p>
<br/>
-<p>The <i>Local market collection</i> widget will be focused in the proper tab.
+<p>
+ If <i>landing harbour</i> is not filled,
+ <ul>
+ <li>his widget will be focused in the proper tab</li>
+ <li>once the landing harbour filled (<i>with a packaging referential filled</i>, you will need to fill the <i>Local market collection</i> in the proper tab</li>
+</ul>
+</p>
+<p>
+ <b>If <i>landing harbour</i> is filled, but with no <i>packaging referential filled</i>, you will not be able to add local market data.</b>
+</p>
+<p>In other cases, the <i>Local market collection</i> widget will be focused in the proper tab.
</p>
<br/>
<p>
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_es_ES.ftl
=====================================
@@ -24,6 +24,7 @@
To be able to acquire data of type <i>${dtoLabel}</i>, the trip form must first be completed:
</p>
<ul>
+ <li>The <i>landing harbour</i> must be filled (<i>with a packaging referential filled</i>)</li>
<li>The <i>Local market collection</i> must be filled with a value that indicate presence of data</li>
<li>The <i>Logbook and associated data</i> tab must be properly filled</li>
</ul>
@@ -33,7 +34,17 @@
Click on <b>Access to trip form</b> to fill properly the form and save..
</p>
<br/>
-<p>The <i>Local market collection</i> widget will be focused in the proper tab.
+<p>
+ If <i>landing harbour</i> is not filled,
+<ul>
+ <li>his widget will be focused in the proper tab</li>
+ <li>once the landing harbour filled (<i>with a packaging referential filled</i>, you will need to fill the <i>Local market collection</i> in the proper tab</li>
+</ul>
+</p>
+<p>
+ <b>If <i>landing harbour</i> is filled, but with no <i>packaging referential filled</i>, you will not be able to add local market data.</b>
+</p>
+<p>In other cases, the <i>Local market collection</i> widget will be focused in the proper tab.
</p>
<br/>
<p>
=====================================
client/datasource/editor/ps/src/main/i18n/templates/checkPsTripLocalMarketAcquisitionStatus_fr_FR.ftl
=====================================
@@ -23,6 +23,7 @@
Pour pouvoir créer une donnée de type <i>${dtoLabel}</i>, le formulaire marée doit d'abord être complété :
</p>
<ul>
+ <li>Le port d'arrivée doit être renseigné (<i>avec un référentiel de conditionnements remplis)</i></li>
<li>La valeur du champs <i>Collecte du marché local</i> doit être renseignée avec une valeur reflétant l'existence de données</li>
<li>L'onglet <i>Livre de bord et données associées</i> doit être renseigné</li>
</ul>
@@ -32,7 +33,17 @@
Cliquer sur <b>Accéder au formulaire marée</b> pour compléter ces données et enregistrer.
<p>
<br/>
-<p> Vous serez redirigé vers l'onglet à renseigner et le champs <i>Collecte du marché local</i> sera sélectionné.
+<p>
+ Si le port d'arrivée n'est pas renseigné,
+ <ul>
+ <li>vous serez redirigé vers l'onglet « général » et le champs <i>Port d'arrivée</i> sera sélectionné.</li>
+ <li>une fois celui-ci renseigné (<i>avec un référentiel de conditionnements remplis)</i>, il vous faudra aller renseigner le champs <i>Collecte du marché local</i> dans l'onglet dédié</li>
+</ul>
+</p>
+<p>
+ <b>Si le port d'arrivée est renseigné mais que celui-ci ne possède pas de référentiel de conditionnements remplis, il n'est pas possible de saisir des données du marché local.</b>
+</p>
+<p>Si le port d'arrivée est renseigné (avec un référentiel de conditionnements remplis), vous serez redirigé vers l'onglet à renseigner et le champs <i>Collecte du marché local</i> sera sélectionné.
</p>
<br/>
<p> Vous pourrez ensuite saisir la donnée souhaitée.</p>
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripLocalMarketAcquisitionStatus.java
=====================================
@@ -45,7 +45,13 @@ import java.util.Set;
public class CheckTripLocalMarketAcquisitionStatus<U extends ContentUI, D extends DataDto> extends CheckTripSupport<U, D> {
public CheckTripLocalMarketAcquisitionStatus() {
- super(Set.of(TripLocalmarketDto.class, TripBatchDto.class), TripReference::isLocalmarketEnabled, TripUI::getLogbookTab, TripUI::getLocalMarketAcquisitionStatus);
+ super(Set.of(TripLocalmarketDto.class, TripBatchDto.class),
+ TripReference::isLocalmarketEnabled,
+ TripUI::getLogbookTab,
+ TripUI::getLocalMarketAcquisitionStatus,
+ r -> r.getStates().isLocalmarketPossible(),
+ TripUI::getGeneralTab,
+ TripUI::getLandingHarbour);
}
@Override
=====================================
client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/predicates/CheckTripSupport.java
=====================================
@@ -49,16 +49,42 @@ public abstract class CheckTripSupport<U extends ContentUI, D extends DataDto> e
private final Predicate<TripReference> tripPredicate;
private TripUINavigationNode tripNode;
- public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes, Predicate<TripReference> tripPredicate, Function<TripUI, TabInfo> getTab, Function<TripUI, FilterableComboBox<?>> getCombo) {
+ public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes,
+ Predicate<TripReference> tripPredicate,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo) {
+ super(acceptedTypes, TripUI.class, target -> SwingUtilities.invokeLater(() -> applyStrategy(target, getTab, getCombo)));
+ this.tripPredicate = Objects.requireNonNull(tripPredicate);
+ }
+
+ public CheckTripSupport(Set<Class<? extends DataDto>> acceptedTypes,
+ Predicate<TripReference> tripPredicate,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo,
+ Predicate<TripUI> tripPredicate2,
+ Function<TripUI, TabInfo> getTab2,
+ Function<TripUI, FilterableComboBox<?>> getCombo2) {
super(acceptedTypes, TripUI.class, target -> SwingUtilities.invokeLater(() -> {
- TabInfo tabInfo = getTab.apply(target);
- target.selectTab(tabInfo);
- FilterableComboBox<?> comboBox = getCombo.apply(target);
- SwingUtilities.invokeLater(comboBox.getCombobox()::requestFocusInWindow);
+ if (tripPredicate2.test(target)) {
+ // the second predicate is ok, use the first behaviour
+ applyStrategy(target, getTab, getCombo);
+ } else {
+ // the second predicate is ko, use the second behaviour
+ applyStrategy(target, getTab2, getCombo2);
+ }
}));
this.tripPredicate = Objects.requireNonNull(tripPredicate);
}
+ private static void applyStrategy(TripUI target,
+ Function<TripUI, TabInfo> getTab,
+ Function<TripUI, FilterableComboBox<?>> getCombo) {
+ TabInfo tabInfo = getTab.apply(target);
+ target.selectTab(tabInfo);
+ FilterableComboBox<?> comboBox = getCombo.apply(target);
+ SwingUtilities.invokeLater(comboBox.getCombobox()::requestFocusInWindow);
+ }
+
@Override
public final boolean checkCanCreate(U source, Class<D> dtoType) {
TripReference reference = (TripReference) getTripNode(source).getCapability().getReference();
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/ba70fbc5555f2f90d95de241e…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/ba70fbc5555f2f90d95de241e…
You're receiving this email because of your account on gitlab.com.
1
0
03 Jan '23
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
1cec9150 by Tony Chemit at 2023-01-03T19:37:33+01:00
update pom
- - - - -
1 changed file:
- pom.xml
Changes:
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2022.102</version>
+ <version>2023.1</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/1cec915024d557475bf98eda2…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/1cec915024d557475bf98eda2…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
cd506c64 by Tony Chemit at 2023-01-03T19:34:07+01:00
update pom
- - - - -
1 changed file:
- pom.xml
Changes:
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2022.102</version>
+ <version>2023.1</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/cd506c645324609f1a9a342e7…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/cd506c645324609f1a9a342e7…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] 5 commits: Lors de la suppression gloable d'une capture utilisée sur le formulaire...
by Tony CHEMIT (@tchemit) 03 Jan '23
by Tony CHEMIT (@tchemit) 03 Jan '23
03 Jan '23
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
d8016878 by Tony Chemit at 2023-01-03T14:29:48+01:00
Lors de la suppression gloable d'une capture utilisée sur le formulaire espèces sensibles, la demande de confirmation n'est pas proposée (mais elle l'est bien si l'espèce est utilisée dans un échantillon) - Closes #2580
- - - - -
cf5d1c5b by Tony Chemit at 2023-01-03T18:35:10+01:00
Imperfection de la validation sur une activité de pêche - Closes #2581
- - - - -
5662c2b9 by Tony Chemit at 2023-01-03T18:35:10+01:00
Après création d'une activité, le nœud captures n'apparaît pas - Closes #2582
- - - - -
395dc4e4 by Tony Chemit at 2023-01-03T18:35:10+01:00
Les activités ne sont pas disponibles lors de la création d'un échantillon (mais disponible en mode mis à jour) - Closes #2584
- - - - -
a4c18864 by Tony Chemit at 2023-01-03T18:35:10+01:00
Problème sur la sauvegarde d'un échantillon (si on lui associe des activités) - Closes #2585
- - - - -
14 changed files:
- client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/CapabilityDescriptor.java
- core/api/dto/src/main/java/fr/ird/observe/dto/data/ps/observation/SetCatchDto.java
- core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-update-error-validation.xml
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/SampleSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetCatchSpi.java
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-create.json
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-update.json
- model/src/main/models/Observe/dto/attribute/notNullIf.properties
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create.json
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update.json
Changes:
=====================================
client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/CapabilityDescriptor.java
=====================================
@@ -388,7 +388,7 @@ public class CapabilityDescriptor {
switch (capacityNodeType) {
case STATIC_WITH_PREDICATE: {
String beanPropertyName = getOptionalPredicate().orElseThrow();
- return String.format(" .onPredicate(d-> d.is%1$s() && d.get%2$sStatValue() > 0, %3$s.class)\n", beanPropertyName, Strings.removeEnd(beanPropertyName,"Enabled"), getNodeTypeSimpleName());
+ return String.format(" .onPredicate(%1$s::is%2$s, %3$s.class)\n", mainDtoType.getSimpleName(), beanPropertyName, getNodeTypeSimpleName());
}
case REFERENCE_LIST:
case REFERENCE: {
=====================================
core/api/dto/src/main/java/fr/ird/observe/dto/data/ps/observation/SetCatchDto.java
=====================================
@@ -53,7 +53,7 @@ public class SetCatchDto extends GeneratedSetCatchDto {
* @return set of unsafe species used in catches
*/
public Set<SpeciesReference> getUnsafeSpecies() {
- return getCatches().stream().filter(CatchDto::isHasSample).map(CatchDto::getSpecies).collect(Collectors.toSet());
+ return getCatches().stream().filter(c -> c.isHasSample() || c.isHasRelease()).map(CatchDto::getSpecies).collect(Collectors.toSet());
}
/**
=====================================
core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
=====================================
@@ -9666,7 +9666,7 @@
"name": "schoolType",
"comments": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
]
},
{
@@ -9939,7 +9939,7 @@
"name": "schoolType",
"comments": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
]
},
{
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-create-error-validation.xml
=====================================
@@ -236,9 +236,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-update-error-validation.xml
=====================================
@@ -236,9 +236,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/SampleSpi.java
=====================================
@@ -29,6 +29,7 @@ import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.entities.data.ps.common.Trip;
import fr.ird.observe.entities.referential.ps.common.SampleType;
import fr.ird.observe.entities.referential.ps.logbook.SampleQuality;
+import fr.ird.observe.services.service.SaveResultDto;
import fr.ird.observe.spi.service.ServiceContext;
import java.util.Objects;
@@ -63,7 +64,9 @@ public class SampleSpi extends GeneratedSampleSpi {
preCreated.setSampleType(SampleType.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_SAMPLE_DEFAULT_SAMPLE_TYPE_ID));
preCreated.setSampleQuality(SampleQuality.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_SAMPLE_DEFAULT_SAMPLE_QUALITY_ID));
preCreated.setSuperSample(false);
- return super.preCreate(context, parent, preCreated);
+ Form<SampleDto> form = super.preCreate(context, parent, preCreated);
+ form.getObject().setActivity(Trip.SPI.getLogbookSetActivities(context, parent.getTopiaId()));
+ return form;
}
@Override
@@ -90,6 +93,13 @@ public class SampleSpi extends GeneratedSampleSpi {
private int getSampleSpeciesSubNumber(Sample entity) {
return (int) entity.getSampleSpecies().stream().mapToInt(SampleSpecies::getSubSampleNumber).distinct().count();
}
+
+ @Override
+ protected SaveResultDto saveEntity(ServiceContext context, Trip parent, Sample entity) {
+ SampleActivity.SPI.initId(context, entity.getSampleActivity());
+ return super.saveEntity(context, parent, entity);
+ }
+
//FIXME Add a callback in MoveRequest
// @Override
// public void moveCallback(Trip oldParent, Trip newParent, List<Sample> moved) {
=====================================
core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetCatchSpi.java
=====================================
@@ -48,7 +48,7 @@ public class SetCatchSpi extends GeneratedSetCatchSpi {
childDto.setHasSample(hasSample);
});
}
- // on cherche si il y a des libérations d'espèce sensibles
+ // is there some non target catch release?
if (entity.isNonTargetCatchReleaseNotEmpty()) {
// get usable species ids
java.util.Set<String> speciesId = ToolkitId.ids(entity.getNonTargetCatchRelease().stream().map(NonTargetCatchRelease::getSpecies));
=====================================
core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-create.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"check if referential schoolType is disabled (only if validation is not strong)"
=====================================
core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-update.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"check if referential schoolType is disabled (only if validation is not strong)"
=====================================
model/src/main/models/Observe/dto/attribute/notNullIf.properties
=====================================
@@ -46,7 +46,7 @@ data.ps.localmarket.Batch.attribute.weight=countOrWeightValid
data.ps.logbook.Activity.attribute.latitude=floatingObjectEnabled && !setEnabled
data.ps.logbook.Activity.attribute.longitude=floatingObjectEnabled && !setEnabled
data.ps.logbook.Activity.attribute.quadrant=floatingObjectEnabled && !setEnabled
-data.ps.logbook.Activity.attribute.schoolType=!setEnabled
+data.ps.logbook.Activity.attribute.schoolType=!setEnabled || reasonForNoFishing != null
data.ps.logbook.Activity.attribute.setCount=!setEnabled
data.ps.logbook.Activity.attribute.setSuccessStatus=!setEnabled || reasonForNoFishing != null
data.ps.logbook.Catch.attribute.weight=count != null && count > 0
=====================================
server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create-error.xml
=====================================
@@ -234,9 +234,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"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
=====================================
@@ -234,9 +234,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"check if referential schoolType is disabled (only if validation is not strong)"
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/8a8f2a7c0d63cc02efe076f6…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/8a8f2a7c0d63cc02efe076f6…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 4 commits: Imperfection de la validation sur une activité de pêche - Closes #2581
by Tony CHEMIT (@tchemit) 03 Jan '23
by Tony CHEMIT (@tchemit) 03 Jan '23
03 Jan '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
1810406c by Tony Chemit at 2023-01-03T18:56:21+01:00
Imperfection de la validation sur une activité de pêche - Closes #2581
- - - - -
bdedac69 by Tony Chemit at 2023-01-03T18:56:26+01:00
Après création d'une activité, le nœud captures n'apparaît pas - Closes #2582
- - - - -
95d05194 by Tony Chemit at 2023-01-03T18:56:30+01:00
Les activités ne sont pas disponibles lors de la création d'un échantillon (mais disponible en mode mis à jour) - Closes #2584
- - - - -
8e4455c5 by Tony Chemit at 2023-01-03T18:56:33+01:00
Problème sur la sauvegarde d'un échantillon (si on lui associe des activités) - Closes #2585
- - - - -
12 changed files:
- client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/CapabilityDescriptor.java
- core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-update-error-validation.xml
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/SampleSpi.java
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-create.json
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-update.json
- model/src/main/models/Observe/dto/attribute/notNullIf.properties
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create.json
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update.json
Changes:
=====================================
client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/CapabilityDescriptor.java
=====================================
@@ -388,7 +388,7 @@ public class CapabilityDescriptor {
switch (capacityNodeType) {
case STATIC_WITH_PREDICATE: {
String beanPropertyName = getOptionalPredicate().orElseThrow();
- return String.format(" .onPredicate(d-> d.is%1$s() && d.get%2$sStatValue() > 0, %3$s.class)\n", beanPropertyName, Strings.removeEnd(beanPropertyName,"Enabled"), getNodeTypeSimpleName());
+ return String.format(" .onPredicate(%1$s::is%2$s, %3$s.class)\n", mainDtoType.getSimpleName(), beanPropertyName, getNodeTypeSimpleName());
}
case REFERENCE_LIST:
case REFERENCE: {
=====================================
core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
=====================================
@@ -9666,7 +9666,7 @@
"name": "schoolType",
"comments": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
]
},
{
@@ -9939,7 +9939,7 @@
"name": "schoolType",
"comments": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
]
},
{
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-create-error-validation.xml
=====================================
@@ -236,9 +236,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-update-error-validation.xml
=====================================
@@ -236,9 +236,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/SampleSpi.java
=====================================
@@ -29,6 +29,7 @@ import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.entities.data.ps.common.Trip;
import fr.ird.observe.entities.referential.ps.common.SampleType;
import fr.ird.observe.entities.referential.ps.logbook.SampleQuality;
+import fr.ird.observe.services.service.SaveResultDto;
import fr.ird.observe.spi.service.ServiceContext;
import java.util.Objects;
@@ -63,7 +64,9 @@ public class SampleSpi extends GeneratedSampleSpi {
preCreated.setSampleType(SampleType.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_SAMPLE_DEFAULT_SAMPLE_TYPE_ID));
preCreated.setSampleQuality(SampleQuality.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_SAMPLE_DEFAULT_SAMPLE_QUALITY_ID));
preCreated.setSuperSample(false);
- return super.preCreate(context, parent, preCreated);
+ Form<SampleDto> form = super.preCreate(context, parent, preCreated);
+ form.getObject().setActivity(Trip.SPI.getLogbookSetActivities(context, parent.getTopiaId()));
+ return form;
}
@Override
@@ -90,6 +93,13 @@ public class SampleSpi extends GeneratedSampleSpi {
private int getSampleSpeciesSubNumber(Sample entity) {
return (int) entity.getSampleSpecies().stream().mapToInt(SampleSpecies::getSubSampleNumber).distinct().count();
}
+
+ @Override
+ protected SaveResultDto saveEntity(ServiceContext context, Trip parent, Sample entity) {
+ SampleActivity.SPI.initId(context, entity.getSampleActivity());
+ return super.saveEntity(context, parent, entity);
+ }
+
//FIXME Add a callback in MoveRequest
// @Override
// public void moveCallback(Trip oldParent, Trip newParent, List<Sample> moved) {
=====================================
core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-create.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"check if referential schoolType is disabled (only if validation is not strong)"
=====================================
core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-update.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"check if referential schoolType is disabled (only if validation is not strong)"
=====================================
model/src/main/models/Observe/dto/attribute/notNullIf.properties
=====================================
@@ -46,7 +46,7 @@ data.ps.localmarket.Batch.attribute.weight=countOrWeightValid
data.ps.logbook.Activity.attribute.latitude=floatingObjectEnabled && !setEnabled
data.ps.logbook.Activity.attribute.longitude=floatingObjectEnabled && !setEnabled
data.ps.logbook.Activity.attribute.quadrant=floatingObjectEnabled && !setEnabled
-data.ps.logbook.Activity.attribute.schoolType=!setEnabled
+data.ps.logbook.Activity.attribute.schoolType=!setEnabled || reasonForNoFishing != null
data.ps.logbook.Activity.attribute.setCount=!setEnabled
data.ps.logbook.Activity.attribute.setSuccessStatus=!setEnabled || reasonForNoFishing != null
data.ps.logbook.Catch.attribute.weight=count != null && count > 0
=====================================
server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create-error.xml
=====================================
@@ -234,9 +234,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-create.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"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
=====================================
@@ -234,9 +234,9 @@
</field>
<field name="schoolType">
- <!-- schoolType is mandatory except if !setEnabled -->
+ <!-- schoolType is mandatory except if !setEnabled || reasonForNoFishing != null -->
<field-validator type="mandatory" short-circuit="true">
- <param name="skip"><![CDATA[ !setEnabled ]]></param>
+ <param name="skip"><![CDATA[ !setEnabled || reasonForNoFishing != null ]]></param>
<message>observe.data.ps.logbook.Activity.schoolType.validation.required</message>
</field-validator>
=====================================
server/runner/src/main/webResources/doc/api/public/data/ps/logbook/Activity/validation-update.json
=====================================
@@ -124,7 +124,7 @@
"schoolType": {
"errors": [
"check if referential schoolType is disabled (only if validation is strong)",
- "schoolType is mandatory except if !setEnabled"
+ "schoolType is mandatory except if !setEnabled || reasonForNoFishing != null"
],
"warnings": [
"check if referential schoolType is disabled (only if validation is not strong)"
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/8b41a19189b06da580e06945…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/8b41a19189b06da580e06945…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Lors de la suppression gloable d'une capture utilisée sur le formulaire...
by Tony CHEMIT (@tchemit) 03 Jan '23
by Tony CHEMIT (@tchemit) 03 Jan '23
03 Jan '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
8b41a191 by Tony Chemit at 2023-01-03T14:29:58+01:00
Lors de la suppression gloable d'une capture utilisée sur le formulaire espèces sensibles, la demande de confirmation n'est pas proposée (mais elle l'est bien si l'espèce est utilisée dans un échantillon) - Closes #2580
- - - - -
2 changed files:
- core/api/dto/src/main/java/fr/ird/observe/dto/data/ps/observation/SetCatchDto.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetCatchSpi.java
Changes:
=====================================
core/api/dto/src/main/java/fr/ird/observe/dto/data/ps/observation/SetCatchDto.java
=====================================
@@ -53,7 +53,7 @@ public class SetCatchDto extends GeneratedSetCatchDto {
* @return set of unsafe species used in catches
*/
public Set<SpeciesReference> getUnsafeSpecies() {
- return getCatches().stream().filter(CatchDto::isHasSample).map(CatchDto::getSpecies).collect(Collectors.toSet());
+ return getCatches().stream().filter(c -> c.isHasSample() || c.isHasRelease()).map(CatchDto::getSpecies).collect(Collectors.toSet());
}
/**
=====================================
core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetCatchSpi.java
=====================================
@@ -48,7 +48,7 @@ public class SetCatchSpi extends GeneratedSetCatchSpi {
childDto.setHasSample(hasSample);
});
}
- // on cherche si il y a des libérations d'espèce sensibles
+ // is there some non target catch release?
if (entity.isNonTargetCatchReleaseNotEmpty()) {
// get usable species ids
java.util.Set<String> speciesId = ToolkitId.ids(entity.getNonTargetCatchRelease().stream().map(NonTargetCatchRelease::getSpecies));
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/8b41a19189b06da580e06945c…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/8b41a19189b06da580e06945c…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] 2 commits: Impossible de créer une route en 9.0.22 - Closes #2579
by Tony CHEMIT (@tchemit) 03 Jan '23
by Tony CHEMIT (@tchemit) 03 Jan '23
03 Jan '23
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
0d8cc4c6 by Tony Chemit at 2023-01-03T12:49:20+01:00
Impossible de créer une route en 9.0.22 - Closes #2579
- - - - -
8a8f2a7c by Tony Chemit at 2023-01-03T13:03:36+01:00
Happy new yar commit \o/
- - - - -
30 changed files:
- client/configuration/pom.xml
- client/configuration/src/main/assembly/dcp-presets.xml
- client/configuration/src/main/filtered-resources/log4j2.xml
- client/configuration/src/main/filtered-resources/observe-log4j2.xml
- client/configuration/src/main/i18n/templates/about_en_GB.ftl
- client/configuration/src/main/i18n/templates/about_es_ES.ftl
- client/configuration/src/main/i18n/templates/about_fr_FR.ftl
- client/configuration/src/main/java/fr/ird/observe/client/ObServeSwingSessionConfig.java
- client/configuration/src/main/java/fr/ird/observe/client/ObserveSwingSession.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfigFinder.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientResources.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/SeineBycatchObservedSystemConfigConverter.java
- client/configuration/src/test/java/fr/ird/observe/client/configuration/ClientConfigTest.java
- client/core/pom.xml
- client/core/src/main/i18n/templates/ConfigurationModel_en_GB.ftl
- client/core/src/main/i18n/templates/ConfigurationModel_es_ES.ftl
- client/core/src/main/i18n/templates/ConfigurationModel_fr_FR.ftl
- client/core/src/main/i18n/templates/DataSourceInitModel_en_GB.ftl
- client/core/src/main/i18n/templates/DataSourceInitModel_es_ES.ftl
- client/core/src/main/i18n/templates/DataSourceInitModel_fr_FR.ftl
- client/core/src/main/i18n/templates/InitStorageModel_en_GB.ftl
- client/core/src/main/i18n/templates/InitStorageModel_es_ES.ftl
- client/core/src/main/i18n/templates/InitStorageModel_fr_FR.ftl
- client/core/src/main/i18n/templates/ObserveSwingDataSource_en_GB.ftl
- client/core/src/main/i18n/templates/ObserveSwingDataSource_es_ES.ftl
- client/core/src/main/i18n/templates/ObserveSwingDataSource_fr_FR.ftl
- client/core/src/main/i18n/templates/feedBackOnClosingLocalDataSource_en_GB.ftl
- client/core/src/main/i18n/templates/feedBackOnClosingLocalDataSource_es_ES.ftl
- client/core/src/main/i18n/templates/feedBackOnClosingLocalDataSource_fr_FR.ftl
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/b6e1143a2781aea6c9654349…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/b6e1143a2781aea6c9654349…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 2 commits: Impossible de créer une route en 9.0.22 - Closes #2579
by Tony CHEMIT (@tchemit) 03 Jan '23
by Tony CHEMIT (@tchemit) 03 Jan '23
03 Jan '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
48d3f051 by Tony Chemit at 2023-01-03T13:13:33+01:00
Impossible de créer une route en 9.0.22 - Closes #2579
- - - - -
6a8578ab by Tony Chemit at 2023-01-03T13:20:42+01:00
Happy new yar commit \o/
- - - - -
30 changed files:
- client/configuration/pom.xml
- client/configuration/src/main/assembly/dcp-presets.xml
- client/configuration/src/main/filtered-resources/log4j2.xml
- client/configuration/src/main/filtered-resources/observe-log4j2.xml
- client/configuration/src/main/i18n/templates/about_en_GB.ftl
- client/configuration/src/main/i18n/templates/about_es_ES.ftl
- client/configuration/src/main/i18n/templates/about_fr_FR.ftl
- client/configuration/src/main/java/fr/ird/observe/client/ObServeSwingSessionConfig.java
- client/configuration/src/main/java/fr/ird/observe/client/ObserveSwingSession.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfigFinder.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientResources.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/SeineBycatchObservedSystemConfigConverter.java
- client/configuration/src/test/java/fr/ird/observe/client/configuration/ClientConfigTest.java
- client/core/pom.xml
- client/core/src/main/i18n/templates/ConfigurationModel_en_GB.ftl
- client/core/src/main/i18n/templates/ConfigurationModel_es_ES.ftl
- client/core/src/main/i18n/templates/ConfigurationModel_fr_FR.ftl
- client/core/src/main/i18n/templates/DataSourceInitModel_en_GB.ftl
- client/core/src/main/i18n/templates/DataSourceInitModel_es_ES.ftl
- client/core/src/main/i18n/templates/DataSourceInitModel_fr_FR.ftl
- client/core/src/main/i18n/templates/InitStorageModel_en_GB.ftl
- client/core/src/main/i18n/templates/InitStorageModel_es_ES.ftl
- client/core/src/main/i18n/templates/InitStorageModel_fr_FR.ftl
- client/core/src/main/i18n/templates/ObserveSwingDataSource_en_GB.ftl
- client/core/src/main/i18n/templates/ObserveSwingDataSource_es_ES.ftl
- client/core/src/main/i18n/templates/ObserveSwingDataSource_fr_FR.ftl
- client/core/src/main/i18n/templates/feedBackOnClosingLocalDataSource_en_GB.ftl
- client/core/src/main/i18n/templates/feedBackOnClosingLocalDataSource_es_ES.ftl
- client/core/src/main/i18n/templates/feedBackOnClosingLocalDataSource_fr_FR.ftl
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/6e5e93c3fd72d6615d0968a6…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/6e5e93c3fd72d6615d0968a6…
You're receiving this email because of your account on gitlab.com.
1
0