Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: df964e91 by tchemit at 2019-05-28T11:06:31Z [TREE] Parfois un affichage tronqué sans raison - See #1269 - - - - - f403408e by tchemit at 2019-05-28T11:06:52Z Make some adjustments on TripLongline form - - - - - e2ee500f by tchemit at 2019-05-28T11:50:09Z Improve landing form - - - - - 16 changed files: - client-core/src/main/i18n/getters/java.getter - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUI.jaxx - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUI.jcss - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUIHandler.java - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUIModel.java - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/landing/TripLonglineLandingUI.jaxx - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUI.jaxx - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUI.jcss - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUIHandler.java - client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTreeCellRenderer.java - observe-i18n/src/main/i18n/translations/observe_en_GB.properties - observe-i18n/src/main/i18n/translations/observe_es_ES.properties - observe-i18n/src/main/i18n/translations/observe_fr_FR.properties - validation/src/main/i18n/getters/validation-messages.getter - validation/src/main/resources/fr/ird/observe/dto/data/ll/landing/LandingLonglineDto-create-error-validation.xml - validation/src/main/resources/fr/ird/observe/dto/data/ll/landing/LandingLonglineDto-update-error-validation.xml Changes: ===================================== client-core/src/main/i18n/getters/java.getter ===================================== @@ -730,6 +730,10 @@ observe.common.TripDto.action.goToOpen.tip observe.common.TripDto.action.moves observe.common.TripDto.action.moves.tip observe.common.TripLonglineDto.message.not.open +observe.common.TripLonglineDto.with.logbooks.message +observe.common.TripLonglineDto.with.logbooks.title +observe.common.TripLonglineDto.with.observations.message +observe.common.TripLonglineDto.with.observations.title observe.common.TripLonglineLandingDto.action.delete.tip observe.common.TripLonglineLandingDto.action.goToOpen.short observe.common.TripLonglineLandingDto.action.goToOpen.tip ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUI.jaxx ===================================== @@ -69,16 +69,6 @@ <field name='activityLonglineObs' component='{actionDown}'/> </BeanValidator> - <script><![CDATA[ - -protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityObsDto> activities) { - return activities == null || activities.isEmpty(); -} - -]]> - </script> - - <!-- formulaire --> <JPanel id="body" layout='{new BorderLayout()}'> <JScrollPane id='bodyScrollPane' constraints='BorderLayout.CENTER'> <JTabbedPane id='mainTabbedPane'> @@ -226,7 +216,7 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityObsDt <JLabel id='availableDataLabel'/> </cell> <cell anchor='west' weightx="0.5"> - <JPanel layout="{new GridLayout(1,0)}"> + <JPanel layout="{new GridLayout(1,0)}" beanScope="model"> <BeanCheckBox id='observationsAvailability'/> <BeanCheckBox id='logbookAvailability'/> </JPanel> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUI.jcss ===================================== @@ -46,13 +46,9 @@ } /* ***************************************************************************** */ -/* CARACTERISTICS TAB ********************************************************* */ +/* GENERAL TAB **************************************************************** */ /* ***************************************************************************** */ -#ocean { - enabled:{canEditOcean(bean.getActivityLonglineObs())}; -} - #totalFishingOperationsNumber { font-weight:bold; text:{getStringValue(bean.getTotalFishingOperationsNumber())}; ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUIHandler.java ===================================== @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.ll.common; * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. @@ -28,6 +28,7 @@ import fr.ird.observe.client.ui.content.api.data.open.ContentOpenableUIHandler; import fr.ird.observe.client.ui.content.api.spi.ContentUIReferenceCache; import fr.ird.observe.client.ui.content.api.spi.ReferentialReferencesFilter; import fr.ird.observe.client.ui.content.api.ui.ObserveLayoutFocusTraversalPolicy; +import fr.ird.observe.client.ui.util.UIHelper; import fr.ird.observe.client.ui.util.tripMap.TripMapUI; import fr.ird.observe.dto.data.TripMapDto; import fr.ird.observe.dto.data.ll.common.TripLonglineDto; @@ -50,6 +51,12 @@ import javax.swing.JTabbedPane; import javax.swing.SwingUtilities; import java.awt.Component; import java.awt.Container; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyVetoException; +import java.beans.VetoableChangeListener; +import java.util.Objects; + +import static io.ultreia.java4all.i18n.I18n.t; /** * Created on 8/27/14. @@ -62,6 +69,13 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr private static final Logger log = LogManager.getLogger(TripLonglineUIHandler.class); private boolean buildTripMap = true; + private final VetoableChangeListener logbooksAvailabilityListener; + private final VetoableChangeListener observationsAvailabilityListener; + + TripLonglineUIHandler() { + logbooksAvailabilityListener = this::onLogbooksAvailabilityChanged; + observationsAvailabilityListener = this::onObservationsAvailabilityChanged; + } @Override public TripLonglineUIModel getModel() { @@ -76,7 +90,7 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr referenceCache.addReferentialFilter(TripLonglineDto.PROPERTY_LOGBOOK_DATA_ENTRY_OPERATOR, (ReferentialReferencesFilter<PersonDto, PersonReference>) PersonHelper::filterDataEntryOperatorReferences); referenceCache.addReferentialFilter(TripLonglineDto.PROPERTY_VESSEL, (ReferentialReferencesFilter<VesselDto, VesselReference>) incomingReferences -> { ClientConfig config = ObserveSwingApplicationContext.get().getConfig(); - return VesselHelper.filterVesselReferencesByVesselTypeIds(incomingReferences, config.getLonglineVesselTypeIds()); + return VesselHelper.filterVesselReferencesByVesselTypeIds(incomingReferences, config.getLonglineVesselTypeIds()); }); referenceCache.addReferentialFilter(TripLonglineDto.PROPERTY_SPECIES, (ReferentialReferencesFilter<SpeciesDto, SpeciesReference>) incomingReferences -> { String speciesListId = ObserveSwingApplicationContext.get().getConfig().getSpeciesListLonglineTripId(); @@ -95,7 +109,7 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr tripMap.getHandler().init(ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)); tripMap.addPropertyChangeListener(TripMapUI.PROPERTY_SHOW_OBSERVATION, e -> updateMapModel()); tripMap.addPropertyChangeListener(TripMapUI.PROPERTY_SHOW_LOGBOOK, e -> updateMapModel()); - getUi().getMainTabbedPane().addChangeListener(e -> { + ui.getMainTabbedPane().addChangeListener(e -> { JTabbedPane tripLonglineTabPane = (JTabbedPane) e.getSource(); TripLonglineUI ui1 = getUi(); TripMapUI tripMap1 = ui1.getTripMap(); @@ -201,6 +215,43 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto, Tr buildTripMap = true; } + @Override + public void startEditUI() { + super.startEditUI(); + TripLonglineUIModel model = getModel(); + TripLonglineDto bean = model.getBean(); + ui.getOcean().setEnabled(bean.getActivityObsCount() == 0 && bean.getActivityLogbookCount() == 0); + if (model.isUpdatingMode()) { + model.removeVetoableChangeListener(TripLonglineDto.PROPERTY_LOGBOOK_AVAILABILITY, logbooksAvailabilityListener); + model.removeVetoableChangeListener(TripLonglineDto.PROPERTY_OBSERVATIONS_AVAILABILITY, observationsAvailabilityListener); + model.addVetoableChangeListener(TripLonglineDto.PROPERTY_LOGBOOK_AVAILABILITY, logbooksAvailabilityListener); + model.addVetoableChangeListener(TripLonglineDto.PROPERTY_OBSERVATIONS_AVAILABILITY, observationsAvailabilityListener); + } + } + + @Override + public void stopEditUI() { + getModel().removeVetoableChangeListener(TripLonglineDto.PROPERTY_LOGBOOK_AVAILABILITY, logbooksAvailabilityListener); + getModel().removeVetoableChangeListener(TripLonglineDto.PROPERTY_OBSERVATIONS_AVAILABILITY, observationsAvailabilityListener); + super.stopEditUI(); + } + + private void onLogbooksAvailabilityChanged(PropertyChangeEvent event) throws PropertyVetoException { + if (getModel().isUpdatingMode() && Objects.equals(Boolean.FALSE, event.getNewValue()) && getModel().getBean().getActivityLogbookCount() > 0) { + String message = t("observe.common.TripLonglineDto.with.logbooks.message"); + UIHelper.displayWarning(t("observe.common.TripLonglineDto.with.logbooks.title"), message); + throw new PropertyVetoException(message, event); + } + } + + private void onObservationsAvailabilityChanged(PropertyChangeEvent event) throws PropertyVetoException { + if (getModel().isUpdatingMode() && Objects.equals(Boolean.FALSE, event.getNewValue()) && getModel().getBean().getActivityObsCount() > 0) { + String message = t("observe.common.TripLonglineDto.with.observations.message"); + UIHelper.displayWarning(t("observe.common.TripLonglineDto.with.observations.title"), message); + throw new PropertyVetoException(message, event); + } + } + private void buildTripMap() { SwingUtilities.invokeLater(() -> { ObserveSwingApplicationContext.get().getMainUI().getModel().setBusy(true); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/common/TripLonglineUIModel.java ===================================== @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.ll.common; * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. @@ -27,11 +27,16 @@ import fr.ird.observe.client.ui.content.api.data.open.ContentOpenableUIModel; import fr.ird.observe.dto.data.ll.common.TripLonglineDto; import fr.ird.observe.dto.data.ll.common.TripLonglineReference; import fr.ird.observe.dto.form.Form; +import io.ultreia.java4all.bean.JavaBean; +import io.ultreia.java4all.bean.definition.JavaBeanDefinition; +import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition; +import io.ultreia.java4all.i18n.I18n; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import io.ultreia.java4all.i18n.I18n; import org.nuiton.util.DateUtil; +import java.beans.PropertyChangeListener; +import java.beans.PropertyVetoException; import java.util.Date; /** @@ -40,7 +45,9 @@ import java.util.Date; * @author Tony Chemit - dev@tchemit.fr * @since XXX */ -public class TripLonglineUIModel extends ContentOpenableUIModel<TripLonglineDto, TripLonglineReference> { +@SuppressWarnings("WeakerAccess") +@GenerateJavaBeanDefinition +public class TripLonglineUIModel extends ContentOpenableUIModel<TripLonglineDto, TripLonglineReference> implements JavaBean { private static final long serialVersionUID = 1L; private static final Logger log = LogManager.getLogger(TripLonglineUIModel.class); @@ -49,6 +56,34 @@ public class TripLonglineUIModel extends ContentOpenableUIModel<TripLonglineDto, super(TripLonglineDto.class, I18n.n("observe.common.TripLonglineDto.message.not.open")); } + public boolean isLogbookAvailability() { + return getBean().isLogbookAvailability(); + } + + public void setLogbookAvailability(boolean logbookAvailability) { + try { + boolean oldValue = isLogbookAvailability(); + fireVetoableChange(TripLonglineDto.PROPERTY_LOGBOOK_AVAILABILITY, oldValue, logbookAvailability); + getBean().setLogbookAvailability(logbookAvailability); + firePropertyChange(TripLonglineDto.PROPERTY_LOGBOOK_AVAILABILITY, oldValue, logbookAvailability); + } catch (PropertyVetoException ignored) { + } + } + + public boolean isObservationsAvailability() { + return getBean().isObservationsAvailability(); + } + + public void setObservationsAvailability(boolean observationsAvailability) { + try { + boolean oldValue = isObservationsAvailability(); + fireVetoableChange(TripLonglineDto.PROPERTY_OBSERVATIONS_AVAILABILITY, oldValue, observationsAvailability); + getBean().setObservationsAvailability(observationsAvailability); + firePropertyChange(TripLonglineDto.PROPERTY_OBSERVATIONS_AVAILABILITY, oldValue, observationsAvailability); + } catch (PropertyVetoException ignored) { + } + } + @Override public void openForm(Form<TripLonglineDto> form) { super.openForm(form); @@ -59,19 +94,22 @@ public class TripLonglineUIModel extends ContentOpenableUIModel<TripLonglineDto, getBean().setEndDate(date); log.debug(getPrefix() + "date fin " + date); } + firePropertyChange(TripLonglineDto.PROPERTY_LOGBOOK_AVAILABILITY, isLogbookAvailability()); + firePropertyChange(TripLonglineDto.PROPERTY_OBSERVATIONS_AVAILABILITY, isObservationsAvailability()); } @Override + public void init(ContentUI ui) { super.init(ui); - getBean().addPropertyChangeListener(TripLonglineDto.PROPERTY_START_DATE, e->{ - TripLonglineDto bean = (TripLonglineDto) e.getSource(); - bean.updateNoOfDays(); - }); - getBean().addPropertyChangeListener(TripLonglineDto.PROPERTY_END_DATE, e->{ - TripLonglineDto bean = (TripLonglineDto) e.getSource(); - bean.updateNoOfDays(); - }); + PropertyChangeListener propertyChangeListener = e -> ((TripLonglineDto) e.getSource()).updateNoOfDays(); + getBean().addPropertyChangeListener(TripLonglineDto.PROPERTY_START_DATE, propertyChangeListener); + getBean().addPropertyChangeListener(TripLonglineDto.PROPERTY_END_DATE, propertyChangeListener); + } + + @Override + public JavaBeanDefinition javaBeanDefinition() { + return new TripLonglineUIModelJavaBeanDefinition(); } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/landing/TripLonglineLandingUI.jaxx ===================================== @@ -106,26 +106,26 @@ </cell> </row> - <!-- vessel --> + <!-- harbour --> <row> <cell> - <JLabel id='vesselLabel'/> + <JLabel id='harbourLabel'/> </cell> <cell weightx='1' anchor='east'> - <BeanFilterableComboBox id='vessel' constructorParams='this' genericType='VesselReference'/> + <JPanel layout="{new BorderLayout()}"> + <BeanFilterableComboBox id='harbour' constructorParams='this' genericType='HarbourReference' constraints='BorderLayout.CENTER'/> + <JButton id='selectTransshipment' constraints='BorderLayout.EAST'/> + </JPanel> </cell> </row> - <!-- harbour --> + <!-- vessel --> <row> <cell> - <JLabel id='harbourLabel'/> + <JLabel id='vesselLabel'/> </cell> <cell weightx='1' anchor='east'> - <JPanel layout="{new BorderLayout()}"> - <BeanFilterableComboBox id='harbour' constructorParams='this' genericType='HarbourReference' constraints='BorderLayout.CENTER'/> - <JButton id='selectTransshipment' constraints='BorderLayout.EAST'/> - </JPanel> + <BeanFilterableComboBox id='vessel' constructorParams='this' genericType='VesselReference'/> </cell> </row> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUI.jaxx ===================================== @@ -76,15 +76,6 @@ <field name='route' component='{actionDown}'/> </BeanValidator> - <script><![CDATA[ - -protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) { - return routes == null || routes.isEmpty(); -} - -]]> - </script> - <!-- formulaire --> <JPanel id="body" layout='{new BorderLayout()}'> <JScrollPane id='bodyScrollPane' constraints='BorderLayout.CENTER'> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUI.jcss ===================================== @@ -20,18 +20,6 @@ * #L% */ -#ocean { - enabled:{canEditOcean(bean.getRoute())}; -} - -#formsUrl { - openLinkTip:"observe.common.TripSeineDto.action.openLinkFormsUrl.tip"; -} - -#reportsUrl { - openLinkTip:"observe.common.TripSeineDto.action.openLinkReportsUrl.tip"; -} - #reopen { _toolTipText:{t("observe.common.TripDto.action.reopen.tip")}; } @@ -57,6 +45,18 @@ _observeAction:{MoveSingleTripSeineUIAction.ACTION_NAME}; } +/* ***************************************************************************** */ +/* GENERAL TAB **************************************************************** */ +/* ***************************************************************************** */ + +#formsUrl { + openLinkTip:"observe.common.TripSeineDto.action.openLinkFormsUrl.tip"; +} + +#reportsUrl { + openLinkTip:"observe.common.TripSeineDto.action.openLinkReportsUrl.tip"; +} + /* ***************************************************************************** */ /* MAP TAB ******************************************************************** */ /* ***************************************************************************** */ ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/common/TripSeineUIHandler.java ===================================== @@ -164,5 +164,11 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto, TripSein getUi().getTripMap().getHandler().doCloseMap(); buildTripMap = true; } + + @Override + public void startEditUI() { + super.startEditUI(); + ui.getOcean().setEnabled(getModel().getBean().getRouteCount() == 0); + } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTreeCellRenderer.java ===================================== @@ -31,6 +31,7 @@ import org.jdesktop.swingx.tree.DefaultXTreeCellRenderer; import javax.swing.Icon; import javax.swing.JLabel; import javax.swing.JTree; +import javax.swing.SwingUtilities; import javax.swing.tree.DefaultTreeCellRenderer; import java.awt.Color; import java.awt.Component; @@ -95,6 +96,13 @@ public class NavigationTreeCellRenderer extends DefaultXTreeCellRenderer impleme Dimension newSize = new Dimension((int) size.getWidth(), 32); comp.setSize(newSize); comp.setPreferredSize(newSize); + } else { + int stringWidth = SwingUtilities.computeStringWidth(comp.getFontMetrics(comp.getFont()), text); + if (size.getWidth()<stringWidth) { + log.error(String.format("Size is too low: %s for node: %s", size, text)); + Dimension newSize = new Dimension(stringWidth+5, (int)height); + comp.setPreferredSize(newSize); + } } return comp; } ===================================== observe-i18n/src/main/i18n/translations/observe_en_GB.properties ===================================== @@ -2396,6 +2396,10 @@ observe.common.TripLonglineDto.tripType=Trip type observe.common.TripLonglineDto.type=Trip observe.common.TripLonglineDto.types=Trips observe.common.TripLonglineDto.vessel=Vessel +observe.common.TripLonglineDto.with.logbooks.message=There is some logbook in this trip, can't unselect logbook avaibility +observe.common.TripLonglineDto.with.logbooks.title=Can't remove logbook avaibility +observe.common.TripLonglineDto.with.observations.message=There is some observations in this trip, can't unselect observations avaibility +observe.common.TripLonglineDto.with.observations.title=Can't remove observation avaibility observe.common.TripLonglineGearUseDto.gearUseFeaturesLongline=Gear use features observe.common.TripLonglineLandingDto.action.close.tip=Close the opened landing observe.common.TripLonglineLandingDto.action.create=Next landing @@ -3374,6 +3378,7 @@ observe.validation.hooksComposition.desactivated.hookSize=Selected hook size is observe.validation.hooksComposition.desactivated.hookType=Selected hook type is disabled. observe.validation.hooksComposition.required.hookType=Hook type must be filled. observe.validation.hooksComposition.required.proportion=Proportion must be filled. +observe.validation.landing.endDate.after.startDate=End date must be after start date. observe.validation.landingPartLongline.bound.categoryWeight=Max category must be strictly greater than min category. observe.validation.landingPartLongline.required.weight=Weight must be filled. observe.validation.landingPartLongline.required.weightMeasureMethod=Weight measure method must be filled. ===================================== observe-i18n/src/main/i18n/translations/observe_es_ES.properties ===================================== @@ -2396,6 +2396,10 @@ observe.common.TripLonglineDto.tripType=Tipo de marea observe.common.TripLonglineDto.type=Marea observe.common.TripLonglineDto.types=Mareas observe.common.TripLonglineDto.vessel=Buque +observe.common.TripLonglineDto.with.logbooks.message=There is some logbook in this trip, can't unselect logbook avaibility \#TODO +observe.common.TripLonglineDto.with.logbooks.title=Can't remove logbook avaibility \#TODO +observe.common.TripLonglineDto.with.observations.message=There is some observations in this trip, can't unselect observations avaibility \#TODO +observe.common.TripLonglineDto.with.observations.title=Can't remove observation avaibility \#TODO observe.common.TripLonglineGearUseDto.gearUseFeaturesLongline=Equipamiento observe.common.TripLonglineLandingDto.action.close.tip=Close the opened landing observe.common.TripLonglineLandingDto.action.create=Next landing @@ -3374,6 +3378,7 @@ observe.validation.hooksComposition.desactivated.hookSize=El tamaño de avanzuel observe.validation.hooksComposition.desactivated.hookType=El tipo de avanzuelo seleccionado está desactivado. observe.validation.hooksComposition.required.hookType=La selección de un tipo de avanzuelo es mandatoria. observe.validation.hooksComposition.required.proportion=La proporción está vacía. +observe.validation.landing.endDate.after.startDate=La fecha de fin debe ser supuerior a la fecha de inicio. observe.validation.landingPartLongline.bound.categoryWeight=Max category must be strictly greater than min category. observe.validation.landingPartLongline.required.weight=Weight must be filled. \#TODO observe.validation.landingPartLongline.required.weightMeasureMethod=Weight measure method must be filled. ===================================== observe-i18n/src/main/i18n/translations/observe_fr_FR.properties ===================================== @@ -2396,6 +2396,10 @@ observe.common.TripLonglineDto.tripType=Type de marée observe.common.TripLonglineDto.type=Marée observe.common.TripLonglineDto.types=Marées observe.common.TripLonglineDto.vessel=Navire +observe.common.TripLonglineDto.with.logbooks.message=Il existe des livres de bord sur cette marée, impossible de désactiver cette propriété +observe.common.TripLonglineDto.with.logbooks.title=Impossible de désactiver la présence des livres de bord +observe.common.TripLonglineDto.with.observations.message=Il existe des observations sur cette marée, impossible de désactiver cette propriété +observe.common.TripLonglineDto.with.observations.title=Impossible de désactiver la présence des observations observe.common.TripLonglineGearUseDto.gearUseFeaturesLongline=Équipements observe.common.TripLonglineLandingDto.action.close.tip=Clôturer le débarquement ouvert observe.common.TripLonglineLandingDto.action.create=Débarquement suivant @@ -3374,6 +3378,7 @@ observe.validation.hooksComposition.desactivated.hookSize=La taille d'hameçon s observe.validation.hooksComposition.desactivated.hookType=Le type d'hameçon sélectionné est désactivée. observe.validation.hooksComposition.required.hookType=La sélection d'un type d'hameçon est obligatoire. observe.validation.hooksComposition.required.proportion=Proportion non renseignée. +observe.validation.landing.endDate.after.startDate=La date de fin doit être supérieure à sa date de début. observe.validation.landingPartLongline.bound.categoryWeight=La catégorie de poids max doit être strictement supérieur à la catégorie min. observe.validation.landingPartLongline.required.weight=Le poids doit être renseigné. observe.validation.landingPartLongline.required.weightMeasureMethod=La méthode de mesure de poids est obligatoire. ===================================== validation/src/main/i18n/getters/validation-messages.getter ===================================== @@ -12,6 +12,7 @@ observe.validation.floatingObject.invalid.parts observe.validation.floatingObject.required.comment.for.balise1 observe.validation.floatingObject.required.comment.for.balise2 observe.validation.floatingObject.size.supportVesselName +observe.validation.landing.endDate.after.startDate observe.validation.landingPartLongline.bound.categoryWeight observe.validation.landingPartLongline.required.weightMeasureMethod observe.validation.lengthFormula.endDate.before.startDate ===================================== validation/src/main/resources/fr/ird/observe/dto/data/ll/landing/LandingLonglineDto-create-error-validation.xml ===================================== @@ -28,6 +28,15 @@ <message/> </field-validator> </field> + <field name="endDate"> + <!-- startDate <= endDate --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ endDate == null || startDate == null || endDate.time >= startDate.time ]]> + </param> + <message>observe.validation.landing.endDate.after.startDate</message> + </field-validator> + </field> <field name="comment"> <field-validator type="commentLengthFieldDto"> <message/> ===================================== validation/src/main/resources/fr/ird/observe/dto/data/ll/landing/LandingLonglineDto-update-error-validation.xml ===================================== @@ -28,6 +28,15 @@ <message/> </field-validator> </field> + <field name="endDate"> + <!-- startDate <= endDate --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ endDate == null || startDate == null || endDate.time >= startDate.time ]]> + </param> + <message>observe.validation.landing.endDate.after.startDate</message> + </field-validator> + </field> <field name="comment"> <field-validator type="commentLengthFieldDto"> <message/> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/f1b3590097677016ac5caadaca5... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/f1b3590097677016ac5caadaca5... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT